Data on Private Ethereum blockchain lost/disappears after couple of days [closed]
Asked Answered
M

1

9

I am deploying a private ethereum blockchain (geth) on a virtual machine on Azure. Upon deploying my Solidity contracts on the blockchain and launching my NodeJS application to it, I am able to add data normally through web apis of the nodejs Loopback App and everything is working fine and I can see the added data using the GET apis.

However, after 1-2-3 days (random) I am not able to retrieve the data I added through my GET apis, while am still able to add new data which confirms that Geth is running fine and wasn't interrupted.

I am running geth using:

geth --datadir ./myDataDir --rpc --networkid 1441 console 2>> myEth.log

myEth.log isn't showing anything wrong, nodejs logs are clean as well.

eth.syncing shows false which means the network is synced.

size of myDataDir folder is still increasing so logically data should be somewhere there but it's not showing.

Mcmurray answered 24/5, 2018 at 9:37 Comment(5)
Is it possible that some required login expires after 1-3 days?Gaulin
No definitely not @David, there's no such login process to talk to it, and if there's any it's already working since the beginning and there's no expiry date for it.Mcmurray
mhm, did you miss perhaps an included expiry-parameter? I don't think so, but I don't know that blockchain so I don't know the unique details. Alternative: perhaps you send a delete-command without recognizing it?Gaulin
I dont think so as well, because sometimes it's the data is kept in blockchain for a week or more. it's definitely related to transactions cost and ethereum configuration, am afraid it's a bug in 1.8.6 version! I'm contacting consensys support to see if they can help!Mcmurray
yeah, sounds like a bugGaulin
D
1

This is not a private blockchain!

--networkid 1441

This only says that you communicate with clients that also run a network with ID 1441. It might be unlikely, but if someone else runs a network with ID 1441, this node will connect to your node just fine. And in case, the other network with the same ID has a longer (more "heavier") chain, this overwrites your local chain.

To avoid this, try a more random network ID, maybe 7-9 digits, and disable discovery with

 --nodiscovery

Or just use the --dev preset.

Ditmore answered 21/8, 2018 at 15:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.