Skip to content

1.节点

将客户端细分为 CL(Consensus Layer) 及 EL(Execution Layer)

零件描述
以太坊节点 又名“节点”以太坊节点是一起工作的执行节点信标节点。以太坊节点进行点对点通信以保护以太坊网络,并且需要执行层客户端软件共识层客户端软件
执行节点执行节点使用执行客户端软件来处理以太坊执行层中的交易和智能合约。Nethermind、Besu 和 Go Ethereum (Geth) 是执行客户端软件的示例。 执行节点将通过点对点网络与其他执行节点通信,并与本地信标节点通信。
信标节点信标节点使用信标节点客户端软件来协调以太坊的权益证明共识。Prysm、Teku、Lighthouse 和 Nimbus 是包含信标节点和验证器客户端软件的共识客户端。 信标节点将通过点对点网络与其他信标节点、本地执行节点和(可选)本地验证器进行通信。
验证器验证器客户端是专门的软件,可以让人们在以太坊的共识层中质押 32 ETH 作为抵押品。验证人负责在以太坊的股权证明共识机制内提出区块,并将在合并后完全取代工作证明矿工。 验证者将仅与本地信标节点对话。验证者的信标节点告诉验证者要做什么,并在验证者履行职责时将验证者的工作广播到以太坊网络。

2.网络

每个以太坊网络都分为两层:执行层(EL)和共识层(CL)

每个以太坊节点都包含两层的软件:执行层客户端软件(如 Nethermind、Besu、Geth 和 Erigon)和共识层客户端软件(如 Prysm、Teku、Lighthouse、Nimbus 和 Lodestar)。

每个网络的执行层都与(并且仅与)其相应的“合作伙伴”共识层一起工作。EL-CL 网络对共同运行以太坊权益证明

1.geth(EL)

Geth v1.10.24 is a small hotfix release for users of the GraphQL APIs. It fixes a single bug where filtering for logs from a single transaction via GraphQL returned logs from the entire block, not just the single transaction. Single transaction log filtering is unavailable via the RPC and does not impact the merge.

文档,https://geth.ethereum.org/docs/interface/les

/data/apps/snapeth/geth --authrpc.jwtsecret /data/apps/prysm/jwt.hex --syncmode snap --allow-insecure-unlock --authrpc.port 8551 --port 30303 --http --http.port 8546 --http.port 8545 --http.api web3,db,eth,net,personal --http.addr=172.31.34.215 --datadir /data/coin/snapETH --maxpeers 101 --cache 1024 --rpc.allow-unprotected-txs

#运行之后,产生的问题,解决方式,必须运行CL,等CL同步完
WARN [09-16|02:52:16.047] Unexpected storage ranges packet         peer=edfd25cd reqid=7,641,177,353,239,260,592
WARN [09-16|02:52:16.135] Unexpected storage ranges packet         peer=3b5c310a reqid=1,621,849,408,279,827,598
WARN [09-16|02:52:16.154] Unexpected bytecode packet               peer=b3debcd5 reqid=6,947,168,298,603,109,298
WARN [09-16|02:52:16.595] Unexpected storage ranges packet         peer=5b606ada reqid=3,622,311,717,466,879,639
WARN [09-16|02:52:16.595] Unexpected bytecode packet               peer=5b606ada reqid=4,981,076,003,635,715,678
INFO [09-16|02:52:18.636] Disabling direct-ancient mode            origin=15,537,221 ancient=14,811,135
INFO [09-16|02:52:19.841] Imported new block headers               count=0    elapsed=123.110ms   number=15,537,393 hash=55b11b..7bb286 age=20h9m37s   ignored=172
INFO [09-16|02:52:19.841] Legacy sync reached merge threshold      number=15,537,394 hash=b84f2d..b2e97c td=58,750,014,772,935,592,709,055 ttd=58,750,000,000,000,000,000,000
INFO [09-16|02:52:19.870] State sync in progress                   synced=72.84% state=149.09GiB accounts=269,540,706@30.55GiB slots=578,886,908@115.51GiB codes=507,734@3.03GiB    eta=5h2m37.906s
WARN [09-16|02:52:19.893] Local chain is post-merge, waiting for beacon client sync switch-over... 
WARN [09-16|02:52:19.947] Unexpected storage ranges packet         peer=edfd25cd reqid=7,823,624,587,836,870,649
WARN [09-16|02:52:19.961] Unexpected storage ranges packet         peer=3b5c310a reqid=3,033,182,872,383,144,071
WARN [09-16|02:52:20.637] Unexpected storage ranges packet         peer=5b606ada reqid=8,019,658,869,622,868,299


