goerli 节点部署

部署prysm

下载prysm

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

生成JWT Secret

## Optional. This command is necessary only if you've previously configured USE_PRYSM_VERSION
USE_PRYSM_VERSION=v3.1.1

## Required.
./prysm.sh beacon-chain generate-auth-secret

回到顶部

部署geth

下载geth

~# wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.25-69568c55.tar.gz
~# tar xf  geth-linux-amd64-1.10.25-69568c55.tar.gz
~# geth account new --keystore /data/goerli/keystore # 0x645c21cA37a28180315B56Edd7CCFC18505a1703

运行geth

~# /usr/local/geth/geth --goerli --http --http.addr "0.0.0.0" --http.api eth,net,engine,admin --gcmode archive  --authrpc.addr localhost --authrpc.port 8551 --authrpc.vhosts localhost --authrpc.jwtsecret /data/prysm/jwt.hex --allow-insecure-unlock --datadir /data/goerli

geth参数说明

--datadir:数据库和密钥库的数据目录(默认:"~/.ethereum")
--http.api:指定需要调用的HTTP-RPC API接口,默认只有eth,net,web3
--http:启动HTTP-RPC服务(基于HTTP的)
--http.addr:HTTP-RPC服务器监听地址(default: "localhost")
--cache:分配给内部缓存的内存的兆字节 (默认值为: 1024)
--maxpeers:最大的网络节点数量(如果设置为0,网络将被禁用)(默认值:25)
--allow-insecure-unlock:允许使用不安全的账户解锁
--authrpc.port:设置认证监听的api端口,默认为8551
-authrpc.addr:允许连接认证监听api端口的IP地址
--authrpc.vhosts:允许连接认证监听api端口的域名
--authrpc.jwtsecret:设置身份验证的RPC接口的JWT私钥的路径

回到顶部

运行beacon 节点

下载genesis.ssz

~# wget https://github.com/eth-clients/eth2-networks/raw/master/shared/prater/genesis.ssz

执行prysm

./prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --prater --jwt-secret=/data/prysm/jwt.hex --genesis-state=/data/prysm/genesis.ssz   --datadir=/data/prysm/data --suggested-fee-recipient=0x645c21cA37a28180315B56Edd7CCFC18505a1703

prysm参数说明

--datadir:数据库和密钥库的数据目录(默认:"~/.ethereum")
--authrpc.jwtsecret:设置身份验证的RPC接口的JWT私钥的路径
--rpc-host:允许连接RPC服务的主机(默认值:“127.0.0.1”)
--grpc-gateway-host:允许连接网关的主机(默认值:“127.0.0.1”)
--monitoring-host:用于监听和响应prometheus监控的主机(默认值:“127.0.0.1”)
--execution-endpoint:连接执行客户端的http端点。格式为“http://localhost:8551”
--accept-terms-of-use:接受条款和条件(用于非交互环境)(默认值:false)
--prater;--goerli:测试链
--suggested-fee-recipient: 针对质押32eth

回到顶部

查看区块同步

查看geth节点

使用以下命令检查节点的同步状态:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545

如果节点已完成同步,将看到响应:

{"jsonrpc":"2.0","id":1,"result":false}

查询最新区块高度

# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545
{"jsonrpc":"2.0","id":1,"result":"0xedd589"}

查看prysm节点

使用以下命令检查节点的同步状态:

# curl http://localhost:3500/eth/v1alpha1/node/syncing

如果节点已完成同步,将看到响应:

{"syncing":false}

参考:

https://docs.prylabs.network/docs/install/install-with-script

https://www.cnblogs.com/wangguishe/p/16785927.html

猜你喜欢

转载自blog.csdn.net/chen_peng7/article/details/129780661