1

I have created a private blockchain network on windows OS by using two cmd console.

I am following this link in order to setup a private network.

Steps:

geth --datadir="d:/tmp/eth" -verbosity 6 --ipcdisable --port 30301 --rpcport 8101 console 2>> d:/tmp/eth/01.log


geth --datadir="d:/tmp/eth02" --verbosity 6 --ipcdisable --port 30302 --rpcport 8102 console 2>> d:/tmp/eth02/02.log

I have tried to add a peer by issuing the following command:

admin.addPeer("enode://f2157f8b90debf68e52bced6352cd08d942d24bdebc1ee734776f5560be86100bd256a5621868345799b044a5630c5cee3b40f1b105bdc03ce2da0be4e2c1dc1@0.0.0.0:30301")

Above command return true but when i check admin.peers it returns blank array.

1

You're not running on a private blockchain here. Two important things for starting a private blockchain are the genesis file and a separate network. You can mention the path to genesis file with the init command and work on a separate network by using the --networkid command.

Before connecting to peers, check if net.listening command in the JavaScript console returns true. If both the nodes are on the same device, use 127.0.0.1 as the IP address (instead of 0.0.0.0). If both the nodes are on the same WLAN, use the private IP address of the device. If they're on a different network, use the public IP address.

You can find some useful links here.

1

In addition to galahad's answer if you are running more instances (nodes) on the same host use distinct ports for each instance. Otherwise you'll only get one peer listening on 30303.

All subsequent peers will fail to bind to 30303. Always specify an IPv4 address for the peer. To my knowledge, (at least in pyethapp) ethereum clients do not support network name resolution (yet).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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