|
|
@ -23,22 +23,37 @@ program |
|
|
|
.command('start') |
|
|
|
.command('start') |
|
|
|
.option('-p, --port [port]', 'specify port', 8545) |
|
|
|
.option('-p, --port [port]', 'specify port', 8545) |
|
|
|
.option('-b, --ip [host]', 'specify host', '127.0.0.1') |
|
|
|
.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('--rpc', 'run rpc server only', true) |
|
|
|
.option('--details', 'display payloads for every requests and their responses', false) |
|
|
|
.option('--details', 'display payloads for every requests and their responses', false) |
|
|
|
.action((option) => { |
|
|
|
.option('-c, --coinbase [coinbase]', 'specify coinbase', '0x0000000000000000000000000000000000000000') |
|
|
|
console.log('coinbase: ', option.coinbase) |
|
|
|
.option('-f, --fork [fork]', 'specify fork name') |
|
|
|
|
|
|
|
.option('-n, --nodeUrl [nodeUrl]', 'specify node url') |
|
|
|
|
|
|
|
.option('-bn, --blockNumber [blockNumber]', 'specify block Number') |
|
|
|
|
|
|
|
.option('-s, --stateDb [stateDb]', 'specify state database') |
|
|
|
|
|
|
|
.option('-bs, --blocks [blocks]', 'specify blocks') |
|
|
|
|
|
|
|
.action((option, env) => { |
|
|
|
|
|
|
|
env.outputHelp() |
|
|
|
|
|
|
|
console.log('\n') |
|
|
|
|
|
|
|
console.log('Usage:') |
|
|
|
|
|
|
|
console.log('remix-simulator start') |
|
|
|
|
|
|
|
console.log('remix-simulator start -n <node url> -f cancun -bn latest') |
|
|
|
|
|
|
|
console.log('\n') |
|
|
|
|
|
|
|
console.log('Command line options:') |
|
|
|
|
|
|
|
console.log('port: ', option.port) |
|
|
|
|
|
|
|
console.log('host: ', option.ip) |
|
|
|
console.log('rpc: ', option.rpc) |
|
|
|
console.log('rpc: ', option.rpc) |
|
|
|
console.log('details: ', option.details) |
|
|
|
console.log('details: ', option.details) |
|
|
|
console.log('host: ', option.ip) |
|
|
|
console.log('\n') |
|
|
|
console.log('port: ', option.port) |
|
|
|
console.log('Provider options:') |
|
|
|
const Server = require('../src/server') |
|
|
|
console.log('coinbase: ', option.coinbase) |
|
|
|
const server = new Server({ |
|
|
|
console.log('fork: ', option.fork) |
|
|
|
coinbase: option.coinbase, |
|
|
|
console.log('nodeUrl: ', option.nodeUrl) |
|
|
|
rpc: option.rpc, |
|
|
|
console.log('blockNumber: ', option.blockNumber) |
|
|
|
logDetails: option.details |
|
|
|
console.log('stateDb: ', option.stateDb) |
|
|
|
}) |
|
|
|
console.log('blocks: ', option.blocks) |
|
|
|
server.start(option.ip, option.port) |
|
|
|
const { Server } = require('../src/server') |
|
|
|
|
|
|
|
const server = new Server(option) |
|
|
|
|
|
|
|
server.start(option) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
program.parse(process.argv) |
|
|
|
program.parse(process.argv) |
|
|
|