加入专用网络时如何在节点模板中延长连接超时?

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

我正在学习 Creating Your Private Network 教程。 我的本地计算机中有一个 运行 引导节点,我希望 AWS 的新参与者加入我的网络。但不知何故,我不断收到 0 peers.

我添加了日志 RUST_LOG=debug 并发现:

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.

我在某处读到它需要 5 minutes 才能连接。 如何增加超时时间?

我认为您的本地计算机没有 public IP 地址。

我建议您将 AWS 设置为引导节点,然后从您的本地计算机连接。