1

We wan't to run multiple node on multiple devices. We use substrate-node-template to do that. We build the project using cargo build --release and follow this Add trusted node tutorial. We were able to generate chainSpec.json and converted to chainSpecRaw.json after modify aura & grandpa fields. We then add keys to the keystore and run first node:

./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

enter image description here

On second device send chainSpecRaw.json file then add keys to keystore of second node and run second node: ip4 of device where first node running: 27.34.100.91

./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/27.34.100.91/tcp/30333/p2p/12D3KooWLk8ER6sbMAZa8uzf6YmyMo8FvpCiMgrFW4NfReez5um4 \
  --password-interactive

enter image description here

No two node peers with each other. Can you please helps us why we are having this issue?

2 Answers 2

1

According to me there can be 2 possible scenarios due to which this can happen:

  • The most basic one is because of firewall, it is not allowing the connection from other system.
  • The other possible scenario is you didn't provide the right IP address and the bootnode ID, you can check that also.

Most probably it is the first case so you need to check the rules of your firewall is it accepting connections or not.

2
  • hey, @UPENDRA SINGH thanks for quick response. Do you mean on second node running device to check whether firewall accepting connection or not?
    – Ganesh11
    Jul 7 at 8:17
  • should we have to turn firewall off or on?
    – Ganesh11
    Jul 7 at 8:41
1

you need to change the command add --ws-external --rpc-external --rpc-cors all in your boot node command.

./target/release/node-template \
  --base-path /tmp/node01 \
  --chain ./customSpecRaw.json \
  --ws-external\
  --rpc-external\
  --rpc-cors all
  --port 30333 \
  --ws-port 9945 \
  --rpc-port 9933 \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
  --validator \
  --rpc-methods Unsafe \
  --name MyNode01 \
  --password-interactive

you can simple run this command for boot node

./target/release/node-template --base-path /data/node01 --chain ./customSpecRaw.json --port 30333 --ws-port 9944 --rpc-port 9933  --ws-external --rpc-external --rpc-cors all --no-telemetry --validator --rpc-methods Unsafe --name MyNode01

for running the other nodes

`**binary-path**` --base-path /data/node2 --chain ./customSpecRaw.json --port 30334 --ws-port 9945 --rpc-port 9934 --ws-external --rpc-external --rpc-cors all --no-telemetry --validator --rpc-methods Unsafe --name MyNode002 --bootnodes /ip4/`**ip-of first computer**`/tcp/30333/p2p/`**node-identity**`.

in your case run this command after running your boot-node

 ./target/release/node-template --base-path /data/node2 --chain ./customSpecRaw.json --port 30334 --ws-port 9945 --rpc-port 9934 --ws-external --rpc-external --rpc-cors all --no-telemetry --validator --rpc-methods Unsafe --name MyNode002 --bootnodes /ip4/27.34.100.91/tcp/30333/p2p/12D3KooWLk8ER6sbMAZa8uzf6YmyMo8FvpCiMgrFW4NfReez5um4
11
  • Error: Service(Client(Backend("Failed to create RocksDB directory: Os { code: 30, kind: ReadOnlyFilesystem, message: \"Read-only file system\" }.")))
    – Ganesh11
    Jul 7 at 11:36
  • got this issue while run command for boot node @Amit Kumar yadav
    – Ganesh11
    Jul 7 at 11:36
  • @Ganesh11 are you running it on local computer? or on instance? Jul 7 at 11:39
  • on local computer
    – Ganesh11
    Jul 7 at 11:40
  • delete the db and re run the command or run this command ./target/release/node-template --base-path /data/node001 --chain ./customSpecRaw.json --port 30333 --ws-port 9944 --rpc-port 9933 --ws-external --rpc-external --rpc-cors all --no-telemetry --validator --rpc-methods Unsafe --name MyNode001 Jul 7 at 11:42

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.