#正常之后日志信息
INFO [09-21|02:22:00.853] Imported new potential chain segment     blocks=1       txs=137         mgas=11.635  elapsed=75.972ms     mgasps=153.151  number=15,578,827 hash=5b6b5c..e88843 dirty=255.63MiB
INFO [09-21|02:22:00.896] Chain head was updated                   number=15,578,827 hash=5b6b5c..e88843 root=e8775b..56db73 elapsed=3.56246ms
INFO [09-21|02:22:00.897] Unindexed transactions                   blocks=1       txs=148         tail=13,228,828 elapsed=1.250ms
/data/apps/snapeth/geth --authrpc.jwtsecret /data/apps/prysm/jwt.hex --syncmode snap --allow-insecure-unlock --authrpc.port 8551 --port 30303 --http --http.port 8546 --http.port 8545 --http.api web3,db,eth,net,personal --http.addr=172.31.34.215 --datadir /data/coin/snapETH --maxpeers 101 --cache 1024 --rpc.allow-unprotected-txs

#运行之后,产生的问题,解决方式,必须运行CL,等CL同步完
WARN [09-16|02:52:16.047] Unexpected storage ranges packet         peer=edfd25cd reqid=7,641,177,353,239,260,592
WARN [09-16|02:52:16.135] Unexpected storage ranges packet         peer=3b5c310a reqid=1,621,849,408,279,827,598
WARN [09-16|02:52:16.154] Unexpected bytecode packet               peer=b3debcd5 reqid=6,947,168,298,603,109,298
WARN [09-16|02:52:16.595] Unexpected storage ranges packet         peer=5b606ada reqid=3,622,311,717,466,879,639
WARN [09-16|02:52:16.595] Unexpected bytecode packet               peer=5b606ada reqid=4,981,076,003,635,715,678
INFO [09-16|02:52:18.636] Disabling direct-ancient mode            origin=15,537,221 ancient=14,811,135
INFO [09-16|02:52:19.841] Imported new block headers               count=0    elapsed=123.110ms   number=15,537,393 hash=55b11b..7bb286 age=20h9m37s   ignored=172
INFO [09-16|02:52:19.841] Legacy sync reached merge threshold      number=15,537,394 hash=b84f2d..b2e97c td=58,750,014,772,935,592,709,055 ttd=58,750,000,000,000,000,000,000
INFO [09-16|02:52:19.870] State sync in progress                   synced=72.84% state=149.09GiB accounts=269,540,706@30.55GiB slots=578,886,908@115.51GiB codes=507,734@3.03GiB    eta=5h2m37.906s
WARN [09-16|02:52:19.893] Local chain is post-merge, waiting for beacon client sync switch-over... 
WARN [09-16|02:52:19.947] Unexpected storage ranges packet         peer=edfd25cd reqid=7,823,624,587,836,870,649
WARN [09-16|02:52:19.961] Unexpected storage ranges packet         peer=3b5c310a reqid=3,033,182,872,383,144,071
WARN [09-16|02:52:20.637] Unexpected storage ranges packet         peer=5b606ada reqid=8,019,658,869,622,868,299


