[testrpc 以太坊 区块链 开发环境]
一、安装truffle+testrpc开发和测试环境。truffle是开发环境,testrpc是测试环境。
1、安装环境时需要git
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get install git
2、nodejs环境
apt-get install nodejs
apt-get install npm
其中npm是nodejs的包管理器
nodejs版本升级
npm install -g n
n stable
3、安装truffle
npm install -g truffle
truffle version
4、安装web3的testrpc
npm install -g ethereumjs-testrpc
npm install -g web3@0.20.1
二、环境测试
1、下载
cd workspace
truffle unbox webpack
2、编译
truffle compile
truffle migrate
编译报错,修改 truffle.js:
module.exports = {
// See
// to customize your Truffle configuration!
networks: {
development: {
host: "localhost",
port: 7545,
network_id: "*" // 匹配任何network id
}
}
};
npm run dev
范例: http://localhost:8080
--------------------------------------
https://blog.youkuaiyun.com/Lian_Dao/article/details/74908778
https://blog.youkuaiyun.com/jiyilanzhou/article/details/79491665
https://ethfans.org/posts/a-gentle-introduction-to-ethereum-programming-part-1