rustblockchainsubstratelibp2p

How to extend connection timeout in node-template, when joining a private network?


I was following the Creating Your Private Network tutorial. I have a running the bootnode in my local machine, and I want a new participant from AWS to join in my network. But somehow, i keep getting 0 peers.

I added the logs RUST_LOG=debug and found this:

2021-08-04 02:06:40.563 DEBUG tokio-runtime-worker libp2p_dns: Dialing /ip4/130.105.xxx.xxx/tcp/30333/p2p/12D3KooxxxNr    
2021-08-04 02:06:40.563 DEBUG tokio-runtime-worker libp2p_tcp: dialing 130.105.xxx.xxx:30333    
2021-08-04 02:06:40.563 DEBUG tokio-runtime-worker libp2p_swarm: Connection attempt to PeerId("12D3KooxxxNr") via "/ip4/130.105.xxx.xxx/tcp/30333/p2p/12D3KooxxxNr" failed with Transport(Other(Custom { kind: Other, error: Timeout })). Attempts remaining: 2.    
2021-08-04 02:06:40.563 DEBUG tokio-runtime-worker libp2p_kad::behaviour: Last remaining address '/ip4/130.105.xxx.xxx/tcp/30333/p2p/12D3KooxxxNr' of peer '12D3KooxxxNr' is unreachable: Pending connection: Transport error: Timeout has been reached.

I read it somewhere, that it takes 5 minutes to connect. How do I increase the timeout period?


Solution

  • I think your local machine doesn't have a public IP address.

    I recommend you to set your AWS as the bootnode then connect from your local machine.