2

I Cannot get the two Substrate Nodes to Work together in a local Network between two different PC running on Win11 + WSL

I have followed the Tutorial and everything seems ok till the point that i am not getting any Peer Connections.

So my question is can the Substrate Node run in this setup or what i am doing wrong? i have checked Ports (See End of Post for Portcheck with netstat) can two PC communicate over 127.0.0.1? if not how do i set it up to run on a local Network like 192.168? or can i run it via ip4 or ip6 via the Internet?

Thanks to everybody in advance who can help.

What i have done so far:

I have followed the tutorial about ADD TRUSTED NODES

and i managed succssesfully to:

  1. Generate local Keys
  2. Custom Chain Specs (Added Aura and Grandpa Authorities and converted to RAW)
  3. Started Node01 on first PC (Windows11+WSL)`
./target/release/node-template \
  --base-path /tmp/node01 \
  --chain ./customSpecRaw.json \
  --port 30333 \
  --ws-port 9945 \
  --rpc-port 9933 \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
  --validator \
  --rpc-methods Unsafe \
  --name MyNode01 \
  --password-interactive
  1. Added Keystore to Node01 (Keystore check works, Node ask for PW when starting if PW is correct Node is starting up and Waiting for other Peers)

This is the Output from Node 01 so Far:

2023-05-05 10:24:44 ✌️  version 4.0.0-dev-dbc8f3265f9      
2023-05-05 10:24:44 πŸ“‹ Chain specification: Chain-Testnet-DEV    
2023-05-05 10:24:44 🏷  Node name: MyNode01    
2023-05-05 10:24:44 πŸ‘€ Role: AUTHORITY    
2023-05-05 10:24:44 πŸ’Ύ Database: RocksDb at /tmp/node01/chains/local_testnet/db/full    
2023-05-05 10:24:44 β›“  Native runtime: Network-Node-100 (Network-Node-1.tx1.au1)    
2023-05-05 10:24:44 Using default protocol ID "sup" because none is configured in the chain specs    
2023-05-05 10:24:44 🏷  Local node identity is: 12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH    
2023-05-05 10:24:44 πŸ’» Operating system: linux    
2023-05-05 10:24:44 πŸ’» CPU architecture: x86_64    
2023-05-05 10:24:44 πŸ’» Target environment: gnu    
2023-05-05 10:24:44 πŸ’» CPU: AMD Ryzen 7 5800X 8-Core Processor    
2023-05-05 10:24:44 πŸ’» CPU cores: 8    
2023-05-05 10:24:44 πŸ’» Memory: 15958MB    
2023-05-05 10:24:44 πŸ’» Kernel: 5.15.90.1-microsoft-standard-WSL2    
2023-05-05 10:24:44 πŸ’» Linux distribution: Ubuntu 22.04.1 LTS    
2023-05-05 10:24:44 πŸ’» Virtual machine: yes    
2023-05-05 10:24:44 πŸ“¦ Highest known block at #0    
2023-05-05 10:24:44 〽️ Prometheus exporter started at 127.0.0.1:9615    
2023-05-05 10:24:44 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 10:24:44 Running JSON-RPC WS server: addr=127.0.0.1:9945, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 10:24:49 πŸ’€ Idle (0 peers), best: #0 (0x84c0…87ca), finalized #0 (0x84c0…87ca), ⬇ 0 ⬆ 0    
2023-05-05 10:24:54 πŸ’€ Idle (0 peers), best: #0 (0x84c0…87ca), finalized #0 (0x84c0…87ca), ⬇ 0 ⬆ 0    
2023-05-05 10:24:59 πŸ’€ Idle (0 peers), best: #0 (0x84c0…87ca), finalized #0 (0x84c0…87ca), ⬇ 0 ⬆ 0    
2023-05-05 10:25:04 πŸ’€ Idle (0 peers), best: #0 (0x84c0…87ca), finalized #0 (0x84c0…87ca), ⬇ 0 ⬆ 0    
2023-05-05 10:25:04 ❌ Error while dialing /dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F: Custom { kind: Other, error: Timeout }    
2023-05-05 10:25:09 πŸ’€ Idle (0 peers), best: #0 (0x84c0…87ca), finalized #0 (0x84c0…87ca), ⬇ 0 ⬆ 0
  1. Started Node02 on second PC (Windows11+WSL) Changed the NODE ID to my Node
./target/release/node-template \

  --base-path /tmp/node02 \
  --chain ./customSpecRaw.json \
  --port 30334 \
  --ws-port 9946 \
  --rpc-port 9934 \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
  --validator \
  --rpc-methods Unsafe \
  --name MyNode02 \
  --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH \
  --password-interactive`
  1. Added Keystore to Node02 (also Keystore check works, Node ask for PW when starting, if PW is correct Node is starting.

here is the Output from Node02:

2023-05-05 10:40:01 ✌️  version 4.0.0-dev-66faadab556     
2023-05-05 10:40:01 πŸ“‹ Chain specification: Chain-Testnet    
2023-05-05 10:40:01 🏷  Node name: reminiscent-father-3257    
2023-05-05 10:40:01 πŸ‘€ Role: FULL    
2023-05-05 10:40:01 πŸ’Ύ Database: RocksDb at /home/LOCALUSER/.local/share/node-template/chains/local_testnet/db/full    
2023-05-05 10:40:01 β›“  Native runtime: Network-Node-100 (Network-Node-1.tx1.au1)    
2023-05-05 10:40:01 Using default protocol ID "sup" because none is configured in the chain specs    
2023-05-05 10:40:01 🏷  Local node identity is: 12D3KooWCouowzeu2c6p8YqxTjtBCnf4Wt2iwFGUsVSuj3dSmeZV    
2023-05-05 10:40:01 πŸ’» Operating system: linux    
2023-05-05 10:40:01 πŸ’» CPU architecture: x86_64    
2023-05-05 10:40:01 πŸ’» Target environment: gnu    
2023-05-05 10:40:01 πŸ’» CPU: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz    
2023-05-05 10:40:01 πŸ’» CPU cores: 4    
2023-05-05 10:40:01 πŸ’» Memory: 7817MB    
2023-05-05 10:40:01 πŸ’» Kernel: 5.15.90.1-microsoft-standard-WSL2    
2023-05-05 10:40:01 πŸ’» Linux distribution: Ubuntu 22.04.2 LTS    
2023-05-05 10:40:01 πŸ’» Virtual machine: yes    
2023-05-05 10:40:01 πŸ“¦ Highest known block at #0    
2023-05-05 10:40:01 〽️ Prometheus exporter started at 127.0.0.1:9615    
2023-05-05 10:40:01 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 10:40:01 Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 10:40:06 πŸ’€ Idle (0 peers), best: #0 (0x4e7f…66ca), finalized #0 (0x4e7f…66ca), ⬇ 0 ⬆ 0    
2023-05-05 10:40:11 πŸ’€ Idle (0 peers), best: #0 (0x4e7f…66ca), finalized #0 (0x4e7f…66ca), ⬇ 0 ⬆ 0    
2023-05-05 10:40:16 πŸ’€ Idle (0 peers), best: #0 (0x4e7f…66ca), finalized #0 (0x4e7f…66ca), ⬇ 0 ⬆ 0    
2023-05-05 10:40:21 πŸ’€ Idle (0 peers), best: #0 (0x4e7f…66ca), finalized #0 (0x4e7f…66ca), ⬇ 0 ⬆ 0    
2023-05-05 10:40:26 πŸ’€ Idle (0 peers), best: #0 (0x4e7f…66ca), finalized #0 (0x4e7f…66ca), ⬇ 0 ⬆ 0   

I have installed the netstat tool, started the node and checked Ports: Port Check on NODE01:

netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:40991         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:32853         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9945          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9933          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9615          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:30333           0.0.0.0:*               LISTEN
tcp6       0      0 :::30333                :::*                    LISTEN
udp    36864      0 0.0.0.0:5353            0.0.0.0:*
udp        0      0 127.0.0.1:323           0.0.0.0:*
udp6       0      0 ::1:323                 :::*

Port Check on Node02:

netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:32803         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9615          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9944          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:9933          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:30333           0.0.0.0:*               LISTEN
tcp6       0      0 :::30333                :::*                    LISTEN
udp        0      0 127.0.0.1:323           0.0.0.0:*
udp6       0      0 ::1:323                 :::*

2 Answers 2

1

The address 127.0.0.1,is the loopback address, and it should work if both nodes are running on the same machine. However, if the nodes are running on different machines, you will need to use their respective IP addresses.

I haven't tried this but I assume that if you change the bootnode flag when running the second node from 127.0.0.1 to the IP address of the machine running the first node then it should be able to discover the node.

To get the IPv4 address run the command ipconfig on your PowerShell/CMD.

1

You gave loopback ip in the another system, so it is finding the node in that system only, if you want to connect on different system you have to follow the following steps:-

  • Add the ip of the system to which you want to connect in the bootnode --bootnodes /ip4/"system_ip"/tcp/30333/p2p/12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH example:- 192.126.1.3

  • To check the ip of the other system use the command:- ipconfig

  • Check that your system is able to listen the port of the other system. You can check this by using the command :- telnet other_system_ip 30333 You are using 30333 for peer discovery that's why listening to this port is necessary

1
  • I am facing the same issue, these steps helped me May 8 at 12:54

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.