基于Ubuntu 16.04
更新nodejs到最新
sudo npm install -g n
sudo n stable
(模拟接入以太坊)ganache
命令行版
sudo npm install -g ganache-cli
Gui版
truffleframework.com/ganache下载
可以看到部署好了环境
Contracts:放入你的合约文件
Migrations:部署脚本
Test:测试文件夹
Truffle.js/truffle-config.js:truffle配置文件
也可以使用测试用例:
mkdir metacoin
truffle unbox metacoin
这是一个虚拟货币的例子
配置项目:
2. 将IP和端口配置到truffle.js
运行项目
truffle compile #编译
truffle migrate #部署到ganache
truffle test #执行测试脚本
、