add article
This commit is contained in:
parent
9da172df28
commit
781ac5c70a
@ -84,9 +84,6 @@ Beneath HyperSwarm lies Hyper-DHT, the distributed hash table that enables decen
|
|||||||
- Public Key Identification:
|
- Public Key Identification:
|
||||||
Unlike traditional DHTs that rely on IP addresses, Hyper-DHT identifies peers using public keys. This makes it easy to connect to peers regardless of network changes.
|
Unlike traditional DHTs that rely on IP addresses, Hyper-DHT identifies peers using public keys. This makes it easy to connect to peers regardless of network changes.
|
||||||
|
|
||||||
- Bootstrapping and Discovery:
|
|
||||||
With a set of known bootstrap servers, a Hyper-DHT node can quickly join the network and start discovering peers.
|
|
||||||
|
|
||||||
- Direct P2P Connections:
|
- Direct P2P Connections:
|
||||||
You can both create P2P servers and initiate connections to remote servers using direct public keys.
|
You can both create P2P servers and initiate connections to remote servers using direct public keys.
|
||||||
|
|
||||||
@ -104,13 +101,7 @@ Below is a simple example that creates a new DHT node and demonstrates bootstrap
|
|||||||
const DHT = require('hyperdht')
|
const DHT = require('hyperdht')
|
||||||
|
|
||||||
// Create a DHT node with default bootstrap servers
|
// Create a DHT node with default bootstrap servers
|
||||||
const node = new DHT({
|
const node = new DHT()
|
||||||
bootstrap: [
|
|
||||||
'node1.hyperdht.org:49737',
|
|
||||||
'node2.hyperdht.org:49737',
|
|
||||||
'node3.hyperdht.org:49737'
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
// Generate a key pair for the node (or use an existing one)
|
// Generate a key pair for the node (or use an existing one)
|
||||||
const keyPair = DHT.keyPair()
|
const keyPair = DHT.keyPair()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user