004 Ubuntu上安装truffle

truffle的网址:http://truffleframework.com/

1、安装条件

需要安装Nodejs5以上版本,安装请参考之前文章, http://blog.csdn.net/zxs9999/article/details/79029044

切换到root用户执行以下命令。

NodeJS 5.0+ recommended.

2、安装truffle

切换到root用户下执行以下命令

npm install -g truffle
运行结果

root@jack:~# npm install -g truffle
/usr/lib/nodejs/node-v9.3.0/bin/truffle -> /usr/lib/nodejs/node-v9.3.0/lib/node_modules/truffle/build/cli.bundled.js
+ truffle@4.0.4
updated 1 package in 14.889s
测试安装成功
root@jack:~# truffle --version
Truffle v4.0.4 - a development framework for Ethereum

Usage: truffle <command> [options]

Commands:
  init      Initialize new Ethereum project with example contracts and tests
  compile   Compile contract source files
  migrate   Run migrations to deploy contracts
  deploy    (alias for migrate)
  build     Execute build pipeline (if configuration present)
  test      Run Mocha and Solidity tests
  debug     Interactively debug any transaction on the blockchain (experimental)
  opcode    Print the compiled opcodes for a given contract
  console   Run a console with contract abstractions and commands available
  develop   Open a console with a local TestRPC
  create    Helper to create new contracts, migrations and tests
  install   Install a package from the Ethereum Package Registry
  publish   Publish a package to the Ethereum Package Registry
  networks  Show addresses for deployed contracts on each network
  watch     Watch filesystem for changes and rebuild the project automatically
  serve     Serve the build directory on localhost and watch for changes
  exec      Execute a JS module within this Truffle environment
  unbox     Unbox Truffle project
  version   Show version number and exit

See more at http://truffleframework.com/docs

3、创建新项目

mkdir myproject
cd myproject
truffle init
        生成目录结构说明

contracts/:  合同目录
migrations/: 可编写脚本的部署文件目录
test/:       用于测试的应用程序和合同的测试文件目录
truffle.js: Truffle配置文件
4、通过unbox下载项目

mkdir MetaCoin
cd MetaCoin
truffle unbox metacoin





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

周易宅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值