TAGS

cita-truffle-box

CREATED

UPDATED

STARS

INSTALL

...

REPOSITORY
GitHub Download
Please wait: Fetching readme...

b"[![CITAHub](https://img.shields.io/badge/made%20for-CITAHub-blue.svg)](https://www.citahub.com/)\n\n# CITA-Truffle-Box\n\nEnglish | [\xe7\xae\x80\xe4\xbd\x93\xe4\xb8\xad\xe6\x96\x87](./README-CN.md)\n\nCITA-Truffle-Box is based on [truffle-box](https://github.com/truffle-box) to develop and used for developing DApps on CITA.\nPlease refer to[our document](https://docs.citahub.com/en-US/cita/cita-intro) for more details about CITA.\n\n>Notice: This project rewrite truffle migrate part of [truffle-box](https://github.com/truffle-box), please read truffle-tutorial first, especially [RUNNING MIGRATIONS ](https://truffleframework.com/docs/truffle/getting-started/running-migrations) part.\n\n## Installation\n\n1. Install Truffle globally\n\nTo use CITA-Truffle-Box, please install truffle.\n```shell\nyarn global add truffle\n```\n\n2. Download\n\n```shell\ngit clone https://github.com/cryptape/cita-truffle-box.git\ncd cita-truffle-box/\nrm -rf .git\nyarn install\n```\n\n\n## Configuration\n\nYou can configure your box in `truffle.js`.\n\nThe configure options are shown below.\n\n```js\nmodule.exports = {\n networks: {\n development: {\n host: 'ip_address', // eg. '121.196.200.225'\n port: 'port', // eg. 1337\n network_id: '*', // Use '*' to match any network id\n privateKey: 'private key', // a string, required\n // the following parameters are OPTIONAL\n // validUntilBlock: 999999, // an int, default to (current block number)+88\n // nonce: '999', // a string, default to random int\n // quota: 999999, // an int, defaut to 999999\n }, // you can add other network after here\n },\n}\n```\n\n### networks\n\nYou must use 'development' as the key for now.\n\n* `host`[required] \nSpecify the host ip_address, don't add protocol name.\n\n* `port`[required] \nSpecify the host port.\n\n* `network_id`[required] \nIn order to be compatible with truffle, you have to set this attribute, but it's meaningless here.\n\n* `privateKey` [required] \nYour private key for sending transaction.\n\n* `nonce` [optional] \n Nonce is a string used to prevent double-spending, default to be a random number from 1 ~ 100.\n Note that the type of `nonce` is string.\n\n* `quota` [optional] \n Similar to gas in ethereum, default value is 99999.\n\n* `validUntilBlock` [optional] \n Similar to timeout, default to be `current block height + 88`\n\n## Compile\nCompile the smart contract.\n```\ntruffle compile\n```\n\n## Migration\n\nFirst, add your migration scripts in `/migration`, for the details, please refer [RUNNING MIGRATIONS](https://truffleframework.com/docs/truffle/getting-started/running-migrations) for more details.\n\nInput the command to do migration. (Note that we can **NOT** use `truffle migrate` command here...)\n```\nyarn migrate\n```\n"