基于Ubuntu系统搭建以太坊go-ethereum源码的开发环境

来源:互联网 发布:centos tmp 自动清理 编辑:程序博客网 时间:2024/06/04 18:26

第一、先安装geth的CLI环境sudo apt-get install geth,这个很重要

第二、下载源代码

git clone https://github.com/ethereum/go-ethereum
第三、依赖环境

注:(重要)先通过此链接配置GO语言的开发环境:https://github.com/ethereum/go-ethereum/wiki/Installing-Go#ubuntu-1404
Ethereum Go是使用Go语言开发的,需要Go和C的编译器
sudo apt-get install -y build-essential golang


cd go-ethereummake geth

最后输入:

build/bin/geth --datadir "~/ethdev" --dev

启动客户端


然后另起终端输入

geth --dev console 2>> file_to_log_output

输出

Welcome to the Geth JavaScript console!

instance: Geth/v1.5.7-stable-da2a22c3/linux/go1.7.3
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0

>

即为成功

然后就可以进行以太坊命令操作



也可已使用build/bin/geth --identity "secbro etherum" --rpc --rpccorsdomain "*" --datadir "/home/zero/eth/chain" --port "30303" --rpcapi "db,eth,net,web3" -- networkid 95518 console --dev创建私有连,创世块

最后配置Go语言环境可以参考我的博客

0 0
原创粉丝点击