Skip to content

Eth节点部署

在ubuntu22.04上部署Eth区块链。需要两种客户端,即执行层 (EL) 客户端和共识层 (CL) 客户端。

运行执行客户端

sudo add-apt-repository ppa:nethermindeth/nethermind
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install nethermind -y
/usr/share/nethermind/
sudo vi /etc/nethermind-main.cfg
{
"Init": {
"ChainSpecPath": "chainspec/foundation.json",
"GenesisHash": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
"BaseDbPath": "nethermind_db/mainnet",
"LogFileName": "/var/log/mainnet.logs.txt",
"MemoryHint": 2048000000
},
"Sync": {
"FastSync": true,
"SnapSync": true,
"PivotNumber": 20350000,
"PivotHash": "0xc985909cfcad1dae574614bc5ce5cb5f1a6919e42faf5978826311bd1b189023",
"PivotTotalDifficulty": "58750003716598352816469",
"FastBlocks": true,
"FastSyncCatchUpHeightDelta": "10000000000"
},
"EthStats": {
"Server": "wss://ethstats.net/api"
},
"Metrics": {
"NodeName": "Mainnet"
},
"Blocks": {
"TargetBlockGasLimit": 30000000
},
"JsonRpc": {
"Enabled": true,
"Timeout": 20000,
"Host": "0.0.0.0",
"Port": 8545,
"AdditionalRpcUrls": [
"http://localhost:8551|http;ws|net;eth;subscribe;engine;web3;client"
]
},
"Merge": {
"Enabled": true
}
}
screen sudo nethermind -c /etc/nethermind-main.cfg

运行共识客户端

wget https://github.com/sigp/lighthouse/releases/download/v5.2.1/lighthouse-v5.2.1-x86_64-unknown-linux-gnu.tar.gz
tar xvzf lighthouse-v5.2.1-x86_64-unknown-linux-gnu.tar.gz
mv lighthouse /usr/local/bin/
sudo chmod +x /usr/local/bin/lighthouse
screen sudo lighthouse bn \
--network mainnet \
--execution-endpoint http://localhost:8551 \
--execution-jwt ~/keystore/jwt-secret \
--checkpoint-sync-url https://mainnet.checkpoint.sigp.io \
--http --http-address 0.0.0.0

查看同步

geth_linux attach http://127.0.0.1:8545
eth.syncing
eth.blockNumber