You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

4 years ago
  1. # go-dht [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucube/go-dht)](https://goreportcard.com/report/github.com/arnaucube/go-dht) [![Build Status](https://travis-ci.org/arnaucube/go-dht.svg?branch=master)](https://travis-ci.org/arnaucube/go-dht)
  2. Kademlia DHT Go implementation.
  3. Following the specification from
  4. - https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf
  5. - http://xlattice.sourceforge.net/components/protocol/kademlia/specs.html
  6. ## Run
  7. To run a node:
  8. ```
  9. go run main.go --config config.test0.yaml --debug start
  10. ```
  11. ## Test
  12. - Scenario:
  13. ```
  14. +--+ +--+
  15. |n0+-----------+n1|
  16. +-++ +--+
  17. |
  18. |
  19. | +--+ +--+
  20. +----+n2+-----------+n3|
  21. +--+ +--+
  22. ```
  23. - To run 4 test nodes inside a tmux session:
  24. ```
  25. bash run-dev-nodes.sh
  26. ```
  27. Using the `test.go` in the `rpc-test` directory:
  28. - calls to the node to perform lookups
  29. - `go run test.go -find`
  30. - performs an `admin` call to `Find` node, to the `n0`, asking about the `n3`
  31. - calls to simulate kademlia protocol rpc calls
  32. - `go run test.go -ping`
  33. - performs the `PING` call
  34. - `go run test.go -findnode`
  35. - performs the `FIND_NODE` call
  36. - `go run test.go -findvalue`
  37. - performs the `FIND_VALUE` call
  38. - `go run test.go -store`
  39. - performs the `STORE` call