一:
环境搭建:同多节点私链环境搭建(多节点私链搭建教程(一)_m0_55932113的博客-CSDN博客)
二:
在新建test文件夹中测试,在test下打开cmd
输入下面命令
D:\博文——多节点私链\单节点私链\test>puppeth
按如下选择
没有即回车就行
这里填你的链ID,除1以外都行
将其他客户端的删除,只留下testgeth.json,并且在该目录下新建data文件夹。
重新打开cmd,并输入:
D:\博文——多节点私链\单节点私链\test>geth --datadir "./data" --networkid 66666 init ./testgeth.json
接下来创建用户:
D:\博文——多节点私链\单节点私链\test>geth --datadir "./data" account new
并且创建一个password文档,放入你的密码:
新建一个start.bat命令处理文件,代码如下:
geth --gcmode "archive" --miner.etherbase 矿工地址 --nodiscover --ethash.cachedir "D:\geth\Ethash" --ethash.dagdir "D:\geth\Ethash" --graphql --allow-insecure-unlock --unlock=0 --password ./password --networkid 6666 --datadir "data" --http --http.api "admin,debug,web3,eth,txpool,personal,ethash,miner,net" --http.corsdomain="*" --http.port=8535 --http.addr="0.0.0.0" --ws --ws.addr "0.0.0.0" --ws.port=8546 --ws.origins "*" --ws.api "admin,debug,web3,eth,txpool,personal,ethash,miner,net" --syncmode full console
这里面的矿工地址可以随机填一个地址。
最后打开start.bat:
D:\博文——多节点私链\单节点私链\test>start.bat