Installation

$ npm install -g truffle

Choose ethereum client (Ganache OR truffle build in `truffle develop`)

https://www.trufflesuite.com/docs/truffle/reference/choosing-an-ethereum-client

Creating a project

$ mkdir truffle-hello

$ cd truffle-hello

$ truffle init  # without default contract

OR

$ truffle unbox <box-name>  # box-name like MetaCoin

Compiling Contracts

$ truffle compile  # all placed in build/contracts/, dot not edit these .json files

Running Migrations

$ truffle migrate [--reset]  # run scripts that located in migrations/,Be sure have Ganache installed and running, default choose Ganache network

Deployer https://www.trufflesuite.com/docs/truffle/getting-started/running-migrations#deployer

Testing Contracts

$ truffle test [./tests/hello.js]  # NOTE:  default network is 'development', so truffle-config.js network configuration need to match the Ganache host and port

Writing tests in javascript

$ truffle test

https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript

Another tool, openzeppelin/cli 开发, 部署, 升级智能合约

demo: https://github.com/farwish/truffle-hello.git

docs:https://www.trufflesuite.com/docs/truffle/getting-started/installation

link:https://www.cnblogs.com/farwish/p/12310551.html

[Contract] Truffle 使用流程的更多相关文章

  1. Mac下基于testrpc和truffle的以太坊智能合约开发环境搭建

    原文地址:石匠的blog truffle是一个基于Javascript开发的一套智能合约开发框架,使用Solidity语言编写合约.truffle有一套自动的项目构建机制,集成了开发,测试和部署的各个 ...

  2. BOOM -- 智能合约编程

    译注:原文首发于ConsenSys开发者博客,原作者为Eva以及ConsenSys的开发团队.如果您想要获取更多及时信息,可以访问ConsenSys首页点击左下角Newsletter订阅邮件.本文的翻 ...

  3. Truffle Smart Contract Error: Invalid number of parameter

      I followed the tutorial of quorum with truffle: https://truffleframework.com/tutorials/building-da ...

  4. Truffle框架环境搭建

    注意:本教程需要Truffle4.0或者是更高的版本 以太坊的智能合约只是代码,和我们的纸质代码不同,此合同需要非常精确的方式理解 如果合同编码不正确,我们的交易可能会失败,会导致gas的损失,更不用 ...

  5. 用Solidity在Truffle上构建一个HelloWorld智能合约

    原文地址:石匠的blog Truffle的环境安装在前文已经整理,这次用Solidity在Truffle写一个HelloWorld以太坊智能合约,并在testrpc上进行测试.当前的软件版本信息如下: ...

  6. truffle框架快速开发合约步骤

    矩阵元区块链智能合约开发指南 1 适用范围 本规范描述了矩阵元区块链系统智能合约的开发约束与规范,用以指导DAPP开发者按照本规范开发基于矩阵元区块链运行的应用. 2 术语解释 术语 术语解释 DAP ...

  7. Android应用层View绘制流程与源码分析

    1  背景 还记得前面<Android应用setContentView与LayoutInflater加载解析机制源码分析>这篇文章吗?我们有分析到Activity中界面加载显示的基本流程原 ...

  8. 10,SFDC 管理员篇 - 流程自动化

    1,Process Builder Setup | Build | Create | Workflow & Approvals | Process Builder 当我们在对象中创建或者修改一 ...

  9. App开发到App Store上架,发布流程。

     http://blog.csdn.net/wojsg001/article/details/12005887 App开发到App Store上架,发布流程. 分类: IOS2013-09-25 11 ...

  10. Yii处理流程

    Yii的应用程序处理流程 用户访问URL http://www.example.com/blog/index.php?r=site/contact 1.入口脚本被网站服务器执行以处理此请求. 2.一个 ...

随机推荐

  1. Linux进程管理、安全

    1.介绍 1.什么是进程 比如: 开发写的代码我们称为程序,那么将开发的代码运行起来.我们称为进程. 总结一句话就是: 当我们运行一个程序,那么我们将运行的程序叫进程. PS1: 当程序运行为进程后, ...

  2. 记录--Vue3 封装 ECharts 通用组件

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 按需导入的配置文件 配置文件这里就不再赘述,内容都是一样的,主打一个随用随取,按需导入. import * as echarts from ...

  3. WPF 图片锯齿解决办法(保证解决!!!)

    无非几个属性统统加上,不能解决我倒立洗头,日五档电风扇 RenderOptions.BitmapScalingMode="HighQuality" UseLayoutRoundin ...

  4. 如何使用 JavaScript 导入和导出 Excel

    前言 在现代的Web应用开发中,与Excel文件的导入和导出成为了一项常见而重要的任务.无论是数据交换.报告生成还是数据分析,与Excel文件的交互都扮演着至关重要的角色.本文小编将为大家介绍如何在熟 ...

  5. java通过jsch使用sftp连接linux处理文件

    1.Maven依赖 <!--Java连接Linux服务器依赖--> <dependency> <groupId>com.jcraft</groupId> ...

  6. AABO:自适应Anchor设置优化,性能榨取的最后一步 | ECCV 2020 Spotlight

    论文提出超参数优化方法AABO,该方法核心基于贝叶斯优化和Sub-Sample方法,能够自适应的搜索最优的anchor设置.从实验结果来看,AABO能够仅通过anchor设置优化,为SOTA目标检测方 ...

  7. #轮廓线dp#洛谷 1879 [USACO06NOV]Corn Fields G

    题目 分析 考虑状压dp在\(n\leq 21\)的情况下会TLE, 设\(dp[n][m][S]\)表示当前正在处理\((n,m)\)这个格子 并且轮廓线状态为\(S\)的方案数, 考虑可行状态最多 ...

  8. 7. The Singular Value Decomposition(SVD)

    7.1 Singular values and Singular vectors The SVD separates any matrix into simple pieces. A is any m ...

  9. Nacos无法连接wsl2上部署的MySQL

    情况描述 在部署Nacos时,需要连接MySQL数据库管理数据,但是如果连接的是wsl2上部署的MySQL,使用127.0.0.1或者localhost,通常会出现如下错误: org.springfr ...

  10. Qt 实现涂鸦板二:实现放大功能

    在一的基础上改造: .h 文件 #pragma once #include <QtWidgets/QWidget> #include "ui_xuexi.h" #inc ...