Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/asabya/libp2p-kad-dht-trail

Hello world libp2p local network with rendezvous discovery
https://github.com/asabya/libp2p-kad-dht-trail

discovery go-libp2p rendezvous

Last synced: 7 days ago
JSON representation

Hello world libp2p local network with rendezvous discovery

Awesome Lists containing this project

README

        

# libp2p-kad-dht-trail

Hello world local libp2p network with kad-dht rendezvous discovery

# How to test

First clone the repo, then goto `bootstrap` and run that. You will get a multiaddress.

```
$ cd bootstrap
$ go run main.go

This node is QmRDzQAZ9bdDWwfK4i33qtPW3Eziditovvg3D7Sn3dWN7f
Available multiaddrs :
/ip4/127.0.0.1/tcp/4000/p2p/QmRDzQAZ9bdDWwfK4i33qtPW3Eziditovvg3D7Sn3dWN7f

```
Now in root run the `main.go` file

```
$ go run main.go --bootstrap /ip4/127.0.0.1/tcp/4000/p2p/QmRDzQAZ9bdDWwfK4i33qtPW3Eziditovvg3D7Sn3dWN7f --port 3000
```

you will be connected to the bootstrap. In another terminal run the same command with different port
```
$ go run main.go --bootstrap /ip4/127.0.0.1/tcp/4000/p2p/QmRDzQAZ9bdDWwfK4i33qtPW3Eziditovvg3D7Sn3dWN7f --port 3001
```

You should see bot nodes getting connected

# Project52

It is one of my [project 52](https://github.com/Sab94/project52).