Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed circuit relay address #449

Closed
sandreae opened this issue Jul 14, 2023 · 0 comments · Fixed by #451
Closed

Malformed circuit relay address #449

sandreae opened this issue Jul 14, 2023 · 0 comments · Fixed by #451

Comments

@sandreae
Copy link
Member

sandreae commented Jul 14, 2023

When relay and rendezvous address are set this error occurs:

Listen on circuit relay address: Some("/ip4/209.97.139.109/udp/2022/quic-v1/p2p/12D3KooWRDdfnngy3kGX5KAKT7kZkwL2hVJnTtsExT6rfUaDVPZs/p2p/12D3KooWRDdfnngy3kGX5KAKT7kZkwL2hVJnTtsExT6rfUaDVPZs/p2p-circuit/p2p/12D3KooWQDMCuosb7FSiVekTaih2ycnHgg5giyNn2BTEjAP2mhB3")
Err(
    Other(
        Custom {
            kind: Other,
            error: Right(
                Left(
                    Left(
                        MalformedMultiaddr,
                    ),
                ),
            ),
        },
    ),
)

Because the address is being incorrectly composed here:

// Construct circuit relay addresses and listen on relayed address
if let Some(relay_addr) = &network_config.relay_address {
if let Some(rendezvous_peer_id) = network_config.rendezvous_peer_id {
let circuit_addr = relay_addr
.clone()
.with(Protocol::P2p(rendezvous_peer_id))
.with(Protocol::P2pCircuit);
// Dialable circuit relay address for local node
external_circuit_addr = Some(circuit_addr.clone().with(Protocol::P2p(local_peer_id)));
swarm.listen_on(circuit_addr)?;
} else {
warn!("Unable to construct relay circuit address because rendezvous server peer ID was not provided");
}
}

It should look like this:

// Construct circuit relay addresses and listen on relayed address
if let Some(relay_addr) = &network_config.relay_address {
    let circuit_addr = relay_addr.clone().with(Protocol::P2pCircuit);

    // Dialable circuit relay address for local node
    external_circuit_addr = Some(circuit_addr.clone().with(Protocol::P2p(local_peer_id)));

    swarm.listen_on(circuit_addr)?;
}
@sandreae sandreae changed the title Malformed circuit address Malformed circuit relay address Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant