CL/EL 客戶端同步
最後更新於
這有幫助嗎?
這有幫助嗎?
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="35.157.64.49" port port="30303" protocol="tcp" accept'sudo firewall-cmd --reload[Node.P2P]
TrustedNodes = ["enode://b5b4e5aa8d8f4568af755af6da0d4642b6475d8d87c3470632bdecab8f54e4e2936ec8ae0d6f34cff8b052235e81a281912c17dfcdbf40d6d3c281b78ada4134"]curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"admin_peers","params":[],"id":1}' http://localhost:8545[
{
"enode": "enode://9ddacbcca0dc1d1b112d470552acc795fce5c3e9f50983fcd5cee7b47289914295acaef3163bea819bcc967461978425def13595deb7de4063295c40e593f320@52.205.173.134:53754",
"id": "8be29a75ac2cf81e3aa37ccc119630a9dfc43c88d7b5200398a466f5ef9097c4",
"name": "Geth/v1.4.5/linux-amd64/go1.21.7",
"caps": [
"eth/68"
],
"network": {
"localAddress": "127.0.0.1:30311",
"remoteAddress": "52.205.173.134:53754",
"inbound": true,
"trusted": false,
"static": false
},
"protocols": {
"eth": {
"version": 68
}
}
}
]sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="35.157.64.49" port port="9000" protocol="tcp" accept'
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="35.157.64.49" port port="9000" protocol="udp" accept'sudo firewall-cmd --reload--boot-nodes <'Relay_Multiaddr','Bootnodes_ENR'> --trusted-peers "$Relay_Peer_ID"
## 由于boot-nodes参数在重启后会覆盖更新,为保证连接稳定性,请在Relay_Multiaddr后携带默认的bootnodes ENR参数,可参考 https://github.com/sigp/lighthouse/blob/120c3c6dac9df8ee4d83f055919bd3488abae4f6/common/eth2_network_config/built_in_network_configs/mainnet/bootstrap_nodes.yaml#L16--peer "$Relay_Multiaddr"--netkey-file /path/to/netkey --direct-peer "$Relay_Multiaddr"--p2p-direct-peers "$Relay_Multiaddr"Relay_Peer_ID="16Uiu2..."
REST_PORT="<CLIENT_REST_PORT>"
curl -s "http://127.0.0.1:${REST_PORT}/eth/v1/node/peers?state=connected" \
| jq --arg id "$Relay_Peer_ID" '.data[] | select(.peer_id == $id) | {
peer_id,
state,
direction,
last_seen_p2p_address,
enr
}'