官网搭建文档:https://www.xdaichain.com/for-developers/install-xdai-client/parity
RPC接口文档:https://openethereum.github.io/JSONRPC-eth-module#eth_blocknumber
1.下载安装包(选择合适稳定的版本)
mkdir data
cd /data
wget https://github.com/openethereum/openethereum/archive/refs/tags/v3.2.6.tar.gz
tar -zxvf v3.2.6.tar.gz
2.更新源
apt-get update
3.没有cargo的 安装cargo (已经安装过的可省略这一步)
apt install cargo
4.编译工程
cd openethereum-3.2.6/
cargo build --release --features final
5.启动xdai节点
nohup ./openethereum --chain xdai --port=30304 --jsonrpc-port=8545 --jsonrpc-cors=all --jsonrpc-interface=all --jsonrpc-hosts=all --jsonrpc-apis=web3,eth,net,parity --ws-interface=all --ws-apis=web3,eth,net,parity,pubsub --ws-origins=all --ws-hosts=all --ws-max-connections=10 --max-peers=100 --base-path=/data/xdaidata &
6.查看同步状态
可在nohup日志里看或者使用curl访问web3接口查询或使用geth客户端查询
可看出已经在同步了,等待同步完成即可。