Ethereum,中文翻译是“以太坊”,是一个公有区块链的开源项目。因为以太坊是基于P2P网络所以没有中心节点,所以用户仅安装Ethereum客户端即可连入Ethereum公共网络或者在自己的testnet下运行Ethereum。
以太坊客户端有很多语言的版本。
本文选用的是C++版本。配置过程如下:
参考:http://ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/index.html#installing-and-building
环境:Ubuntu15.10 x64
1. 安装“eth”命令行工具
sudo add-apt-repository ppa:ethereum/ethereum-qt sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install cpp-ethereum
2. 安装Mix IDE(可选)
sudo apt-get install mix-ide mix-ide
3. 获取源码
git clone --recursive https://github.com/ethereum/webthree-umbrella.git
这个工程中可能会因为网络原因模块下载出错。一种比较笨的办法是删除下载webthree-umbrella目录,重新运行上面git clone命令
4. 配置编译环境
sudo apt-get -y update sudo apt-get -y install language-pack-en-base sudo dpkg-reconfigure locales sudo apt-get -y install software-properties-common
sudo add-apt-repository "deb http://llvm.org/apt/wily/ llvm-toolchain-wily-3.7 main" wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get -y update sudo apt-get -y install llvm-3.7-dev
sudo add-apt-repository -y ppa:ethereum/ethereum-qt sudo add-apt-repository -y ppa:ethereum/ethereum sudo add-apt-repository -y ppa:ethereum/ethereum-dev sudo apt-get -y update //sudo apt-get -y upgrade //官方教程中这一步会更新系统,去掉此命令
sudo apt-get -y install build-essential git cmake libboost-all-dev libgmp-dev libleveldb-dev libminiupnpc-dev libreadline-dev libncurses5-dev libcurl4-openssl-dev libcryptopp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev libedit-dev mesa-common-dev ocl-icd-libopencl1 opencl-headers libgoogle-perftools-dev qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libqt5webengine5-dev ocl-icd-dev libv8-dev libz-dev sudo apt-get -y install libjsonrpccpp-dev sudo apt-get -y install qml-module-qtquick-controls qml-module-qtwebengine
5. 编译
mkdir build cd build cmake .. make (or) make -j <number> //Execute makefile with multiple cores in parallel
6. 测试
在终端运行eth命令就会开始启动cpp-ethereum客户端
namenode@namenodeIn1035:~/Code/ethereum$ eth
(忘截图了,用下载区块的图代替吧-_-)