Skip to content

blackironj/kademlia

Repository files navigation

Kademlia-like

MIT licensed

GitHub Actions status

This is a Go implementation of a Kademlia-like dht using grpc

Currently, This project is experimental. So, I would not recommned using it in production enviroment.

Quick start

package main

import kad "github.com/blackironj/kademlia"

func main() {
	routingTable := kad.NewRoutingTable(
		&kad.Options{
			BucketSize: 10,
			ID:         "your unique id",
			IP:         "127.0.0.1",// your IP 
			Port:       "50051",    // your port number
		})
	// if Options are empty. Set default value

	kadNet := kad.NewKademliaNet(routingTable)

    // if you do not want to bootrap. it's okay to skip this step
    // generate a bootstrap node using node kad.NewNode(id, ip, port)
	bootstrapNodes := []kad.Node{}
	kadNet.Bootstrap(bootstrapNodes)

	kadNet.Start()
}

Releases

No releases published

Packages

No packages published

Languages