Skip to content

Latest commit

 

History

History
39 lines (35 loc) · 859 Bytes

README.md

File metadata and controls

39 lines (35 loc) · 859 Bytes

truffle-tutorial

truffle tutorial

Truffle

How to

Create a project

  1. Create a new directory for your Truffle project:
mkdir MetaCoin
cd MetaCoin    

初始化

  • truffle init

启动本地环境

  • ganache-cli

Compile contracts

truffle compile 
# Recompile, overwriting all previously compiled files
truffle compile --all

deploy a contract

Filename: 4_example_migration.js

var MyContract = artifacts.require("MyContract");

module.exports = function(deployer) {
  // deployment steps
  deployer.deploy(MyContract);
};
truffle migrate 
# run all your migrations from the beginning
truffle migrate --reset

Note that the filename is prefixed with a number and is suffixed by a description. The numbered prefix is required in order to record whether the migration ran successfully.