Ubuntu系统搭建以太坊框架总结

OS系统:Ubuntu16.04

1,安装依赖,g++安装(GNU的c & c++编译器),libssl-dev是OpenSSL通用库,OpenSSL是广泛使用的商业级SSL工具,SSL使用私钥加密传输的数据,防止被窃听。

  apt-get install g++
  apt-get install libssl-dev

2,安装nodejs

root@VM-0-7-ubuntu:/home# mkdir nodejs
root@VM-0-7-ubuntu:/home# cd nodejs/
root@VM-0-7-ubuntu:/home/nodejs# wget https://nodejs.org/dist/v7.7.2/node-v7.7.2.tar.gz
root@VM-0-7-ubuntu:/home/nodejs# ls
node-v7.7.2.tar.gz
root@VM-0-7-ubuntu:/home/nodejs# tar xvf node-v7.7.2.tar.gz 
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# ./configure 
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# make
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# make install
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# cp /usr/local/bin/node /usr/sbin/
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# node -v
v7.7.2
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# npm -v
4.1.2

3,安装solc(Solidity命令行编译器)

root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# npm install -g solc
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# sudo npm install -g solc-cli
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# solcjs --help //solc和solc-cli安装成功
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# apt-get update
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# apt-get install solc
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# add-apt-repository ppa:ethereum/ethereum
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# apt-get update
root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++

4,安装testrpc(testrpc是在本地使用内存模拟的一个以太坊环境)

root@VM-0-7-ubuntu:/home/nodejs/node-v7.7.2# npm install -g ethereumjs-testrpc
+ [email protected]
added 337 packages from 279 contributors in 77.808s

root@VM-0-7-ubuntu:/home# testrpc
EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2)

Available Accounts
==================
(0) 0x0286caf1fbc03d9c1e09cd51c0d2e7ac5a40b381
(1) 0xee9bee3a09111bb27a2f181cf570d8279bb172e7
(2) 0x1548a0705ebe05769911325dc70c0110b92f444a
(3) 0xcef900426f0213fcc99804b705d814dd5511c03a
(4) 0x40ef2e5eb1025e74e28b4c57a6e3ee8803310bd2
(5) 0x6c8b08b85785fcdfac32aa381f511ea9003cb54c
(6) 0x497142639065473ba88cdec39ba6e8516bbef0cf
(7) 0xf69dfd017371d84da03282f0f2432dfb36707ff0
(8) 0xf21888074865910c73e46d289666703037e82848
(9) 0xf43c375d4744dbf2ff31cbeff24d618e6304f7e0

Private Keys
==================
(0) 9e7aff09a1a51e3cfa482763af2ed7e38fc05b1baf7b4a60283dba2bab3ab320
(1) 87afad00df0b700d53302b678a30725b89fb506abc6dc7d19af2655e59401ef5
(2) 3dd853dc9358076e10cbf246853b4415a5ccf67491013de16ee2173cbc3ad112
(3) a2a26de78ed7234d7078da83a6b1d8b5e6fedef2b6ac54e3038337b61d8c36a9
(4) d9090d5082feb9c2043651ffb6dd8b785f04c7a1f6d21c60098a34b649178f17
(5) 3dd6ea62bce2aaea0d1edf022965041a265a506853108a6f6b54cac0463f5452
(6) 3b0d348d982d2e6b341eb78fc7597d4f4e83cd8e574e4df9104e2b2b4f2233eb
(7) 17aaf8f44d8ec251153152ea5d690c731ca80dbf21f34dcc78c8f2cd80962501
(8) 8369ef5d9eab0dc7b5bf44ede7ee78507dcdb3aa4e58b1b9683e006f75ff8a07
(9) dbc90b387e61ce82d1c49bf802fb1e1214f647aba078942c7d5163bdeba0f573

HD Wallet
==================
Mnemonic:      unique slender axis code neglect unhappy nut style hedgehog gown shadow     already
Base HD Path:  m/44'/60'/0'/0/{account_index}

Listening on localhost:8545

5,安装truffle(truffle是本地的用来编译、部署智能合约的工具)

root@VM-0-7-ubuntu:/home# npm install -g truffle
root@VM-0-7-ubuntu:/home# truffle version
Truffle v4.1.11 (core: 4.1.11)
Solidity v0.4.24 (solc-js)

6,安装Geth(geth是真正的以太坊环境)

root@VM-0-7-ubuntu:/home# sudo apt-get install software-properties-common
root@VM-0-7-ubuntu:/home# sudo add-apt-repository -y ppa:ethereum/ethereum
root@VM-0-7-ubuntu:/home# sudo apt-get update
root@VM-0-7-ubuntu:/home# sudo apt-get install ethereum

你可能感兴趣的:(Ubuntu系统搭建以太坊框架总结)