infra-faucet/SYNCING.md

65 lines
2.4 KiB
Markdown

# Description
Syncing of light Geth nodes for Faucet purposes can be a pain. This doc might help you with debugging of those issues.
# Tools
Each Geth instance has an `ageth-*` script named after the container available. Lets try it for `ropsten` network:
```
admin@master-01.gc-us-central1-a.faucet.prod:~ % which ageth-faucet-ropsten-geth
/usr/local/bin/ageth-faucet-ropsten-geth
admin@master-01.gc-us-central1-a.faucet.prod:~ % ageth-faucet-ropsten-geth
Welcome to the Geth JavaScript console!
instance: Geth/v1.9.10-stable-58cf5686/linux-amd64/go1.13.6
at block: 7220692 (Wed, 29 Jan 2020 13:00:00 UTC)
datadir: /data
modules: admin:1.0 eth:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0
> admin.peers.map(function(o) { return o.enode })
[
"enode://67a391b012b86fa0da8573bab780c1d15e1555a0b9ab89bb7e44261fe9b0683d33cb67668a234e22b2bc4cd6a4b5b5b9d90ed653210ff5b2d04b2c73578ff4af@44.226.193.117:30303",
"enode://23fd0ff45034abb96933c07b4fa9e2aff5029f78ec27a425a2547990b59cffb1e8f87b6ae4a88d2fc4b6f3d57b67673fa3d4df1c893f2cc72ddf37ef75c21a00@178.128.242.69:30303",
"enode://053d2f57829e5785d10697fa6c5333e4d98cc564dbadd87805fd4fedeb09cbcb642306e3a73bd4191b27f821fb442fcf964317d6a520b29651e7dd09d1beb0ec@79.98.29.154:30303"
]
```
You can check syncing status using:
```
admin@master-01.gc-us-central1-a.faucet.prod:~ % ageth-faucet-ropsten-geth eth.syncing
{
currentBlock: 7208959,
highestBlock: 7220617,
knownStates: 0,
pulledStates: 0,
startingBlock: 7143423
}
admin@master-01.gc-us-central1-a.faucet.prod:~ % ageth-faucet-ropsten-geth eth.syncing
false
```
# Adding Peers
The Geth console allows for adding new peers by hand using the `admin.addPeer()` method:
```
admin@master-01.gc-us-central1-a.faucet.prod:~ % ageth-faucet-ropsten-geth
Welcome to the Geth JavaScript console!
instance: Geth/v1.9.10-stable-58cf5686/linux-amd64/go1.13.6
at block: 7220710 (Wed, 29 Jan 2020 13:02:35 UTC)
datadir: /data
modules: admin:1.0 eth:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0
> admin.addPeer("enode://d9d79ebe7b5bf1131a68a9be33059711940c0d7f59ad09b88fde328a35b0951f1e613d3beea2b5e3bf959c36a92c951aba66036e29c2e678137f8c0b86029ead@115.159.50.247:30303");
true
```
# Health Check
Consul uses a script for checking syncing status of Geth nodes:
```
admin@master-01.gc-us-central1-a.faucet.prod:~ % /usr/local/bin/check_sync_faucet_ropsten_geth.sh
Geth synced: true
```
When node is not synced this script returns a non-0 status code.