创建数据目录
mkdir -p /data/openethereum/xdai
下载以太坊客户端
wget https://github.com/openethereum/openethereum/releases/download/v3.2.6/openethereum-linux-v3.2.6.zip
解决客户端
unzip -o openethereum-linux-v3.2.6.zip -d /data/openethereum
进入目录
cd /data/openethereum
添加执行权限
chmod +x openethereum
加入系统进程管理
vim /usr/lib/systemd/system/openethereum.service
[Unit]
Description=openethereum
[Service]
User=root
Type=simple
WorkingDirectory=/data/openethereum
ExecStart=/bin/bash /data/openethereum/start.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
添加启动脚本
vim start.sh
#!/bin/bash
/data/openethereum/openethereum --chain xdai --identity xdai -d /data/openethereum/xdai --cache-size 4096 --ws-port 8546 --ws-interface 0.0.0.0 --ws-apis web3,eth,net,personal --ws-max-connections 10000 --bootnodes "enode://a20c13b1712d32028a277958346a5c29350e8a3e32d40de43a62cb35baa99f96f274960591e46be5a643be7ee77a15d6a4963170460156a77abcf500f0ba0ff0@104.237.150.151:30303,enode://f372b16932a4ee5b6be947556bcca1cf57e498267dd78a7a643a87514a0a5ef4f112cb6934aab5775d3e8940ba535e8f53dfa704e162a72970de61e6ef9fd9aa@45.79.158.26:30303,enode://fe9720c93e6335b8cacffa10df594c8c166208fa4be8dcb9275788e54111ae88899022fa9c358f2d0029ee57c2223a7fbc97eb06b294422d35ef796a49d87bff@94.237.98.201:30303,enode://6d12181aa8527251dd8f9d37a2ff7eadb46f2a90c69f2282352ac7889b105d6b5787a532facee656b29599ee1ee51eb5b1eb01d2a17190e32a6cbe6dfc996828@45.79.158.8:30303,enode://389a625160876776946bfea5a6ce4f4c761bd2062cf8e45e510da77595399ee50a802060868d9bf4580431fc2248cadc9ce61826b3513e090bd1cdd4ce11a9d8@161.97.172.191:30303,enode://d086bfbe0d15e841e403695c151920459261dd5d5f259858b32727e2bc64d92f48bdad3cc0120703dbb0e2abd2f51c0459cff517bfa16e683ca27018d82a6dcf@66.175.215.67:30303,enode://540a0bc258ba93e6fafc238f49eca0a2032b5d40b79c077dc9b9a304fd636af4167b638eb0f80aa455f5da1cf49b76c881f651ed301a1e28d6855a8a3fbe21a0@167.71.174.1:30303,enode://1ceea9d3fb22247edf85102f1e78cd31c2f330ace6ac2789c82766a232d56d7c3c1b2aeb504f2f761de754da22e7dfc5bdde3b00b8b98d1d003f6dd81612f8b3@66.175.211.178:30303,enode://4175e9ffd9ac9819c9c596a60b7748cc1c1846cf7e8db47ee97f8aa57e42e8cb3dad4201726498d34af94505b2c1429f9d3a508594c521080e8cd1a3fa24a3d5@37.120.245.155:30303,enode://b5eba653df9c583238ea238ca7cadf5d2746f1b4da81a8cfb2c1b600f62fe37df000fa5b5292059f74faa6bbf5af01b3b81f99284a1fbd5c0971d74db7dc4a34@66.175.213.149:30303,enode://2a8b64e96da7e67e525f04a157a0016b886dfb2d02553501abd0326b7b061aace7e92ad87c1225dc7d261b05e7886391552c812b386451597bff4b040eb43bec@173.212.236.163:30303,enode://5f187ae73b07db889c91e8955619b1e6b799696a4b7aab306f7c500a2ec4c7f66dfbea8ac28bde65100653a2fe84b96f2079aed2d61871e06b5a1e32c0f021af@45.79.150.105:30303,enode://22e442bf7b7fa9bb5960344ef5aa907b920a931bce83e14620b0378318b7eb73753f7245f0a8252590a71ad9568bcfbb9e5f03bd88ab3feb9c1096227bb8704a@168.119.136.44:30303,enode://ef98bc3c9195b9f27312ac646edb6d0096b04c983f93864c30b8f2b20c699ec974a7066cfae090832679e497d23655e0e315a2c96da4a27d75cc4693e6335bba@192.155.90.129:30303,enode://de1ab49beedda656976a8fcb01f91ebdb474178fd46e5ce87cf22f0eb90bc3a6721d619ec90c4a6453770a2c24a4bdbc4ef8b8111ffd49f491eb84016a3842d6@54.217.41.94:30303,enode://ba04a77c7c8ac0fdd325de91536c33bce3b71095de563aafc72e6ac4111ebf093570c7bdba48b06cc83b0af5596f72fc32563547160e067fcb45a1786b8f7150@45.56.105.53:30303,enode://56510b2d296000427e56eb0016d8454998c16347ec2c4ffed84cb82a996707de40ca2b9ea13c8796b4230b4c19ce46f844720ded93135d710b7bbc7352a061d3@50.35.89.213:30304,enode://a68b3f3f58ea56dcc70450d371bf0b83363d74cbfdb5f982be00536ae3168aa679c7e7e93bd9ffe34b59527173d73e0ebed0a105c095af2ee16bd1cc66103c80@69.164.215.62:30303,enode://e8c7a0db430429bb374c981438c0dbd95e565088a483388aa46d8377a3bd62f02cd83d7e2c7e5fc77606141bfef29d23d4285a7c1d9b7e743cf3029314506df7@80.240.16.221:30303,enode://80c8f6f27f80ba91830002a8ca64771f6baf440fd134e88fbecae3a67c8bc58722d624cecbd6439e1a2d28fbd0297d489fdaa40b10c2f3e07fee1913d52b3e30@45.79.185.92:30303,enode://da2449aaba873c40c6daf764de55f4b9eae24c4738daec893ef95b6ada96463c6b9624f8e376e1073d21dd820c5bb361e14575121b09bbd7735b6b556ee1b768@67.205.176.117:30303,enode://481e43a8e30cdfecfe3159dde960d9e65347c3e8c64dcedea87922df875e4d47a813f53c012920b6754e43cde47302cdfb120fd409b6aa2b47c48e391494c7f5@173.255.233.100:30303,enode://90b0a0e74a9a1ad258531b4ceec25587d8b52ff2cfb36206a34bf6ba1a8d21b2abd20da13260102508a2ac67afbeb2d2ab7a5e9d6bea3bce845cd81e655585cc@45.77.110.159:30303,enode://6012c883efeee664847a48784459980176a22f31bc98c2aae30011ad7ef0b44011364a0a9ae5eb056db1f052cf3556757bd97485677bbaf1781b131e43204971@69.164.222.63:30303,enode://5bc43a57273eb4012b59ce268f986cbeeb5f0f878aa25e3d2d71d9b7ff64029a9dd25a84303f80820a78d83ff3a2c570988d0fc68a17d355a98c20c0784aa14d@8.9.5.108:30303,enode://89e046a4f10c64265941789b2e3be900adf5132ced13756aeea126cf59b516445ed8053b600aa764860f1aad552f4f4f3b4250c59b3b8a84ead3d3527c005606@172.104.24.215:30303,enode://ab7f6c633ba2dc54795dfd2c739ba7d964f499541c0b8d8ba9d275bd3df1b789470a21a921a469fa515a3dfccc96a434a3fd016a169d88d0043fc6744f34288e@67.205.180.17:30303,enode://6674773f7aac78d5527fa90c847dcbca198de4081306406a8fec5c15f7a2e141362344041291dd10d0aafa7706a3d8f21a08b6f6834a5b1aab9cccd8ca35ccee@143.110.226.15:30303,enode://0caa2d84aef00d0bc5de6cf9db3e736da245d882ec8f91e201b3e1635960e62cbb2f8bfc57e679ff3e1d53da2773e31df624a56b2f457ecb51d09fdf9970c86b@167.99.4.175:30303,enode://7aa4c137b1ec078f2df3c17552e23c7213662819132821ed3aaa42f0212cb889dbb21211f9c5912c68fce577ab7fc99b0a47c0cb469ec0ad29c0acd9ce297659@45.33.84.107:30303,enode://e026b1a68e8a19106d14effc0df66050c494e10a6b8a4e9f6fd196d95306d7062d129a8c9510ffdbeaf3fe0154b884c116a0e77aec876c368e507de3420fba05@149.28.32.225:30303,enode://0a978bd436b850f61e31778fbbeb3e0182f91bb98a30c073674c741c182611e71842333c098d3db5108f06cd589c3a8341172e34be0421fa66d82f0dd83d8ae1@51.81.244.170:30303,enode://75f05df1e5a3094ed2c9df36f122b95852206c52288f777982503946d5b273c7ffd8bb06ad60a0df7a31510906d4090c7bd5fd9bcb04a5b4ac1825a2b7212f32@45.63.18.245:30303"
启动
systemctl daemon-reload
systemctl start openethereum
开启防火墙
firewall-cmd --zone=public --add-port=8546/tcp --permanent
firewall-cmd --zone=public --add-port=30303/tcp --permanent
firewall-cmd --reload
查看日志(日志中有个Public node URL,给其它新建节点引导地址)
journalctl --follow --unit openethereum
安装geth查看同步情况
wget wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.3-991384a7.tar.gz
tar -zxvf geth-linux-amd64-1.10.3-991384a7.tar.gz
cp geth-linux-amd64-1.10.3-991384a7/geth /usr/bin
cd /data/openethereum/xdai
geth attach ipc:jsonrpc.ipc
终端输入
eth.syncing
如果同步完成会输出false,同步中则会输出当前同步块与最高同步块