Skip to content
Develop DApps on CITA
Branch: master
Clone or download
zengbing15 Merge pull request #33 from timmyz/fix-readme
replace the git clone url `appchain` to `cita`
Latest commit 1cfb6d4 May 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts
migrations fix:set the compiler solc version for given sample;update to new cita… Mar 4, 2019
.gitignore
LICENSE Create LICENSE Aug 14, 2018
README-CN.md replace the git clone url to May 16, 2019
README.md replace the git clone url to May 16, 2019
box-img-lg.png
box-img-sm.png
package.json fix: make deployment work on cita v0.19 Apr 9, 2019
truffle-box.json update: change name Aug 6, 2018
truffle-config.js fix: make deployment work on cita v0.19 Apr 9, 2019
truffle.js
yarn.lock

README.md

CITAHub

CITA-Truffle-Box

English | 简体中文

CITA-Truffle-Box is based on truffle-box to develop and used for developing DApps on CITA. Please refer toour document for more details about CITA.

Notice: This project rewrite truffle migrate part of truffle-box, please read truffle-tutorial first, especially RUNNING MIGRATIONS part.

Installation

  1. Install Truffle globally

To use CITA-Truffle-Box, please install truffle.

yarn global add truffle
  1. Download
git clone https://github.com/cryptape/cita-truffle-box.git
cd cita-truffle-box/
rm -rf .git
yarn install

Configuration

You can configure your box in truffle.js.

The configure options are shown below.

module.exports = {
  networks: {
    development: {
      host: 'ip_address', // eg. '121.196.200.225'
      port: 'port', // eg. 1337
      network_id: '*', // Use '*' to match any network id
      privateKey: 'private key', // a string, required
      // the following parameters are OPTIONAL
      // validUntilBlock: 999999, // an int,  default to (current block number)+88
      // nonce: '999', // a string, default to random int
      // quota: 999999, // an int, defaut to 999999
    }, // you can add other network after here
  },
}

networks

You must use 'development' as the key for now.

  • host[required]
    Specify the host ip_address, don't add protocol name.

  • port[required]
    Specify the host port.

  • network_id[required]
    In order to be compatible with truffle, you have to set this attribute, but it's meaningless here.

  • privateKey [required]
    Your private key for sending transaction.

  • nonce [optional]
    Nonce is a string used to prevent double-spending, default to be a random number from 1 ~ 100. Note that the type of nonce is string.

  • quota [optional]
    Similar to gas in ethereum, default value is 99999.

  • validUntilBlock [optional]
    Similar to timeout, default to be current block height + 88

Compile

Compile the smart contract.

truffle compile

Migration

First, add your migration scripts in /migration, for the details, please refer RUNNING MIGRATIONS for more details.

Input the command to do migration. (Note that we can NOT use truffle migrate command here...)

yarn migrate
You can’t perform that action at this time.