I am learning to use the polygon edge framework to build my first blockchain. I will share my notes below in both Chinese and English.
Refer to this youtube tutorial:https://www.youtube.com/watch?v=uOqdmoFeQwY&list=PLQsPt2JCYGag-6aAnKh_nMDpM6Vrloco4
1.Go to the github repository and download the polygon edge executable file for your operating system(前往github仓库下载适用于你的操作系统的polygon edge可执行文件)link:https://github.com/0xPolygon/polygon-edge/releases
2.We plan to start 4 local blockchain nodes on this machine, so we need to initialize the data storage directory first.(我们计划在本机启动4个本地区块链节点,因此需要先初始化数据存储目录。)
polygon-edge secrets init --data-dir test-chain-1 --insecure
polygon-edge secrets init --data-dir test-chain-2 --insecure
polygon-edge secrets init --data-dir test-chain-3 --insecure
polygon-edge secrets init --data-dir test-chain-4 --insecure
We initialized 4 directories to store data for 4 local blockchain nodes. We enabled --insecure because the node keys are stored in the local file system.(我们初始化了4个目录,分别给4个本地的区块链节点存储数据。我们启用--insecure,因为节点密钥存储在本地文件系统)
Command execution result (one of 4) 命令执行结果(4个中其中之一)
[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION]
[SECRETS INIT]
Public key (address) = 0x20598Ba4659979645...ACd1755B17......2D00
BLS Public key = 0x863bf4ff9269b0f5c17bb048bf628da61677b..567a699d7e9a6790e944ed692807dfefe75dcc4865b4cca34d....
Node ID = 16Uiu2HAkuyaCVLpx2T8Apc5uF5DwwuNa8..JFuuiAzx......
multiaddr string for bootnode (bootnode节点标识符格式如下)
/ip4//tcp//p2p/
So my multiaddr for 4 nodes is:
/ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAkuyaCVLpx2T8Apc5uF5DwwuNa8EuJFuuiAzxnkZePRyDp \ /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmENLCa1Dhn4S62FhQcF3SYJKgKkWo4vLRuwXuojF28E6o \ /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAm7VxBuvjf5uKKdK8zYbFoz5bEDsqk774rigefbF1GWmRp \ /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAkyxytuJn5e9fJfZnSRCMF18L2mfFNUELrLk7VbCqkTgUX \
create genesis file:
polygon-edge genesis --consensus ibft --validators-prefix test-chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAkuyaCVLpx2T8Apc5uF5DwwuNa8EuJFuuiAzxnkZePRyDp --premine=0x704ab877D387C616E9B4fE775362B39805A43AdA:100000000000000000000
Result:
***** IMPORTANT NOTICE: IBFT consensus protocol is about to be removed from the Edge in the following release. *****
Please migrate to the PolyBFT protocol and plan your activities accordingly.
More information on how to execute the migration process can be found here(https://wiki.polygon.technology/docs/edge/operate/ibft-to-polybft/).
[GENESIS SUCCESS]
Genesis written to ./genesis.json
OK,Finally,RUN the NODE:
../polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :10001 --jsonrpc :10002 --seal
END
Top comments (0)