ubuntu16.10安装EOS Dawn1.0 (踩坑版)
前两天一直在折腾安装EOS.IO,在MAC安装不成功后,又在Ubuntu16.10上折腾。按照EOS官方GitHub安装总是出错,自己从头编译安装也出错。
出错原因主要是安装wasm-compiler不成功,另外secp256k1安装到最后make install必须加sudo
wasm-compiler安装不成功的原因主要是在安装wasm-compiler之前必须先安装binaryen
#从新安装ubuntu16.10安装EOS Dawn1.0
命令来安装EOS
打开以下文件:
sudo vim /etc/apt/sources.list
将以下行添加到文件的底部:
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main
运行下面的命令。用你自己的替换git用户信息。
注意:建议一次运行一个命令,以便捕捉到可能出现错误的确切命令(至少是第一次,如果它工作正常,可以随便将命令作为脚本运行安装)。
注2:运行所有这些命令将需要几个小时。其中许多命令需要很长时间才能完成。
注3:如果系统中没有至少4个内核,请将以下-j4替换为与核心数相匹配的编号(例如-j1,-j2或-j3)。
sudo apt-get install git
git config --global user.name "John Doe"
git config --global user.email "[email protected]"
git config --list
sudo apt-get update
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get install clang-4.0 lldb-4.0 cmake make
libbz2-dev libssl-dev libgmp3-dev
autotools-dev build-essential
libbz2-dev libicu-dev python-dev
autoconf libtool git
cd ~
wget -c 'https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2/download' -O boost_1.64.0.tar.bz2
tar xjf boost_1.64.0.tar.bz2
cd boost_1_64_0/
echo "export BOOST_ROOT=$HOME/opt/boost_1_64_0" >> ~/.bash_profile
source ~/.bash_profile
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
source ~/.bash_profile
cd ~
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
cd ~
git clone https://github.com/WebAssembly/binaryen.git
cd ~/binaryen
git checkout tags/1.37.14
cmake . && make
echo "export BINARYEN_ROOT=~/binaryen" >> ~/.bash_profile
source ~/.bash_profile
mkdir ~/wasm-compiler
cd ~/wasm-compiler
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
cd llvm/tools
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
cd ..
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
make -j4 install
cd ~
git clone https://github.com/eosio/eos --recursive
mkdir -p ~/eos/build && cd ~/eos/build
cmake -DCMAKE_BUILD_TYPE=Debug -DBINARYEN_BIN=~/binaryen/bin -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
make -j4
验证EOS安装是否成功
本节直接从EOS.io文档中取出,因为它非常清楚您如何验证安装。只要确保genesis.json是按照下面的指示进行编辑的,并且确保没有复制设置存在于genesis.json文件中:
创建并启动单节点测试网
#在成功构建项目之后,eosd二进制文件应该存在于build / programs / eosd目录中。继续运行eosd - 它可能会退出并显示一个错误,但如果没有,立即用Ctrl-C关闭它。请注意,eosd创建了一个名为data-dir的目录,其中包含默认配置(config.ini)和其他一些内部信息。这个默认的数据存储路径可以通过传递--data-dir / path / to / data到eosd来覆盖。
#编辑config.ini文件,将以下设置添加到已有的默认设置中:
genesis-json = /path/to/eos/source/genesis.json
enable-stale-production = true
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
Load the block producer plugin, so you can produce blocks
plugin = eosio::producer_plugin
Wallet plugin
plugin = eosio::wallet_api_plugin
As well as API and HTTP plugins
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
#现在应该可以运行eosd,看到它开始生产块。
#运行时eosd,应该得到类似于下面的日志消息。这意味着块已经成功生产。
1575001ms thread-0 chain_controller.cpp:235 _push_block ] initm #1 @2017-09-04T04:26:15 | 0 trx, 0 pending, exectime_ms=0
1575001ms thread-0 producer_plugin.cpp:207 block_production_loo ] initm generated block #1 @ 2017-09-04T04:26:15 with 0 trxs 0 pending
1578001ms thread-0 chain_controller.cpp:235 _push_block ] initc #2 @2017-09-04T04:26:18 | 0 trx, 0 pending, exectime_ms=0
1578001ms thread-0 producer_plugin.cpp:207 block_production_loo ] initc generated block #2 @ 2017-09-04T04:26:18 with 0 trxs 0 pending
...
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://steemit.com/eos/@james84/3bnxc5-installing-eos-dawn-1-1-on-an-ubuntu-16-10-vm-using-virtualbox
Congratulations @poach! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes received
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Congratulations @poach! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard:
Congratulations @poach! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!