Geth的安装与配置(Windows版)

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
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值