0

Steps to reproduce:

  • Private geth network is running on server1.

  • Deploy contract using truffle and make a few transactions.

  • Stop geth n/w of server1 and copy its entire directory (accounts.txt, boot.key, genesis.json, node's password.txt along with its directories keystore and geth) and paste to server2

  • Change in the geth configuration --rpcaddr 'xx.xx.xx.xx' with private IP of the server2.

  • Bring up this geth network clone of server1 on server2 (it is able to successfully seal new block, mine potential block, and commit new mining work)

  • Interact with contract on server2.

Error: contract not deployed

  • Restart the stopped geth n/w on server1 (it is able to successfully seal new block, mine potential block, and commit new mining work)

Interact with contract on server1.

Error: contract not deployed.

Expectation: Restarting the geth n/w on server1 should not cause any data loss and should be able to interact(get the transactions performed on server1 as the data should be present in chaindata) with the contract on server2.

Note: I was able to migrate a test geth n/w successfully for a n/w running from past 2 days. After this successful operation, I was migrating this geth n/w which was running from past 7 months which is failing now with error contract not deployed. Will it sync/heal itself if its up for a long time? What are the correct ways to restart and migrate the n/w with huge chaindata.

2
  • How do you interact? How do you check that the blockchain was successfully copied? Nov 12, 2020 at 18:19
  • @MikkoOhtamaa It interacts through a contract-client application using express, axios and ether node modules. I have validated by checking the size of the copy of its entire directory including accounts.txt, boot.key, genesis.json, node's password.txt along with its directories keystore and geth. They are same on both server1 and server2. To bring up the network on server2, I just changed in the geth configuration --rpcaddr 'xx.xx.xx.xx' with private IP of the server2. It is able to successfully seal new block, mine potential block, and commit new mining work. Nov 13, 2020 at 7:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.