In your step 1) you say you followed the add-trusted-node tutorial. In that tutorial the section entitled "View information about node operations" says that "After you start the local node, information about the operations performed is displayed in the terminal shell. In that terminal, verify that you see output similar to the following". In the tutorial the output shows Listening for new connections on 127.0.0.1:9945.
and it says "The output specifies the IP address used for the node is the local host 127.0.0.1."
Important Note: Usually for the first node you could just use the default Web Sockets (WS) port, which is 9944
, but for some reason in that tutorial in the "Start first node" section they unnecessarily decided to specify a custom Web Sockets port of 9945
.
In your step 2) you don't share the start of your node logs so we can't verify whether you followed the tutorial precisely, but we could assume that you're listening for connections on a local machine with IP address 127.0.0.1, but it is not clear what its Node ID is (which you'd specify to connect other nodes to it as a bootnode) or what the public IP address is of that local machine.
In your step 3) where you try to connect your first node to the Polkadot.js Apps front-end but cannot establish connection, as shown in your first screenshot, it shows you've tried to connect to IP address 127.20.94.123 by going to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.20.94.123%3A9944#/accounts, but if you were following that tutorial then the first node would be listening on WS port 9945
instead of 9944
, so if your IP address was really 127.20.94.123, then you should be connecting to it at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.20.94.123%3A9945#/accounts
If you're trying to connect to your first node using a web browser that is also running on the same machine as the first node, then you should be able to connect to it by going to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/accounts to connect to the local IP address 127.0.0.1 on WS port 9945
.
Based on the terminal log outputs from your step 4), it looks like your first node was discovered with public IP address 172.20.94.123, so you should be able to connect to it at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F172.20.94.123%3A9945#/accounts (assuming you started the first node with --ws-port 9945
), but if the first node is running on a remote machine then you may need to check
that you started that first node with additional flags to allow remote connections such as --ws-external --rpc-external --rpc-cors=all
(as @AmitKumarYadav mentioned in the comments), which you may find by running node-template --help
as mentioned here.
In your step 4) you also don't share the command you used the start of your node logs so we can't verify whether you followed the tutorial precisely or what the public IP address is of that second node that is listening for connections, as it might be running on a remote machine. In the logs of your second node it says it discovered IP address **172**.20.94.123 with /ip4/172.20.94.123/tcp/30333
, which I assume is your first node running on IP address 172.20.94.123 (not to be confused with 127.20.94.123). The first node uses port 30333 by default, or you may have followed the tutorial and specified it explicitly with --port 30333
.
When you started the second node did you specify the first node as a bootnode? For example, if the first node was running on local machine with IP address 127.0.0.1 and the second node was running on the same machine you'd use --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH
, where 30333
corresponds to the first node being started using CLI option --port 30333
and the 12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH
is the Node ID value that is shown in the logs when you started your first node, but if they were running on different machines then you'd specify the public IP address of the first node, which I assume is 172.20.94.123, so --bootnodes /ip4/172.20.94.123/tcp/30333/p2p/12D3KooWSY3YykHtFbyYsMZGgrpYnupVFwstz6GnGQ21wUJH3BUH
, and you'd need to ensure that the remote machine had ports that it uses like 30333 open.
Connect to Polkadot.js Apps:
It's likely the reason why you can't connect the first node to the Polkadot.js Apps front-end in your step 3) is because you've accidentally used the wrong first byte in the IP address. If your first node is running on IP address 172.20.94.123, then you should be able to connect to it at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F172.20.94.123%3A9945#/accounts (assuming you started the first node with --ws-port 9945
), or at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/accounts (assuming you started the first node with --ws-port 9945
) if you're connecting to it using a web browser running on the same local machine as the first node. But instead it appears you may have entered the wrong first byte for your IP address and tried to connect with unsuccessfully with 127.20.94.123 instead.
Connect to Substrate-front-end-template:
If your first node is running on public IP address 172.20.94.123 and you're running the substrate-front-end-template on a different machine then to connect to it you would need to change the default PROVIDER_SOCKET
value here to "ws://172.20.94.123:9945"
(assuming you started the first node with --ws-port 9945
) and open the relevant ports.
If they are both running on the same machine then even the default value "ws://127.0.0.1:9944"
used by the substrate-front-end-template will not work, because assuming you followed the add-trusted-node tutorial you would have started the first node with --ws-port 9945
and you would have specified --ws-port 9946
as the exposed WS port of the second node, so none of the nodes would be running on the default WS port of 9944
that is usually used by Substrate nodes, so you'd need to change it to a custom value of "ws://127.0.0.1:9945"
.
ws://127.20.94.12
- this may be a network issue. Try replicating this issue with your nodes and your frontend all running on the same machine and use 127.0.0.1