Binance
Instructions to set up your Binance node.
Requirements
- Setup your Axelar validator
- Minimum hardware requirements: 16 AWS vCPU+, 64GB RAM, 2TB+ free storage space.
- MacOS or Ubuntu 20.04 (tested on 20.04)
- Official Documentation
Prerequisites
sudo apt-get install wget jq unzip aria2 lz4 -y
BSC geth
Check the appropriate version for the network accordingly in their docs or choose the latest release
# This is an example - check their docs and release page to opt for the right versionBSC_GETH_RELEASE=vx.y.z
# verify correct versionecho $BSC_GETH_RELEASE
# create a temp dir for binariescd $HOMEmkdir binaries && cd binaries
# if you are on linux amdwget https://github.com/bnb-chain/bsc/releases/download/$BSC_GETH_RELEASE/geth_linuxmv geth_linux gethchmod +x *sudo mv * /usr/bin/# verify versiongeth versioncd $HOME
mkdir -p $HOME/.bsc/configcd $HOME/.bsc/configwget https://github.com/bnb-chain/bsc/releases/download/$BSC_GETH_RELEASE/mainnet.zipunzip mainnet.ziprm mainnet.zip
mkdir $HOME/.bsc/configcd $HOME/.bsc/configwget https://github.com/binance-chain/bsc/releases/download/$BSC_GETH_RELEASE/testnet.zipunzip testnet.ziprm testnet.zip
Initialize the node or sync from snapshot
1. If you want to sync from genesis
cd $HOMEgeth --datadir $HOME/.bsc init genesis.json
2. If you want to sync from snapshot - Mainnet Only
You find the snapshot links here or here to sync from snapshot
# change the url to latest snapshot available: you can find it in the links shared aboveGETH_SNAPSHOT_URL=https://snapshots.48.club/geth.24761776.tar.lz4
cd $HOME/.bsc/aria2c -s14 -x14 -k100M $GETH_SNAPSHOT_URL -o geth.tar.lz4# check checksum: it will take time to calculate checksumopenssl sha256 geth.tar.lz4# uncompress the filelz4 -cd geth.tar.lz4 | tar xf -rm geth.tar.lz4
Create Service
Note: The following settings will allow your node to be accessed publicly from any machine, adjust the flags according if you don’t prefer that.
sudo tee /etc/systemd/system/geth.service > /dev/null <<EOF[Unit]Description=Geth nodeAfter=online.target
[Service]Type=simpleUser=$USERExecStart=/usr/bin/geth --config $HOME/.bsc/config/config.toml --txlookuplimit=0 --syncmode=full --tries-verify-mode=none --pruneancient=true --diffblock=5000 --cache 8000 --rpc.allow-unprotected-txs --datadir $HOME/.bsc --http --http.vhosts "*" --http.addr 0.0.0.0 --ws --ws.origins '*' --ws.addr 0.0.0.0 --http.port 8545Restart=alwaysRestartSec=3LimitNOFILE=4096
[Install]WantedBy=multi-user.targetEOF
By default it will log the logs in $HOME/.bsc/bsc.log
if you want to use journalctl to view logs, comment out the log setting in config
sed -i '/Node.LogConfig/s/^/#/' $HOME/.bsc/config/config.tomlsed -i '/FilePath/s/^/#/' $HOME/.bsc/config/config.tomlsed -i '/MaxBytesSize/s/^/#/' $HOME/.bsc/config/config.tomlsed -i '/Level/s/^/#/' $HOME/.bsc/config/config.tomlsed -i '/FileRoot/s/^/#/' $HOME/.bsc/config/config.toml
Start the service
sudo systemctl daemon-reloadsudo systemctl enable gethsudo systemctl restart geth
Check logs
# change log settings to persistent if not alreadysed -i 's/#Storage=auto/Storage=persistent/g' /etc/systemd/journald.confsudo systemctl restart systemd-journaldjournalctl -u geth.service -f -n 100 -o cat
Logs should appear like this
If you are syncing from genesis
INFO [01-12|07:22:26.423] Downloader queue stats receiptTasks=118 blockTasks=34418 itemSize=658.90B throttle=8192INFO [01-12|07:22:26.464] Imported new block receipts count=91 elapsed=39.135ms number=80616 hash=f2b5af..d57e5c age=2y4mo3w size=39.74KiBINFO [01-12|07:22:26.474] Imported new block receipts count=6 elapsed=9.733ms number=80622 hash=f79d09..1c21f6 age=2y4mo3w size=7.06KiBINFO [01-12|07:22:32.668] State sync in progress synced=0.40% state=1.41GiB accounts=699,027@129.75MiB slots=5,819,860@1.19GiB codes=14583@102.87MiB eta=4h55m52.376sINFO [01-12|07:22:40.829] State sync in progress synced=0.42% state=1.50GiB accounts=728,900@136.92MiB slots=6,179,853@1.27GiB codes=14847@104.99MiB eta=5h17m21.796sINFO [01-12|07:22:48.941] State sync in progress synced=0.46% state=1.59GiB accounts=778,792@148.89MiB slots=6,498,586@1.33GiB codes=15810@112.04MiB eta=5h20m22.013sINFO [01-12|07:22:56.983] State sync in progress synced=0.51% state=1.67GiB accounts=848,671@165.66MiB slots=6,789,621@1.39GiB codes=17191@122.32MiB eta=5h9m44.302sINFO [01-12|07:23:04.983] State sync in progress synced=0.56% state=1.77GiB accounts=918,383@182.40MiB slots=7,140,091@1.46GiB codes=18095@129.50MiB eta=5h8m46.202s
If you are syncing from snapshot
INFO [01-14|05:21:12.351] Initialising Ethereum protocol network=56 dbversion=8INFO [01-14|05:21:12.353] Loaded most recent local header number=24,761,776 hash=794f37..9792a8 td=49,216,905 age=7h20m3sINFO [01-14|05:21:12.353] Loaded most recent local full block number=24,761,776 hash=794f37..9792a8 td=49,216,905 age=7h20m3sINFO [01-14|05:21:12.353] Loaded most recent local fast block number=24,761,776 hash=794f37..9792a8 td=49,216,905 age=7h20m3s
Verify
Method 1:
YOUR_IP=$(curl -4 ifconfig.co)curl -X POST $YOUR_IP:8545 -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' | jq
If you get something like this in response of the above rpc call, your node is setup correctly
{ "jsonrpc": "2.0", "id": 1, "result": { "currentBlock": "0x10bcec", "healedBytecodeBytes": "0x0", "healedBytecodes": "0x0", "healedTrienodeBytes": "0x0", "healedTrienodes": "0x0", "healingBytecode": "0x0", "healingTrienodes": "0x0", "highestBlock": "0x1792276", "startingBlock": "0x1233f", "syncedAccountBytes": "0x422a06f3", "syncedAccounts": "0x5b14c0", "syncedBytecodeBytes": "0x26c0e4d8", "syncedBytecodes": "0x13cfd", "syncedStorage": "0x38195bc", "syncedStorageBytes": "0x2ef128d1b" }}
Wait for "result"
to become false
before using it in vald config
{ "jsonrpc": "2.0", "id": 1, "result": false }
Method 2:
You can also check your status by connect to geth console
geth attach http://localhost:8545eth.syncing
If you get something like this in response, your node is setup correctly
{ "currentBlock": 24000, "healedBytecodeBytes": 0, "healedBytecodes": 0, "healedTrienodeBytes": 0, "healedTrienodes": 0, "healingBytecode": 0, "healingTrienodes": 0, "highestBlock": 23846000, "startingBlock": 0, "syncedAccountBytes": 0, "syncedAccounts": 0, "syncedBytecodeBytes": 0, "syncedBytecodes": 0, "syncedStorage": 0, "syncedStorageBytes": 0}
Wait for it to become false
before using it in vald config
eth.syncingfalse
Endpoint
echo "${YOUR_IP}:8545"
Configure vald
In order for vald
to connect to your Binance Smart Chain node, your rpc_addr
should be exposed in
vald’s config.toml
start-with-bridge = true
start-with-bridge = true