Check /var/log/syslog around the specific time for detailed information in case of system failure
sudo geth attach ~/data/geth.ipc
admin.peers.forEach(function(value){console.log(value.network.remoteAddress+"\t"+value.name)})
admin.peers is similar to above, but returns more verbose output
eth.getBlockNumber("latest")
admin.nodeInfo
admin.addPeer("put enode address here")
pkill screen
ps aux | grep geth
kill [PID] // use process ID obtained from the above (in our experiments "kill -9 [PID]" also results in a graceful stop but is not necessary, since usual "kill" also works for geth process)
eth.pendingTransactions
Get the number of accounts/wallets in the keystore directory of the node
cd /data/keystore
find . -type f | wc -l
Node overload due to out of memory (OOM) can cause the loss of blocks as Geth node stores many latest blocks in memory especially on private chains where block size is very small. OOM may be caused by intenstive load over the node RPC, for example, even if otherwise it may be not overloaded. OOM kills geth service resulting in loss of blocks stored in the memory. To test such scenario and verify whether the system can recover blocks from other nodes we emulate the OOM using this command:
tail /dev/zero
geth --datadir data removedb
Note: in some cases we have to manually delete everything inside /data/ folder except /keystore/
geth --datadir data init dppprod.json
(replace dppprod.json with your genesis file)
- Before making a backup / image of BC node, make sure to gracefully stop Geth service so it saves latest state from memory to disk. Otherwise you will backup the old state from filesystem.
- Make sure to enable “No reboot” checkbox when making an image of a working BC node in AWS.