3

first of all thank you for the great discussions and solution that I've found here.

I'm trying to create a private ethereum network to which I want to access with 2 different servers.

I am able to create the network with and ID say 1234 and then attach to it another instance of geth (using geth --dev attach). So with 2 accounts on the same machine I am able to mine, transfer ether between the two and also develop smart contracts (like the greeter example) and invoke the greet() function on the other instance after set var greeter = eth.contract(ABI).at('ADDRESS').

Now I want to connect to this network from another server to which I access with ssh at a certain IP. Also here geth is working. I've defined the same genesis.json file and then I have geth init genesis.json.

I've also defined a static-nodes.json file so to connect to the first server. This is where things are not working.

If from within the js console I invoke something like:

admin.addPeer("enode://9a5fe07ba826bdfc266137c4d2668c54dd659fe289858198d869ef7b9828461bd7c247834cf233d75b44a45f873d69edda05b9c9423f0c22cae451bf0df92c5c@first.server.ip.scaleway:30303?discport=0")

then I see something like this:

I1020 14:46:13.094602 eth/downloader/downloader.go:326] Block synchronisation started
I1020 14:46:13.256432 eth/downloader/queue.go:885] Peer 9a5fe0xxxxxxxxxx: header #114 [80xxxxxx] broke chain ancestry

Due to the fact that there is a block #114, I think the first server is able to send information about the chain with ID 1234, but the synchronisation is not possible. If I start mining on the second server, it starts from block #0.

Sorry for the lenght of the explanation but in this way I think I've written everything. I don't know if the problem is due to geth or my server on scaleway.

Thank you again for all your help :)

  • which version are you using : geth version – Badr Bellaj Oct 20 '16 at 15:06
  • Are you sure the genesis blocks are the same? I'd recommend against using the --dev flag; it sets a lot of different options, some of which may be overriding things that you've specified. – Tjaden Hess Oct 21 '16 at 2:05
  • If you have the static-nodes.json file, you need not use the addPeer() function to connect the nodes. Check the output of admin.peers to see if the connections was successful. – galahad Oct 21 '16 at 6:33
  • @BadrBellaj I've installed it 2 day ago through the official repository, so it's the latest geth – gatb27 Oct 21 '16 at 13:50
  • 1
    Yes, it is possible to use the attach command from a different server if you use the --rpc flag. Then you just do geth attach http://MyIP:8545 – Tjaden Hess Oct 21 '16 at 14:09

Your Answer

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

Browse other questions tagged or ask your own question.