libp2p / go-libp2p-examples

Example libp2p applications
MIT License
339 stars 145 forks source link

Relay Example error #178

Closed xiaokugua250 closed 4 years ago

xiaokugua250 commented 4 years ago

when i run relay example in https://github.com/libp2p/go-libp2p-examples/tree/master/relay i get two errors

  1. h1, err := libp2p.New(context.Background(), libp2p.EnableRelay(circuit.OptDiscovery)) error is circuit.OptDiscovery is now a no-op: dialing peers with a random relay is no longer supported
  2. relayaddr, err := ma.NewMultiaddr("/p2p-circuit/p2p/"+ h3.ID().Pretty()) report an't dial a p2p-circuit without specifying a relay: /p2p-circuit/p2p/QmPTjoYNMLSR8wzeRToMCwokMqCjz1TwBTdbJq7nX4TsWN image

so how to use the libp2p-circuit ? or any other examples? final i get these fixed by set relayaddr, err := ma.NewMultiaddr("/p2p/"+h2.ID().Pretty()+"/p2p-circuit/p2p/"+ h3.ID().Pretty())

xiaokugua250 commented 4 years ago

but when i write my own relay code and run it in 3 terminal i got error like this length greater than remaining number of bytes in buffer i dont know how to fix it , which raw code is in https://github.com/multiformats/multihash image

xiaokugua250 commented 4 years ago

d