#正常之后日志信息
INFO [09-21|02:22:00.853] Imported new potential chain segment     blocks=1       txs=137         mgas=11.635  elapsed=75.972ms     mgasps=153.151  number=15,578,827 hash=5b6b5c..e88843 dirty=255.63MiB
INFO [09-21|02:22:00.896] Chain head was updated                   number=15,578,827 hash=5b6b5c..e88843 root=e8775b..56db73 elapsed=3.56246ms
INFO [09-21|02:22:00.897] Unindexed transactions                   blocks=1       txs=148         tail=13,228,828 elapsed=1.250ms

2.Prysm (CL)

文档,https://docs.prylabs.network/docs/troubleshooting/issues-errors

https://ethereum.org/zh/developers/docs/nodes-and-clients/

客户端,https://ethereum.org/en/upgrades/get-involved/#clients

2.0默认端口

端口说明
13000P2P网络通信端口,用于节点间的点对点通信,包括区块传输和状态同步等
4000Beacon链RPC端口,用于与Beacon链进行通信,例如获取当前验证者集合、验证者信息等
4001Validator链RPC端口,用于与Validator链进行通信,例如获取验证者的质押信息、验证者状态等
8080Grafana监控端口,如果启用了Prysm的统计和可视化功能,则可以使用该端口访问Grafana面板

2.1安装

mkdir prysm && cd prysm
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh
sh prysm.sh
mkdir prysm && cd prysm
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh
sh prysm.sh

2.2JWT 身份验证

两种方式随机取一

  • 1.openssl
openssl rand -hex 32 | tr -d "\n" > "jwt.hex"
openssl rand -hex 32 | tr -d "\n" > "jwt.hex"
  • 2.prysm
./prysm.sh beacon-chain generate-auth-secret
./prysm.sh beacon-chain generate-auth-secret

2.3启动

./prysm.sh beacon-chain --execution-endpoint=http://127.0.0.1:8551  --jwt-secret=/data/apps/prysm/jwt.hex

#默认启动数据存放到/root/.eth2 目录下
--execution-endpoint  指定eth块服务
--datadir=  指定数据路径
./prysm.sh beacon-chain --execution-endpoint=http://127.0.0.1:8551  --jwt-secret=/data/apps/prysm/jwt.hex

#默认启动数据存放到/root/.eth2 目录下
--execution-endpoint  指定eth块服务
--datadir=  指定数据路径

操作顺序,1.先制作hex密钥,2.启动eth,3.启动prysm

  • systemd启动
bash
[program:prysm]
directory=/data/apps/prysm
command=/bin/bash -c "./prysm.sh beacon-chain --execution-endpoint=http://127.0.0.1:8551  --jwt-secret=/data/apps/prysm/jwt.hex"
autostart=true
autorestart=true
startretries=5
stderr_logfile=/data/log/prysm_error.log
stdout_logfile=/data/log/prysm_out.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups = 10
[program:prysm]
directory=/data/apps/prysm
command=/bin/bash -c "./prysm.sh beacon-chain --execution-endpoint=http://127.0.0.1:8551  --jwt-secret=/data/apps/prysm/jwt.hex"
autostart=true
autorestart=true
startretries=5
stderr_logfile=/data/log/prysm_error.log
stdout_logfile=/data/log/prysm_out.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups = 10
  • eth启动
nohup /data/apps/snapeth/geth --authrpc.jwtsecret /data/apps/prysm/jwt.hex --syncmode snap --allow-insecure-unlock --authrpc.port 8551 --port 30303 --http --http.port 8546 --http.port 8545 --http.api web3,db,eth,net,personal --http.addr=127.0.0.1 --datadir /data/coin/snapETH --maxpeers 101 --cache 1024 --rpc.allow-unprotected-txs &
nohup /data/apps/snapeth/geth --authrpc.jwtsecret /data/apps/prysm/jwt.hex --syncmode snap --allow-insecure-unlock --authrpc.port 8551 --port 30303 --http --http.port 8546 --http.port 8545 --http.api web3,db,eth,net,personal --http.addr=127.0.0.1 --datadir /data/coin/snapETH --maxpeers 101 --cache 1024 --rpc.allow-unprotected-txs &

