1

When I run Alice and Bob validators:

./target/release/polkadot --alice --validator --base-path /tmp/relay/alice --chain chainspec-raw.json --port 30333 --ws-port 9944
./target/release/polkadot --bob --validator --base-path /tmp/relay/bob --chain chainspec-raw.json --port 30334 --ws-port 9945

They cannot find each other and no blocks are produced.

However, if I run the second validator node (Bob) specifying the bootnode of Alice like so:

./target/release/polkadot --bob --validator --base-path /tmp/relay/bob --chain chainspec-raw.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWP2XSK96JraZ5PxK6uC33ae8fMRfmugP5DtuwxhrbGPUH --port 30334 --ws-port 9945

then it works and blocks are produced and finalized.

Why aren't the nodes finding each other via peer discovery?

I am on macOS.

1 Answer 1

3

My firewall was blocking the peer discovery.

System Preferences > Security & Privacy > Firewall

This was my setup:

This means my nodes will not be able to auto-discover because incoming connections are blocked (I would have to specify the bootnodes manually).

Unchecking "Block all incoming connections" and checking "Enable stealth mode":

Then re-running the Alice and Bob validators, I get this pop-up to approve incoming connections:

This will add "polkadot" to the approved list of software:

And finally Bob will find Alice.

Note: I ended up opting for leaving the "Block all incoming connections" checked and manually specifying the bootnode as this sufficed for my node testing and allowed me to keep a more secure configuration for my firewall.

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.