Relay is not working #3716
Description
- Version:
0.6.1
- Platform:
(WSL) Microsoft x86_64 x86_64 x86_64 GNU/Linux
(MacOS) Darwin Kernel Version 20.4.0
- Subsystem:
Guess it's about js-libp2p
, ipfs-core
Severity:
Medium?
Description:
Relay is not working
Steps to reproduce the error:
according to this ipfs-core usage (https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying#so-what-just-happened)
- In
ipfs-core
and nodejs,ipfs.create
withrelay: { enable: true }
, relay is not working either. - log
await ipfs.swarm.addrs()
- not seeing
/p2p-circuit
Update
I found out that if the repo
is created by $ jsipfs init
, then it'll have the /p2p-circuit/
but if it's created by ipfs-core
const node = await ipfs.create({
repo: '<repo_path>'
});
const addrs = await node.swarm.addrs();
// check all addrs, do not have the `/p2p-circuit/`
then the relay will not work, the relay.enabled seems not the point.
Update 2
Guess the root cause is the jsipfs get the p2p-circuit
slowly, so only the daemon one has the p2p-circuit, and if I create the repo in app, then I'll not have the p2p-circuit address immediately...
Update 3
Also the $ jsipfs daemon
not always get the /p2p-circuit
$ rm -rf ~/.jsipfs
$ jsipfs init
$ jsipfs daemon
// another session
$ jsipfs swarm addrs | grep p2p
Sometime attached circuit-relay in few seconds, sometimes still not have /p2p-circuit/
in few minutes