3.CL常用操作

查看同步结果

curl -s http://localhost:3500/eth/v1/node/syncing | jq .

{
  "data": {
    "head_slot": "4166307",
    "sync_distance": "561507",
    "is_syncing": true,
    "is_optimistic": false
  }
}

#is_optimistic":false  ,则还未同步完成
#"is_syncing": false, 则同步完成

#同步完成现象
[root@xxx snapeth]# curl -s http://localhost:3500/eth/v1/node/syncing | jq .
{
  "data": {
    "head_slot": "4734586",
    "sync_distance": "0",
    "is_syncing": false,
    "is_optimistic": true
  }
}
curl -s http://localhost:3500/eth/v1/node/syncing | jq .

{
  "data": {
    "head_slot": "4166307",
    "sync_distance": "561507",
    "is_syncing": true,
    "is_optimistic": false
  }
}

#is_optimistic":false  ,则还未同步完成
#"is_syncing": false, 则同步完成

#同步完成现象
[root@xxx snapeth]# curl -s http://localhost:3500/eth/v1/node/syncing | jq .
{
  "data": {
    "head_slot": "4734586",
    "sync_distance": "0",
    "is_syncing": false,
    "is_optimistic": true
  }
}

查看slot高度

[root@eth_new ~]# curl -s http://127.0.0.1:3500/eth/v1/beacon/headers/finalized | jq .'data.header.message'
{
  "slot": "4748832",
  "proposer_index": "331717",
  "parent_root": "0xdabc42c10b36ad8ac21d9d89d8ee160ad1127c3d78858c0613526892f5a15f72",
  "state_root": "0xf4011d79ca926886768e5f6d5611cb8c6436be0d18181e95af40d1ea278c8cc7",
  "body_root": "0x0ee2407161d8cd98f282da0a80ccb229cbf6f9d93be7d2e8cec547fc3f794db7"
}
[root@eth_new ~]# curl -s http://127.0.0.1:3500/eth/v1/beacon/headers/finalized | jq .'data.header.message'
{
  "slot": "4748832",
  "proposer_index": "331717",
  "parent_root": "0xdabc42c10b36ad8ac21d9d89d8ee160ad1127c3d78858c0613526892f5a15f72",
  "state_root": "0xf4011d79ca926886768e5f6d5611cb8c6436be0d18181e95af40d1ea278c8cc7",
  "body_root": "0x0ee2407161d8cd98f282da0a80ccb229cbf6f9d93be7d2e8cec547fc3f794db7"
}

查看CL版本

[root@xxx prysm]# sh prysm.sh beacon-chain --version
Latest Prysm version is v3.1.1.
Beacon chain is up to date.
Verifying binary integrity.
beacon-chain-v3.1.1-linux-amd64: OK
gpg: Signature made Fri 09 Sep 2022 08:57:35 PM UTC using RSA key ID F1A5036E
gpg: Good signature from "Preston Van Loon <preston@prysmaticlabs.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 0AE0 051D 647B A3C1 A917  AF40 72E3 3E4D F1A5 036E
Verified /data/apps/prysm/dist/beacon-chain-v3.1.1-linux-amd64 has been signed by Prysmatic Labs.
Starting Prysm beacon-chain --version
beacon-chain version Prysm/v3.1.1/653ea3b030c3bb99aa3f3d95a8de9f4d6e147930. Built at: 2022-09-09 17:21:54+00:00
[root@xxx prysm]# sh prysm.sh beacon-chain --version
Latest Prysm version is v3.1.1.
Beacon chain is up to date.
Verifying binary integrity.
beacon-chain-v3.1.1-linux-amd64: OK
gpg: Signature made Fri 09 Sep 2022 08:57:35 PM UTC using RSA key ID F1A5036E
gpg: Good signature from "Preston Van Loon <preston@prysmaticlabs.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 0AE0 051D 647B A3C1 A917  AF40 72E3 3E4D F1A5 036E
Verified /data/apps/prysm/dist/beacon-chain-v3.1.1-linux-amd64 has been signed by Prysmatic Labs.
Starting Prysm beacon-chain --version
beacon-chain version Prysm/v3.1.1/653ea3b030c3bb99aa3f3d95a8de9f4d6e147930. Built at: 2022-09-09 17:21:54+00:00

