-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmd.js
35 lines (29 loc) · 885 Bytes
/
cmd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict'
const commander = require('commander')
const _ = require('lodash')
const web3Rpc = require('./models/web3rpc')
const cmdEpoch = require('./commands/epoch')
const cmdBlock = require('./commands/block')
const cmdSendTomo = require('./commands/sendTomo')
commander
.version('1.0.0')
.description('TomoChain Data Crawlers')
commander
.command('epoch <epochNumber>')
.action(async (epochNumber) => {
await cmdEpoch.run(epochNumber)
})
commander
.command('block <blockHash>')
.action(async (blockHash) => {
await cmdBlock.run(blockHash)
})
commander
.command('sendTomo <pkey>')
.alias('s')
.description('Make TXs send TOMO')
.option('-n, --number <number>', 'Number of TXs')
.action(async (pkey, options) => {
await cmdSendTomo.run(pkey, options.number || 1)
})
commander.parse(process.argv)