sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum


#轻节点启动(不占空间,全节点预计需要500G):
nohup geth  --syncmode light --identity 'real' --datadir "data"  --rpc --rpcapi 'db,eth,net,web3,personal' --rpcaddr 0.0.0.0 --rpcport 8051  &

#说明:
#8051是端口号自己可以随便定义,需要对钱包节点开放,阿里云或宝塔安全也记得放开(为了安全建议指定IP可以访问)

#启动后,geth attach geth.ipc 进入控制台
#以下是3个常用命令:
> eth.syncing
{
  currentBlock: 6143193,
  highestBlock: 6143296,
  knownStates: 91512910,
  pulledStates: 91498893,
  startingBlock: 0
}

> eth.blockNumber
0
> net.peerCount
8

 

检查服务运行状态:

http://IP:7004/rpc/address/1

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。