CL↔EL节点连通性

[root@xxx prysm]# curl -s http://localhost:3500/eth/v1alpha1/node/eth1/connections |jq .
{
  "currentAddress": "http://127.0.0.1:8551",
  "currentConnectionError": "no contract code at given address",
  "addresses": [
    "http://127.0.0.1:8551"
  ],
  "connectionErrors": []
}


#解释
currentConnectionError: no contract code at given address,您的执行节点可能仍在同步。否则,如果您没有看到任何错误,则您的信标节点已连接到您的执行节点。

此输出可以解释为“EN-BN 连接正常”:{"currentAddress":"http://localhost:8551","currentConnectionError":"","addresses":["http://localhost:8551"],"connectionErrors":[]}


#正常输出
[root@xxx ~]# curl -s http://localhost:3500/eth/v1alpha1/node/eth1/connections |jq .
{
  "currentAddress": "http://127.0.0.1:8551",
  "currentConnectionError": "",
  "addresses": [
    "http://127.0.0.1:8551"
  ],
  "connectionErrors": []
}
[root@xxx prysm]# curl -s http://localhost:3500/eth/v1alpha1/node/eth1/connections |jq .
{
  "currentAddress": "http://127.0.0.1:8551",
  "currentConnectionError": "no contract code at given address",
  "addresses": [
    "http://127.0.0.1:8551"
  ],
  "connectionErrors": []
}


#解释
currentConnectionError: no contract code at given address,您的执行节点可能仍在同步。否则,如果您没有看到任何错误,则您的信标节点已连接到您的执行节点。

此输出可以解释为“EN-BN 连接正常”:{"currentAddress":"http://localhost:8551","currentConnectionError":"","addresses":["http://localhost:8551"],"connectionErrors":[]}


#正常输出
[root@xxx ~]# curl -s http://localhost:3500/eth/v1alpha1/node/eth1/connections |jq .
{
  "currentAddress": "http://127.0.0.1:8551",
  "currentConnectionError": "",
  "addresses": [
    "http://127.0.0.1:8551"
  ],
  "connectionErrors": []
}

查看CL slot 高度

Current Slot

https://beaconcha.in/

或者

#同步完成现象
[root@xxx snapeth]# curl -s http://localhost:3500/eth/v1/node/syncing | jq .
{
  "data": {
    "head_slot": "4734586",
    "sync_distance": "0",
    "is_syncing": false,
    "is_optimistic": true
  }
}
#同步完成现象
[root@xxx snapeth]# curl -s http://localhost:3500/eth/v1/node/syncing | jq .
{
  "data": {
    "head_slot": "4734586",
    "sync_distance": "0",
    "is_syncing": false,
    "is_optimistic": true
  }
}

查看端口

