diff --git a/libs/remix-simulator/bin/ethsim b/libs/remix-simulator/bin/ethsim index a6f56641ee..607cabbe9c 100755 --- a/libs/remix-simulator/bin/ethsim +++ b/libs/remix-simulator/bin/ethsim @@ -20,18 +20,21 @@ program }) program - .option('-p, --port [port]', 'specify port') - .option('-b, --ip [host]', 'specify host') - .option('-c, --coinbase [coinbase]', 'specify host') - .option('--rpc', 'run rpc server only') - .option('--details', 'display payloads for every requests and their responses') - .parse(process.argv) + .command('start') + .option('-p, --port [port]', 'specify port', 8545) + .option('-b, --ip [host]', 'specify host', '127.0.0.1') + .option('-c, --coinbase [coinbase]', 'specify coinbase', '0x0000000000000000000000000000000000000000') + .option('--rpc', 'run rpc server only', true) + .option('--details', 'display payloads for every requests and their responses', false) + .action(() => { + const Server = require('../src/server') + const server = new Server({ + coinbase: program.coinbase, + rpc: program.rpc, + logDetails: program.details + }) + server.start(program.host, program.port) + }) -const Server = require('../src/server') -const server = new Server({ - coinbase: program.coinbase || "0x0000000000000000000000000000000000000000", - rpc: program.rpc, - logDetails: program.details -}) -server.start(program.host || '127.0.0.1', program.port || 8545) +program.parse(process.argv) diff --git a/package.json b/package.json index b9bb6e82cd..304369daab 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "nightwatch_local_providers": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/providers.test.js --env=chromeDesktop", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "remixd": "nx build remixd && chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js --remix-ide http://127.0.0.1:8080", + "simulator": "nx build remix-simulator && chmod +x dist/libs/remix-simulator/bin/ethsim && dist/libs/remix-simulator/bin/ethsim start --rpc", "selenium": "selenium-standalone start", "selenium-install": "selenium-standalone install", "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js",