以太坊环境搭建

1、下载go语言:https://golang.google.cn/dl/

2、安装go编译器,然后将go编译器的bin路径配到环境变量里面

3、下载以太坊开源代码(需FQ):https://github.com/ethereum/go-ethereum

4、cmd进去代码目录,运行go install -v ./...命令编译源码

如果编译报错,运行go env -w GOPROXY=https://goproxy.cn,direct命令修改代理,然后再次运行go install -v ./...编译

5、go env查看go语言环境信息,其中GOPATH为编译后程序存放路径

在代码目录下建立config文件夹,下载genesis.json文件放到该文件夹下

cmd 进入代码目录运行 D:\program\gopath\bin\geth.exe --datadir config\data init config\genesis.json命令初始化创世区块链

其中D:\program\gopath\bin\geth.exe为GOPATH中geth的路径

6、运行D:\program\gopath\bin\geth.exe --datadir config\data --networkid 12 --syncmode "full" --port 30312 --http --http.addr "0.0.0.0" --http.port 8555 --http.api "personal,eth,net,web3,txpool,miner --miner.gasprice 0 console

命令启动创世区块链,如果启动后无法输入命令可能是未复制到最后面console命令

7、personal.newAccount("lcz”)创建以太坊账号

8、miner.start(1),以一个矿工开始挖矿

原文地址:https://www.cnblogs.com/luchangzhu/p/15624640.html