aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/cli.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-03-12 10:19:39 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-03-12 10:37:30 +0800
commitc4a18ee64b58217dd9733c9b9edbfe592fc1cb8d (patch)
treee51b2242419174ae7e77a8eaea74918607be070e /packages/deployer/src/cli.ts
parent7143996d265cde74c473467439158ae557d9f8a8 (diff)
downloaddexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.gz
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.bz2
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.lz
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.xz
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.zst
dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.zip
Make Deployer configurable by jsonrpcUrl instead of jsonrpcPort
Diffstat (limited to 'packages/deployer/src/cli.ts')
-rw-r--r--packages/deployer/src/cli.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts
index 3b410e9f2..063366d47 100644
--- a/packages/deployer/src/cli.ts
+++ b/packages/deployer/src/cli.ts
@@ -13,7 +13,7 @@ const DEFAULT_OPTIMIZER_ENABLED = false;
const DEFAULT_CONTRACTS_DIR = path.resolve('src/contracts');
const DEFAULT_ARTIFACTS_DIR = path.resolve('src/artifacts');
const DEFAULT_NETWORK_ID = 50;
-const DEFAULT_JSONRPC_PORT = 8545;
+const DEFAULT_JSONRPC_URL = 'http://localhost:8545';
const DEFAULT_GAS_PRICE = (10 ** 9 * 2).toString();
const DEFAULT_CONTRACTS_LIST = '*';
@@ -36,7 +36,7 @@ async function onCompileCommand(argv: CliOptions): Promise<void> {
* @param argv Instance of process.argv provided by yargs.
*/
async function onDeployCommand(argv: CliOptions): Promise<void> {
- const url = `http://localhost:${argv.jsonrpcPort}`;
+ const url = argv.jsonrpcUrl;
const web3Provider = new Web3.providers.HttpProvider(url);
const web3Wrapper = new Web3Wrapper(web3Provider);
const networkId = await web3Wrapper.getNetworkIdAsync();
@@ -55,7 +55,7 @@ async function onDeployCommand(argv: CliOptions): Promise<void> {
};
const deployerOpts: DeployerOptions = {
artifactsDir: argv.artifactsDir,
- jsonrpcPort: argv.jsonrpcPort,
+ jsonrpcUrl: argv.jsonrpcUrl,
networkId,
defaults,
};
@@ -120,10 +120,10 @@ function deployCommandBuilder(yargsInstance: any) {
default: DEFAULT_ARTIFACTS_DIR,
description: 'path to write contracts artifacts to',
})
- .option('jsonrpc-port', {
- type: 'number',
- default: DEFAULT_JSONRPC_PORT,
- description: 'port connected to JSON RPC',
+ .option('jsonrpc-url', {
+ type: 'string',
+ default: DEFAULT_JSONRPC_URL,
+ description: 'url of JSON RPC',
})
.option('gas-price', {
type: 'string',