以太坊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