端口/协议防火墙规则原因/注意事项
8545/TCP阻止所有流量。这是执行节点的查询 API 的 JSON-RPC 端口。您(和应用程序)可以使用此端口检查执行节点状态,查询执行层链数据,甚至提交交易。这个端口一般不应该暴露给外界。
3500/TCP阻止所有流量。这是信标节点查询 API 的 JSON-RPC 端口。您(和应用程序)可以使用此端口检查信标节点状态并查询共识层链数据。这个端口一般不应该暴露给外界。
8551/TCP阻止所有流量。您的信标节点使用此端口连接到执行节点的引擎 API 。只有当您的本地信标节点连接到远程执行节点时,才应允许通过此端口的入站和出站流量。
4000/TCP阻止所有流量。您的验证器使用此端口通过gRPC连接到您的信标节点。只有当您的本地验证器连接到远程信标节点时,才应允许通过此端口的入站和出站流量。
*/UDP+TCP允许出站流量。为了发现对等点,Prysm 的信标节点通过随机端口拨出。允许来自任何端口的出站 TCP/UDP 流量将有助于 Prysm 找到对等点。
13000/TCP允许入站和出站流量。在我们发现对等点之后,我们通过这个端口拨叫它们为libp2p建立一个持续的连接,并且所有 gossip/p2p 请求和响应都将通过该连接流动。
12000/UDP允许入站和出站流量。你的信标节点公开这个 UDP 端口,以便其他以太坊节点可以发现你的节点,请求链数据,并提供链数据。
30303/TCP+UDP允许入站和出站流量。30303/TCP是您的执行节点的侦听器端口,30303/UDP而是它的发现端口。此规则允许您的执行节点连接到其他对等节点。请注意,某些客户端30301默认使用。

请注意,共识客户端和执行客户端都允许您自定义其中的许多端口。上面的规则表基于默认端口值

5.数据目录结构

[root@eth_new prym_data]# tree -L 3
.
├── beaconchaindata
│   ├── beaconchaindata
│   │   └── beaconchain.db
│   ├── beaconchain.db
│   ├── metaData
│   └── tosaccepted
├── metaData
└── tosaccepted
[root@eth_new prym_data]# tree -L 3
.
├── beaconchaindata
│   ├── beaconchaindata
│   │   └── beaconchain.db
│   ├── beaconchain.db
│   ├── metaData
│   └── tosaccepted
├── metaData
└── tosaccepted

6.API

https://ethereum.github.io/beacon-APIs/#/Beacon

7.merge

https://medium.com/taipei-ethereum-meetup/eth-2-0-cl-el-separation-and-impact-of-the-merge-dbeb6828c907

https://notes.ethereum.org/@hww/the-merge-brief-summary#Execution-Layer-EL-執行層

容器方式

version: '3.9'
services:
  beacon-node:
    image: gcr.io/prysmaticlabs/prysm/beacon-chain:v2.1.3-rc.3
    hostname: beacon-node
    restart: always
    container_name: beacon-node
    volumes:
      - "./data:/data"
      - "./genesis.ssz:/genesis/genesis.ssz"
      - "./eth-node/root/.ethereum/ropsten:/ropsten"
    command:
      - --datadir=/data
      - --rpc-host=0.0.0.0
      - --monitoring-host=0.0.0.0
      - --http-web3provider=http://eth-node:8550
      - --genesis-state=/genesis/genesis.ssz
      - --terminal-total-difficulty-override=50000000000000000
      - --ropsten
      - --accept-terms-of-use
      - --jwt-secret=/ropsten/geth/jwtsecret
    ports:
      - 4000:4000
      - 13000:13000 
      - 12000:12000/udp

  eth-node:
    image: ethereum/client-go:v1.10.18
    hostname: eth-node
    restart: always
    container_name: eth-node
    ports:
      - 30303:30303
      - 30303:30303/udp
      - 8550:8550
      - 8546:8546
      - 6060:6060
    restart: always
    volumes:
      - "./eth-node/root:/root"
    command:
      - --ropsten
      - --cache=1024
      - --nousb
      - --port=30303
      - --http
      - --http.api=admin,debug,miner,txpool,personal,eth,net,web3
      - --http.port=8550
      - --http.addr=0.0.0.0
      - --http.vhosts=*
      - --http.corsdomain=*
      - --metrics
      - --metrics.addr=0.0.0.0
      - --metrics.port=6060
      - --graphql
      - --graphql.vhosts=*
      - --ws
      - --ws.addr=0.0.0.0
      - --ws.port=8546
      - --ws.api=admin,debug,miner,txpool,personal,eth,net,web3
      - --ws.origins=*
      - --rpc.allow-unprotected-txs
      - --override.terminaltotaldifficulty=50000000000000000
