We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9edd14a commit 621d6c6Copy full SHA for 621d6c6
main.go
@@ -4,4 +4,8 @@ import "x-bootstrap-node/p2p"
4
5
func main() {
6
p2p.InitP2P()
7
+
8
+ // wait forever
9
+ c := make(chan interface{})
10
+ <-c
11
}
p2p/p2p.go
@@ -4,6 +4,7 @@ import (
"x-bootstrap-node/xutil"
"github.com/perlin-network/noise"
+ "github.com/perlin-network/noise/kademlia"
)
var Node *noise.Node = nil
@@ -28,6 +29,9 @@ func InitP2P() {
28
29
return nil
30
})
31
32
+ k := kademlia.New()
33
+ Node.Bind(k.Protocol())
34
35
if err := Node.Listen(); err != nil {
36
panic(err)
37
0 commit comments