-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
58 lines (34 loc) · 1.59 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
DHT is a distributed hash table based on the Kademlia paper:
https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf.
It also uses the S/Kademlia extension "crypto puzzles" to impede Eclipse and
Sybil attacks (see the PROTOCOL, section 14 "Node ID Generation" for details).
S/Kademlia paper: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.68.4986&rep=rep1&type=pdf
DHT also includes many other security measures:
- Node IDs are Ed25519 keypairs.
- All messages are signed by the node's private key.
- All messages are encrypted with the recipient's public key.
- Fixed-size (UDP) messages are padded to avoid leaking message type.
The network is completely decentralized. For more details read the PROTOCOL.
To operate a node:
1. Install golang: golang.org/dl
On Linux distributions like Ubuntu, Fedora, etc. you should be able to install a
"golang" package through your package manager.
2. Download dht with:
go get -u github.com/esote/dht/cmd/dht
This will create a "dht" executable in your go/bin folder. Add ~/go/bin to PATH.
3. Create a working directory, for example
mkdir /tmp/dht
3. Start a node
dht /tmp/dht start PORT
The program will ask for a password to encrypt the node's private key.
4. Stop a node
dht /tmp/dht stop
5. Bootstrap another node
dht /tmp/dht bootstrap ID IP:PORT
Bootstrap a node, ID must be full base64 code, IP must be an
IPv4 or IPv6 address (hostnames not allowed).
6. Store a file on the network
dht /tmp/dht store /PATH/TO/FILE
7. Load a file from the network
dht /tmp/dht load KEY /PATH/TO/OUTPUT
KEY must be full base64 code.