Cpp-ethereum安装

主要记录了c++版本的ethereum在linux环境下的安装,官方的依赖库安装脚本没有CentOS环境下的;在此手动的安装了依赖环境,并在其脚本install_deps.sh添加centos的支持;详细步骤如下:

a)下载源码

从git上下载cpp-ethereum的源码

Git url:https://github.com/ethereum/cpp-ethereum

git clone:

git clone --recursive https://github.com/ethereum/cpp-ethereum.git

b)编译

1.Ubuntu

依赖库的安装,直接执行官方提供的脚本即可。

安装依赖库:

./scripts/install_deps.sh

编译代码命令:

    mkdir build

    cd build

    cmake ..

    make(make -jNum)

编译完成后,可执行文件目录为:build/eth/eth

2.CentOS

需要手动安装相应的依赖库。

需要安装依赖库列表(yum install -y xxxx):

gcc

gcc-c++

make

openssl-devel

cmake

cmake3

git

boost 1.54(cpp-ethereum-develop-v1.3.0最低要求 https://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz/download 下载源码安装)

cryptopp-devel

gmp-devel

jsoncpp-devel

leveldb-devel

libmicrohttpd-devel

miniupnpc-devel

libzip-devel

mesa-libGL-devel

ocl-icd-devel

opencl-headers.noarch

argtable-devel

libedit-devel

libcurl-devel

libjson-rpc-cpp(git clone git://github.com/cinemast/libjson-rpc-cpp.git 再安装)

备注:其中boost的下载和安装耗时比较长

编译代码:

    mkdir build

    cd build

    cmake3 ..

    备份libweb3jsonrpc目录下的.h文件(ls ../libweb3jsonrpc/*.h | while read line;do cp "$line" "${line}.tmp"; done)

    make(make -jNum)

代码编译完成后,可执行文件目录:build/eth/eth

c)运行

./eth--genesis /home/data/genesis.json--datadir /home/data/ --network-id 123--cpu-v 8--json-rpc--json-rpc-port 8546 --rpccorsdomain--ipc --mining on --mining-threads 1 --no-discovery --no-bootstrap--unsafe-transactions --dont-check--config/home/data/config.json

d)相关参数说明

启动参数说明

2.控制台安装

Git URL:https://github.com/ethereum/ethereum-console

安装:

npm install -g ethereum-console

启动:

ethconsole ipcpath

执行命令:

a.区块高度

获取区块高度

b.添加帐号

添加帐号

c.查看帐号列表

查看帐号列表

备注:

添加CentOS依赖库安装后的脚本:https://github.com/laxpio/Chen_Local/blob/master/install_deps_centos.sh

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文是对以太坊文档 Ethereum Frontier Guide 和 Ethereum Homestead 的整...
    趁风卷阅读 13,203评论 0 16
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,798评论 19 139
  • 周一早上 前百度 的leader 问我 周日发在群里的 说什么在测试机安装好了 paddle 是什么,我说就是...
    Helen_Cat阅读 4,933评论 0 1
  • 许久之前朋友告诉我说有人写了一片文章叫《驰骋在西伯利亚荒原上》。问我对此文的评价,我大致浏览了下这片文章。个人觉得...
    皮尔斯李阅读 2,682评论 0 0
  • 1、世界上最残酷的事情就是在错的时间里,遇到了对的人。 2、管什么能不能走到最后,在一起爱一天就会有一天的温柔,就...
    萌萌乐L阅读 6,705评论 0 2