Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arriqaaq/chord
Implementation of Chord DHT(Distributed Hash Table) paper
https://github.com/arriqaaq/chord
chord consistent-hashing dht distributed-hash-table go golang p2p
Last synced: 25 days ago
JSON representation
Implementation of Chord DHT(Distributed Hash Table) paper
- Host: GitHub
- URL: https://github.com/arriqaaq/chord
- Owner: arriqaaq
- License: mit
- Created: 2018-08-28T08:37:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T06:39:09.000Z (almost 4 years ago)
- Last Synced: 2024-10-14T19:48:41.899Z (about 2 months ago)
- Topics: chord, consistent-hashing, dht, distributed-hash-table, go, golang, p2p
- Language: Go
- Homepage: https://medium.com/@arriqaaq/chord-building-a-dht-distributed-hash-table-in-golang-67c3ce17417b
- Size: 55.7 KB
- Stars: 187
- Watchers: 5
- Forks: 46
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - chord
README
# Chord
[WIP]
Implementation of Chord paper# Paper
https://pdos.csail.mit.edu/papers/ton:chord/paper-ton.pdf## Example Usage
```go
package mainimport (
"github.com/arriqaaq/chord"
"github.com/arriqaaq/chord/internal"
"log"
"os"
"os/signal"
"time"
)func createNode(id string, addr string, joinNode *internal.Node) (*chord.Node, error) {
cnf := chord.DefaultConfig()
cnf.Id = id
cnf.Addr = addr
cnf.Timeout = 10 * time.Millisecond
cnf.MaxIdle = 100 * time.Millisecondn, err := chord.NewNode(cnf, joinNode)
return n, err
}func main() {
joinNode := chord.NewInode("1", "0.0.0.0:8001")
h, err := createNode("8", "0.0.0.0:8003", joinNode)
if err != nil {
log.Fatalln(err)
return
}c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
<-c
h.Stop()
}
```# References
This implementation helped me a lot in designing the code base
https://github.com/r-medina/gmaj# TODO
- Add more test cases
- Add stats/prometheus stats