From b57bd9e5c1922af1334bc8a0e86aab16563fa544 Mon Sep 17 00:00:00 2001 From: Junyu Wang Date: Sun, 26 Jul 2020 16:13:43 -0700 Subject: [PATCH] fixed relay example - removed circuit.OptDiscovery since it's a no-ope now - updated relay address to include relay node. (Not sure how it worked before) --- relay/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relay/main.go b/relay/main.go index f78bbf9..e665725 100644 --- a/relay/main.go +++ b/relay/main.go @@ -18,7 +18,7 @@ func main() { // of them. // Tell the host to monitor for relays. - h1, err := libp2p.New(context.Background(), libp2p.EnableRelay(circuit.OptDiscovery)) + h1, err := libp2p.New(context.Background(), libp2p.EnableRelay()) if err != nil { panic(err) } @@ -65,7 +65,7 @@ func main() { fmt.Println("Just as we suspected") // Creates a relay address - relayaddr, err := ma.NewMultiaddr("/p2p-circuit/ipfs/" + h3.ID().Pretty()) + relayaddr, err := ma.NewMultiaddr("/p2p/" + h2.ID().Pretty() + "/p2p-circuit/p2p/" + h3.ID().Pretty()) if err != nil { panic(err) }