-
I'm facing problems when establishing a relayed connection using the recently implemented circuit-relay-v2 ScenarioNode A, R, and B
$ mynode --listen 127.0.0.1 --port 4001
$ mynode --listen 127.0.0.1 --port 4002
$ mynode --dial /ip4/127.0.0.1/tcp/4001/p2p/<NodeRpeerId>
$ mynode --listen 127.0.0.1 --port 4003
$ mynode --dial /ip4/127.0.0.1/tcp/4001/p2p/<NodeRpeerId>/p2p-circuit/p2p/<NodeBpeerId> ResultNode A establishes a connection with Node R successfully, but then a error follows in both of them: Node R output:
Node A output:
Node B output: What step I might be missing here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
👋 sorry for the late reply here. It looks like Node B does not make a reservation with R. You would need to make sure Node B listens via R, in other words that node B makes a reservation with R. Unless B has a reservation with R, R will not relay a connection from A to B. To "listen via" R, B needs to call See example: rust-libp2p/protocols/relay/tests/v2.rs Lines 53 to 60 in e66f04f Does that solve your issue @demfabris? |
Beta Was this translation helpful? Give feedback.
👋 sorry for the late reply here.
It looks like Node B does not make a reservation with R. You would need to make sure Node B listens via R, in other words that node B makes a reservation with R. Unless B has a reservation with R, R will not relay a connection from A to B.
To "listen via" R, B needs to call
Swarm::listen_on
with a relayed address, e.g./ip4/127.0.0.1/tcp/4001/p2p/<NodeRpeerId>/p2p-circuit
.See example:
rust-libp2p/protocols/relay/tests/v2.rs
Lines 53 to 60 in e66f04f