Ethereum是2.0版区块链的主流应用,它将区块链从电子货币(digital cash)中延伸出来,作为一个分布式数据库使用,成为共识系统中的基础支撑。Ethereum引入了“智能合约”的概念,使得基于Ethereum的区块链能够构建多样化的去中心化应用。
基本环境
- 操作系统
Ubuntu16.04 LTS - Ethereum版本
go-ethereum 1.5.4 - 编译后客户端程序
Geth,命令行程序。
PPA安装方法
官方文档中,提供了Ethereum提供了PPA安装发放,类似于Bitcoin开发环境搭建中Berkeley DB中的安装。
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
因为要搭建开发环境,所以就不尝试此方法了,我们用源码编译安装。
源码编译安装
Ethereum有多种版本、多种语言开发的客户端程序,此文采用Ethereum-Go,这个版本是官方主推的版本,是当前的应用主流。
- 下载源代码
git clone https://github.com/ethereum/go-ethereum
- 依赖环境
Ethereum Go是使用Go语言开发的,需要Go和C的编译器
sudo apt-get install -y build-essential golang
- 编译源码
cd go-ehtereum
make geth
如果需要编译全部的应用程序,执行make all
- 运行客户端
~:/build/bin/geth