最近在研究DPOS的时候,无意间找到了EOS,据说它是区块链3.0的范例产品,就在GITHUB中下载了进行编译,却发现按照GITHUB中的步骤有一些小的地方需要改变一下,但绝大多数还是按照它上面的步骤,现在我将自己搭建的步骤详细的写出来,希望对大家有所帮助。
安装EOS
1:yum --enablerepo=extras install centos-release-scl
如果遇到:
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
则运行
rm -rf /var/run/yum.pid 来强行解除锁定,然后你的yum就可以运行了
2:yum update
如果遇到:
Errno 14 Couldn't resolve host
在CentOS 7下不要直接修改/etc/resolv.conf,而是应该使用systemctl restart NetworkManager命令,它会根据/etc/sysconfig/network-scripts/ifcfg-eth0自动生成etc/resolv.conf。
3:yum install -y devtoolset-7
4:scl enable devtoolset-7 bash
5:yum install -y python33.x86_64
6:scl enable python33 bash
7:yum install git autoconf automake libtool make bzip2 bzip2-devel.x86_64 openssl-devel.x86_64 gmp-devel.x86_64 ocaml.x86_64 doxygen libicu-devel.x86_64 python-devel.x86_64 gettext-devel.x86_64
安装 CMake 3.10.2:
1:cd ~
2:curl -L -O https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz
3:tar xf cmake-3.10.2.tar.gz
4:cd cmake-3.10.2
5:./bootstrap
如果遇到:
Error when bootstrapping CMake:
请先安装gcc
yum install gcc
yum install gcc-c++
6:make -j$(nproc)
7:make install
安装 Boost 1.66
1:cd ~
2:curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 > boost_1.66.0.tar.bz2
3:tar xf boost_1.66.0.tar.bz2
4:echo "export BOOST_ROOT=$HOME/boost_1_66_0" >> ~/.bash_profile
5:source ~/.bash_profile
6:cd boost_1_66_0/
7:./bootstrap.sh "--prefix=$BOOST_ROOT"
8:./b2 install
安装 MongoDB (mongodb.org)
1:mkdir ${HOME}/opt
2:cd ${HOME}/opt
3:curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz
4:tar xf mongodb-linux-x86_64-amazon-3.6.3.tgz
5:rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz
6:ln -s ${HOME}/opt/mongodb-linux-x86_64-amazon-3.6.3/ ${HOME}/opt/mongodb
7:mkdir ${HOME}/opt/mongodb/data
8:mkdir ${HOME}/opt/mongodb/log
9:touch ${HOME}/opt/mongodb/log/mongod.log
tee > /dev/null ${HOME}/opt/mongodb/mongod.conf <<mongodconf
systemLog:
destination: file
path: ${HOME}/opt/mongodb/log/mongod.log
logAppend: true
logRotate: reopen
net:
bindIp: 127.0.0.1,::1
ipv6: true
storage:
dbPath: ${HOME}/opt/mongodb/data
mongodconf
10:export PATH=${HOME}/opt/mongodb/bin:$PATH
11:mongod -f ${HOME}/opt/mongodb/mongod.conf
安装 mongo-cxx-driver (release/stable)
1:cd ~
2:curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz
3:tar xf mongo-c-driver-1.9.3.tar.gz
4:cd mongo-c-driver-1.9.3
5:./configure --enable-ssl=openssl --disable-automatic-init-and-cleanup --prefix=/usr/local
6:make -j$( nproc )
7:make install
8:git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/stable --depth 1
9:cd mongo-cxx-driver/build
10:cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
11:make -j$( nproc )
安装 secp256k1-zkp (Cryptonomex branch):
1:cd ~
2:git clone https://github.com/cryptonomex/secp256k1-zkp.git
3:cd secp256k1-zkp
4:./autogen.sh
5:./configure
6:make -j$(nproc)
7:make install
By default LLVM and clang do not include the WASM build target, so you will have to build it yourself:
1:mkdir ~/wasm-compiler
2:cd ~/wasm-compiler
3:git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
4:cd llvm/tools
5:git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
6:cd ..
7:mkdir build
8:cd build
9:cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DLLVM_ENABLE_RTTI=1 -DCMAKE_BUILD_TYPE=Release ../
10:make -j$(nproc)
11:make install