搭建自己的联盟链

本文档详细介绍了如何在已配置好的go-ethereum-1.9.25环境中设置四个节点的Proof-of-Authority (POA)以太坊网络。每个节点的启动参数包括端口、网络ID、RPC设置、解锁账户和同步模式。通过bootnode命令行选项,节点们相互连接,并使用相同的创世区块配置。此外,还提供了可能用到的智能合约部署和账户解锁命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以太坊POA四节点部署

假设已经配置好go-ethereum-1.9.25环境。
新建6个文件夹。
在这里插入图片描述
bootdir:
bootnode --genkey boot.key
bootnode --nodekey boot.key
在这里插入图片描述
genesis:
puppeth
在这里插入图片描述在这里插入图片描述
在这里插入图片描述boot1:
geth --datadir ./ account new
在这里插入图片描述
boot2\3\4:
geth --datadir ./ account new

bootdir:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
boot1\2\3\4:
geth --datadir ./ init test2.json
在这里插入图片描述
boot1:
sudo geth --datadir ./ --port 30321 --networkid 666 --rpc --rpcaddr 0.0.0.0 --rpcapi net,web3,eth,personal --rpcport 8110 --bootnodes “enode://46ed8eaa060683c3c9cf87a5f0b61818c8530845a213aeeb30841082eeb94c560a79d6e73ce37e3d190117646d9f50ac987bf78a0a85104b61b1a7ed841ce3ad@127.0.0.1:30301” --unlock “0x6437172DbCf90C2040D90516b693648D84B861e2” --allow-insecure-unlock --syncmode “full” console
在这里插入图片描述
boot2:
sudo geth --datadir ./ --port 30322 --networkid 666 --rpc --rpcaddr 0.0.0.0 --rpcapi net,web3,eth,personal --rpcport 8111 --bootnodes “enode://46ed8eaa060683c3c9cf87a5f0b61818c8530845a213aeeb30841082eeb94c560a79d6e73ce37e3d190117646d9f50ac987bf78a0a85104b61b1a7ed841ce3ad@127.0.0.1:30301” --unlock " 0xdFF49664Ab77dA49376CEC8f40386289f44810d8" --allow-insecure-unlock --syncmode “full” console
在这里插入图片描述
boot3:
sudo geth --datadir ./ --port 30323 --networkid 666 --rpc --rpcaddr 0.0.0.0 --rpcapi net,web3,eth,personal --rpcport 8112 --bootnodes “enode://46ed8eaa060683c3c9cf87a5f0b61818c8530845a213aeeb30841082eeb94c560a79d6e73ce37e3d190117646d9f50ac987bf78a0a85104b61b1a7ed841ce3ad@127.0.0.1:30301” --unlock " 0x47F55F4BD281032Edc69FedE10858f5f28516EAc" --allow-insecure-unlock --syncmode “full” console
在这里插入图片描述
boot4:
sudo geth --datadir ./ --port 30324 --networkid 666 --rpc --rpcaddr 0.0.0.0 --rpcapi net,web3,eth,personal --rpcport 8113 --bootnodes “enode://46ed8eaa060683c3c9cf87a5f0b61818c8530845a213aeeb30841082eeb94c560a79d6e73ce37e3d190117646d9f50ac987bf78a0a85104b61b1a7ed841ce3ad@127.0.0.1:30301” --unlock " 0xF4752e7AcCF0dC49cee6fFB1DfeB7941fc459b1A" --allow-insecure-unlock --syncmode “full” console
在这里插入图片描述
可能会用到的:
geth --datadir ‘./’ attach ipc:./db/geth.ipc
miner.start(1)
eth
personal.unlockAccount(eth.accounts[0],‘root’)
eth.blockNumber
智能合约:
node deploy.js

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值