主要記錄了c++版本的ethereum在linux環(huán)境下的安裝,官方的依賴庫(kù)安裝腳本沒有CentOS環(huán)境下的谆吴;在此手動(dòng)的安裝了依賴環(huán)境苛预,并在其腳本install_deps.sh添加centos的支持;詳細(xì)步驟如下:
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
依賴庫(kù)的安裝热某,直接執(zhí)行官方提供的腳本即可突诬。
安裝依賴庫(kù):
./scripts/install_deps.sh
編譯代碼命令:
??? mkdir build
??? cd build
??? cmake ..
??? make(make -jNum)
編譯完成后芜繁,可執(zhí)行文件目錄為:build/eth/eth
2.CentOS
需要手動(dòng)安裝相應(yīng)的依賴庫(kù)绒极。
需要安裝依賴庫(kù)列表(yum install -y xxxx):
gcc-c++
make
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
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的下載和安裝耗時(shí)比較長(zhǎng)
編譯代碼:
??? cd build
??? cmake3 ..
??? 備份libweb3jsonrpc目錄下的.h文件(ls ../libweb3jsonrpc/*.h | while read line;do cp "$line" "${line}.tmp"; done)
??? make(make -jNum)
代碼編譯完成后垄提,可執(zhí)行文件目錄:build/eth/eth
c)運(yùn)行
./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)相關(guān)參數(shù)說(shuō)明
2.控制臺(tái)安裝
Git URL:https://github.com/ethereum/ethereum-console
安裝:
npm install -g ethereum-console
啟動(dòng):
ethconsole ipcpath
執(zhí)行命令:
a.區(qū)塊高度
b.添加帳號(hào)
c.查看帳號(hào)列表
備注:
添加CentOS依賴庫(kù)安裝后的腳本:https://github.com/laxpio/Chen_Local/blob/master/install_deps_centos.sh