forked from bcosorg/bcos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (44 loc) · 1.36 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# 一键安装脚本说明
#1 build.sh在centos和Ubuntu版本测试成功;
#2 所有Linux发行版本请确保yum和git已安装,并能正常使用;
#3 如遇到中途依赖库下载失败,一般和网络状况有关,请到https://github.com/bcosorg/lib找到相应的库,手动安装成功后,再执行此脚本
#
#!/bin/sh
#install nodejs
sudo yum install -y nodejs
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo cnpm install -g babel-cli babel-preset-es2017
echo '{ "presets": ["es2017"] }' > ~/.babelrc
#install solc
wget https://github.com/ethereum/solidity/releases/download/v0.4.13/solc-static-linux
sudo cp solc-static-linux /usr/bin/solc
sudo chmod +x /usr/bin/solc
#install console
sudo cnpm install -g ethereum-console
#install deps
sudo yum -y install cmake3
sudo yum install -y openssl openssl-devel
chmod +x scripts/install_deps.sh
./scripts/install_deps.sh
#build bcos
mkdir -p build
cd build/
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
cmake -DEVMJIT=OFF -DTESTS=OFF -DMINIUPNPC=OFF ..
else
cmake3 -DEVMJIT=OFF -DTESTS=OFF -DMINIUPNPC=OFF ..
fi
make -j2
make install
cd ..
cd ./tool
cnpm install
cd ..
cd ./systemcontractv2
cnpm install
if [ ! -f "/usr/local/bin/bcoseth" ]; then
echo 'bcoseth build fail!'
else
echo 'bcoseth build succ! path: /usr/local/bin/bcoseth'
fi