根據需求下載自己的版本(我是geth-linux-amd64-1.9.7)
版本地址:
https://ethereum.github.io/go-ethereum/downloads/
進入mnt目錄(可以自己選擇目錄)創建以太坊目錄並進入該目錄
# cd mnt # mkdir ethereum # cd ethereum
用wget命令下載安裝包並解壓
# wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.7-a718daa6.tar.gz # tar zxvf geth-linux-amd64-1.9.7-a718daa6.tar.gz
將geth放入usr/local/bin目錄下
# ln -fs geth-linux-amd64-1.9.7-a718daa6/geth /usr/local/bin/
啟動geth開始后台同步區塊
nohup geth --rpc --rpcapi web3,eth,net,db,personal --rpcaddr 0.0.0.0 --rpcport 8545 &
進入geth控制台
# geth attach rpc:http://127.0.0.1:8545
查看區塊同步情況
> eth.syncing
{
currentBlock: 513872,
highestBlock: 8985345,
knownStates: 806036,
pulledStates: 794270,
startingBlock: 0
}
參考文章:https://www.cnblogs.com/elvi/p/10203930.html