version: '3.9'
services:
  beacon-node:
    image: gcr.io/prysmaticlabs/prysm/beacon-chain:v2.1.3-rc.3
    hostname: beacon-node
    restart: always
    container_name: beacon-node
    volumes:
      - "./data:/data"
      - "./genesis.ssz:/genesis/genesis.ssz"
      - "./eth-node/root/.ethereum/ropsten:/ropsten"
    command:
      - --datadir=/data
      - --rpc-host=0.0.0.0
      - --monitoring-host=0.0.0.0
      - --http-web3provider=http://eth-node:8550
      - --genesis-state=/genesis/genesis.ssz
      - --terminal-total-difficulty-override=50000000000000000
      - --ropsten
      - --accept-terms-of-use
      - --jwt-secret=/ropsten/geth/jwtsecret
    ports:
      - 4000:4000
      - 13000:13000 
      - 12000:12000/udp

  eth-node:
    image: ethereum/client-go:v1.10.18
    hostname: eth-node
    restart: always
    container_name: eth-node
    ports:
      - 30303:30303
      - 30303:30303/udp
      - 8550:8550
      - 8546:8546
      - 6060:6060
    restart: always
    volumes:
      - "./eth-node/root:/root"
    command:
      - --ropsten
      - --cache=1024
      - --nousb
      - --port=30303
      - --http
      - --http.api=admin,debug,miner,txpool,personal,eth,net,web3
      - --http.port=8550
      - --http.addr=0.0.0.0
      - --http.vhosts=*
      - --http.corsdomain=*
      - --metrics
      - --metrics.addr=0.0.0.0
      - --metrics.port=6060
      - --graphql
      - --graphql.vhosts=*
      - --ws
      - --ws.addr=0.0.0.0
      - --ws.port=8546
      - --ws.api=admin,debug,miner,txpool,personal,eth,net,web3
      - --ws.origins=*
      - --rpc.allow-unprotected-txs
      - --override.terminaltotaldifficulty=50000000000000000
  • 单节点
shell
docker run -itd --restart=unless-stopped  \
   -v /etc/localtime:/etc/localtime \
   -v /etc/timezone:/etc/timezone \
   --name beacon-node \
   -v $(pwd)/data:/data -v $(pwd)/data/jwt.hex:/opt/jwt.hex \
  --network=host \
   gcr.io/prysmaticlabs/prysm/beacon-chain:v3.1.1 \
  --datadir=/data \
  --jwt-secret=/opt/jwt.hex \
  --rpc-host=0.0.0.0 \
  --grpc-gateway-host=0.0.0.0 \
  --monitoring-host=0.0.0.0 \
  --execution-endpoint=http://127.0.0.1:8551 \
  --accept-terms-of-use=true
docker run -itd --restart=unless-stopped  \
   -v /etc/localtime:/etc/localtime \
   -v /etc/timezone:/etc/timezone \
   --name beacon-node \
   -v $(pwd)/data:/data -v $(pwd)/data/jwt.hex:/opt/jwt.hex \
  --network=host \
   gcr.io/prysmaticlabs/prysm/beacon-chain:v3.1.1 \
  --datadir=/data \
  --jwt-secret=/opt/jwt.hex \
  --rpc-host=0.0.0.0 \
  --grpc-gateway-host=0.0.0.0 \
  --monitoring-host=0.0.0.0 \
  --execution-endpoint=http://127.0.0.1:8551 \
  --accept-terms-of-use=true