-
Notifications
You must be signed in to change notification settings - Fork 6
/
cli.js
62 lines (54 loc) · 1.68 KB
/
cli.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env node
const commander = require('commander'),
{ prompt } = require('inquirer'),
chalk = require('chalk'),
jsonFile = require('jsonfile')
commander.version('1.0.0').description('BitShares Witness Monitor')
commander
.command('create <name>')
//.option('--extension <value>', 'File extension')
.alias('c')
.description('Create new configuration file.')
.action((name, cmd) => {
const data = {
"port": 3090,
"node": "ws://localhost:8090",
"coreAsset": "BTS",
"producer": {
"name": "your_witness_name",
"key": "your_active_key"
},
"producerBackup": {
"isOn": true,
"name": "witness_name",
"key": "backup_signing_key",
"url": "witness_url"
},
"priceFeeds": {
"isOn": true,
"cron": "5 */58 * * * *",
"assets": {
"EUR": {
"SYMBOL": "EUR",
"MCR": 1.6,
"MSSR": 1.02
},
"RUBLE": {
"SYMBOL": "RUBLE",
"MCR": 1.75,
"MSSR": 1.1
}
},
"priceProviders": {
"coinpaprika": true
}
},
"monitor": {
"isOn": false,
"telegram": {}
}
}
jsonFile.writeFileSync(name, data)
console.log(chalk.green(`\nFile "${name}" created.`))
})
commander.parse(process.argv)