Blockchain Lab (33) - Use Geth+Prysm to create an Ethereum private chain

The merged Ethereum uses PoS instead of the original PoW, which requires joining the beacon main chain and synchronizing a large number of block databases, which takes a long time. This article uses Geth+Prysm to create an Ethereum private chain, which is an Ethereum PoS experimental environment and does not need to be linked to the beacon main chain.

1. Directory structure

First, establish the required file and directory structure. The specific operations can be searched and will not be repeated.

Insert image description here

2. Configure node node0

Create an account

geth account new --keystore ./keystore

Insert image description here

Configure and start the execution client geth of node0

geth --datadir ./gethdata --networkid 197368 --port 30301 --authrpc.port 8551 --http --http.port 8545 --http.api admin,eth,debug,miner,net,personal,web3 --authrpc.jwtsecret ./jwt.hex console

Insert image description here

The address of node0

Insert image description here

Configure and start the consensus client prysm of node0

../../prysm/prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --jwt-secret=./jwt.hex --datadir ./prysmdata --rpc-port 4000 --grpc-gateway-port 3500 --p2p-udp-port 12000

Insert image description here

3. Configure node node1

Do the same as node node1

geth account new --keystore ./keystore
geth --datadir ./gethdata --networkid 197368 --port 30302 --authrpc.port 8552 --http --http.port 8546 --http.api admin,eth,debug,miner,net,personal,web3 --authrpc.jwtsecret ./jwt.hex console
../../prysm/prysm.sh beacon-chain --execution-endpoint=http://localhost:8552 --jwt-secret=./jwt.hex --datadir ./prysmdata --rpc-port 4001 --grpc-gateway-port 3501 --p2p-udp-port 12001

The address of node node1

Insert image description here

4. Add neighbors

Add node node1 to node node0

Insert image description here

Observe new neighbors in node node1

Insert image description here

5. Observe the number of blocks

There are currently no transactions and the number of blocks is 0. Initiate transactions in subsequent experiments to observe consensus and synchronization.

Insert image description here

Guess you like

Origin blog.csdn.net/qq_18807043/article/details/134953634