6

I've done this before a million times, but I can't figure out why I can't connect to a remote host anymore.

I've setup a basic Ubuntu 16.04 VM on Digital Ocean, isntalled Geth on it, and started a new private network on it using:

geth --dev --datadir="." --maxpeers 30 --identity "VM_NODE" --ipcapi="admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,personal,eth,net,web3" --port="30303" --rpccorsdomain="*" --networkid=999777 --rpc --rpcaddr="0.0.0.0" console

I then created a new account and started mining using miner.start(1) and then got my admin.nodeInfo:

> admin.nodeInfo
{
  enode: "enode://31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff@[::]:48298",
  id: "31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff",
  ip: "::",
  listenAddr: "[::]:38647",
  name: "Geth/VM_NODE/v1.5.8-stable-f58fb322/linux/go1.7.3",
  ports: {
    discovery: 48298,
    listener: 48298
  },
  protocols: {
    eth: {
      difficulty: 14643008,
      genesis: "0xe5be92145a301820111f91866566e3e99ee344d155569e4556a39bc71238f3bc",
      head: "0x4aaceb68f863da428a6375814a4a00bbde5ac9111b1a05210af4585a06908e27",
      network: 999777
    },
    shh: "unknown"
  }
}

I then set up a private network with the same genesis file locally (on OSX) and try to connect with the remote network using a couple different ports:

> admin.addPeer("enode://31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff@178.62.254.13:8545")
true
> admin.addPeer("enode://31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff@178.62.254.13:30303")
true
> admin.addPeer("enode://31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff@178.62.254.13:48298")
true
> admin.addPeer("enode://31b424ffd9808996a2aea1f6da85e3996a9860c4ccf998114a9df28cebfcb7390c98cd1bcd9e1124f814646c3201cd7c4d6df15a6fd63a7c5408522a812b56ff@178.62.254.13:38647")
true

It seems to connect fine, but I don't seem to have a connection:

> net.peerCount
0
> admin.peers
[]

I've tried setting up a new VM two times, and I've restarted the network on both sides and tried many different setups, but it doesn't seem to work.

Does anybody know why it doesn't connect? All tips are welcome!

ps. Anybody is welcome to try connect to my VM. The ip address is in the calls to admin.addPeer above.

2

I have met the same problem and now I have solved it trough delete the director "datadir" which in your case is ".". Then I reinit with the json document again.Going down the steps, maybe it will solve your problem. if you run the command "addPeer()" with flag "--verbosity 6" maybe you will get a error like "Ethereum handshake failed" and "genesis block mismatch".It means your chaindata in datadir or all in datadir has outdated.

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.