I am trying to setup a private network and trying to connect peers. Currently I'm trying it on my laptop and virtual machine(VM) runing on the same laptop (both of them are connected to internet). I init genesis file on my VM, start geth. Then init my genesis file on laptop(same copy of file), start geth.

With help of admin.addPeer("enode://....@[ip]:30303") i add peers on both machines.

admin.peersCount returns 0


You can take a look at: http://chainskills.com/2017/03/17/pair-the-miners-46/, this site is mainly focussing on connecting to a raspberry-pi but an other computer on the same network should also work.

| improve this answer | |

The main way to create a private network is to :

  1. Create a bootnode
  2. Run geth with --bootnodes "< bootnode enode URL>" On both VM and PM.
  3. You can check if your peers are added automatically, or add them manually using admin.addPeer()

If this fails to make nodes connect, it is probably a network problem and you will need to diagnose that yourself (probably your VM and laptop don't share a local network that differentiates between them, internet doesn't since they both have the same gateway external IP).

| improve this answer | |

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.