BCOS安装实践Ubuntu版本

系统版本:Ubuntu16.04.4

① 安装nodejs(安装后版本nodejs版本大于6)、babel-node环境

方案一:参考网站:http://blog.csdn.net/weibo392/article/details/77368550
方案二:更新ubuntu软件源
sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
安装nodejs
sudo apt-get install nodejs
sudo apt install nodejs-legacy
sudo apt install npm
更新npm的包镜像源,方便快速下载
sudo npm config set registry https://registry.npm.taobao.org
sudo npm config list
全局安装n管理器(用于管理nodejs版本)
sudo npm install n -g
安装最新的nodejs(stable版本)
sudo n stable
sudo node -v
sudo npm install -g babel-cli babel-preset-es2017
echo '{ "presets": ["es2017"] }' > ~/.babelrc
 
   
  

QA

Q: apt-get update找不到文件

 
  
W: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can 't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. // A: 修改node相关文件:/etc/apt/sources.list.d/chris-lea-ubuntu-node_js-xenial.list deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu trusty main deb-src http://ppa.launchpad.net/chris-lea/node.js/ubuntu trusty main

② 安装智能合约solidity编译器 方式一:直接下载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
③ 安装控制台

sudo npm install -g ethereum-console

获取源代码

git clone https://github.com/bcosorg/bcos.git

编译前准备

①安装cmake

官网下载cmake-3.6.3.tar.gz(https://cmake.org/download/)

1.解压文件tar -xvf cmake-3.6.3.tar.gz,并修改文件权限chmod -R 777 cmake-3.6.3
2.检测gcc和g++是否安装,如果没有则需安装gcc-g++:sudo apt-get install build-essential(或者直接执行这两条命令sudo apt-get install gcc,sudo apt-get install g++)
3.进入cmake-3.6.3 进入命令 cd cmake-3.6.3
4.执行sudo ./bootstrap 
5.执行sudo make 
6.执行 sudo make install 
7.执行 cmake –version,返回cmake版本信息,则说明安装成功
② 安装依赖的开发库

sudo yum install -y openssl openssl-devel
chmod +x bcos源码路径/scripts/install_deps.sh
bcos源码路径/scripts/install_deps.sh

编译可执行程序



 
 

你可能感兴趣的:(BCOS)