当前位置: 首页 > news >正文

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





相关文章:

  • 2.windows下安装git
  • 【Java】List转化为数组
  • HyperLedger Fabric ChainCode开发——shim.ChaincodeStubInterface用法
  • python之元组
  • lsyncd实时同步搭建指南——取代rsync+inotify
  • 互相牵制的能力
  • 正则介绍_grep
  • J2EE
  • 编写按键驱动以及在framework层上报按键事件
  • sed工具
  • 【.Net边角料系列】1-单例模式(我真不是你想的那样)
  • 【CodeForces】713 C. Sonya and Problem Wihtout a Legend
  • Python处理CSV,Excel,PDF和图片
  • 如何保障研发质量不踩坑?阿里技术专家教你几招
  • 小型公司案例 -- 局域网故障排查
  • SegmentFault for Android 3.0 发布
  • 2018天猫双11|这就是阿里云!不止有新技术,更有温暖的社会力量
  • conda常用的命令
  • FineReport中如何实现自动滚屏效果
  • Gradle 5.0 正式版发布
  • JavaScript实现分页效果
  • Meteor的表单提交:Form
  • Netty+SpringBoot+FastDFS+Html5实现聊天App(六)
  • php ci框架整合银盛支付
  • Redash本地开发环境搭建
  • 创建一个Struts2项目maven 方式
  • 记录一下第一次使用npm
  • 技术:超级实用的电脑小技巧
  • 那些被忽略的 JavaScript 数组方法细节
  • 使用agvtool更改app version/build
  • 世界编程语言排行榜2008年06月(ActionScript 挺进20强)
  • 王永庆:技术创新改变教育未来
  • 学习Vue.js的五个小例子
  • 终端用户监控:真实用户监控还是模拟监控?
  • raise 与 raise ... from 的区别
  • 分布式关系型数据库服务 DRDS 支持显示的 Prepare 及逻辑库锁功能等多项能力 ...
  • %@ page import=%的用法
  • (01)ORB-SLAM2源码无死角解析-(56) 闭环线程→计算Sim3:理论推导(1)求解s,t
  • (9)STL算法之逆转旋转
  • (八)c52学习之旅-中断实验
  • (差分)胡桃爱原石
  • (二)linux使用docker容器运行mysql
  • (二)构建dubbo分布式平台-平台功能导图
  • (附源码)springboot 个人网页的网站 毕业设计031623
  • (附源码)计算机毕业设计SSM基于java的云顶博客系统
  • (附源码)计算机毕业设计SSM智能化管理的仓库管理
  • (力扣记录)235. 二叉搜索树的最近公共祖先
  • (六)什么是Vite——热更新时vite、webpack做了什么
  • (转)mysql使用Navicat 导出和导入数据库
  • (转)真正的中国天气api接口xml,json(求加精) ...
  • (转)总结使用Unity 3D优化游戏运行性能的经验
  • (转载)VS2010/MFC编程入门之三十四(菜单:VS2010菜单资源详解)
  • . Flume面试题
  • .MSSQLSERVER 导入导出 命令集--堪称经典,值得借鉴!
  • .mysql secret在哪_MySQL如何使用索引