Geth的安装与配置(Windows版)
目录
1.下载
Go-ethereum,也就是Geth,下载地址为:https://geth.ethereum.org/downloads/
2.安装
windows下正常安装
路径设置为:C:\Users\username\geth\
确认路径:
where geth
C:\Users\tangyao\geth\geth.exe
3.配置Geth私网运行
(1)创建genesis.json
在geth文件夹下创建private_net文件夹用于保存,在private_net下创建genesis.json,代码如下:
{
"config":{
"chainId": 33,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000033",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gaslimit": "0x8000000",
"difficulty": "0x100",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {
}
}
(2)Geth初始化
Windows版:
geth --datadir C:\users\tangyao\geth\private_net init C:\users\tangyao\geth\private_net\genesis.json
(3)启动Geth
geth --networkid "10" --nodiscover --datadir H:\geth\private_net --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --rpcapi "eth,net,web3,personal" --allow-insecure-unlock --targetgaslimit "20000000" console 2>> H:\geth\private_net\error.log
成功启动:
Welcome to the Geth JavaScript console!
instance: Geth/v1.9.25-stable-e7872729/windows-amd64/go1.15.6
at block: 0 (Thu Jan 01 1970 08:00:00 GMT+0800 (CST))
datadir: H:\geth\private_net
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1

最低0.47元/天 解锁文章
2644

被折叠的 条评论
为什么被折叠?



