diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-14 21:16:08 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-14 21:16:08 +0800 |
commit | 009b70f5b218a1ccb154034936256308131b7d9c (patch) | |
tree | cd9642a8d3323c9e80da54ac4e8fc40ade9f9020 /packages/deployer/README.md | |
parent | f7c1e10b5ac112866ee55e7fededdb37c890d30f (diff) | |
parent | 3f3e8be004818ddaa1921b3dff12bdd46052278b (diff) | |
download | dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar.gz dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar.bz2 dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar.lz dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar.xz dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.tar.zst dexon-sol-tools-009b70f5b218a1ccb154034936256308131b7d9c.zip |
Merge branch 'development' into convertScriptsToTs
* development: (71 commits)
Transform input data before encoding for callAsync and getABIEncodedTransactionData
Update coverage badge to show development coverage
Configure post build hook
Notify coveralls after all tasks have finished
Address feedback
Revert "Report all coverage reports together"
Separate published packages and typescript typings on README
Report all coverage reports together
Add other statement types
Properly and consistently parse ENV vars
Add forgotten file
Start using solidity-parser-antlr
Fix the default always overriding to address
Submit a TD PR
Add an explanatory comment for making ranges unique
Fix a typo in handling env variables
Introduce TESTRPC_FIRST_ADDRESS
Make BlockchainLifecycle accept only web3Wrapper
Fix comments
Fix deployer CHANGELOG
...
# Conflicts:
# README.md
# packages/deployer/package.json
# packages/subproviders/src/globals.d.ts
# yarn.lock
Diffstat (limited to 'packages/deployer/README.md')
-rw-r--r-- | packages/deployer/README.md | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/packages/deployer/README.md b/packages/deployer/README.md index 4c4d234dd..9abcfa6fe 100644 --- a/packages/deployer/README.md +++ b/packages/deployer/README.md @@ -10,13 +10,14 @@ yarn add @0xproject/deployer ## Usage +### CLI Usage + ```bash node ./node_modules/@0xproject/deployer/lib/cli.js --help cli.js [command] Commands: cli.js compile compile contracts - cli.js migrate compile and deploy contracts using migration scripts cli.js deploy deploy a single contract with provided arguments Options: @@ -34,6 +35,34 @@ Options: --help Show help [boolean] ``` +### API Usage + +## Migrations + +You might want to write a migration scripts (similar to `truffle migrate`), that deploys multiple contracts and configures them. Below you'll find a simple example of such a script to help you get started. + +```typescript +import { Deployer } from '@0xproject/deployer'; +import * as path from 'path'; + +const deployerOpts = { + artifactsDir: path.resolve('src', 'artifacts'), + jsonrpcUrl: 'http://localhost:8545', + networkId: 50, + defaults: { + gas: 1000000, + }, +}; + +const deployer = new Deployer(deployerOpts); + +(async () => { + const etherToken = await deployer.deployAndSaveAsync('WETH9'); +})().catch(console.log); +``` + +A more sophisticated example can be found [here](https://github.com/0xProject/0x-monorepo/tree/development/packages/contracts/migrations) + ## Contributing We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. |