-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
68 lines (39 loc) · 1.22 KB
/
index.js
File metadata and controls
68 lines (39 loc) · 1.22 KB
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
63
64
65
66
67
68
const MongoInterface = require('./lib/mongo-interface')
const Bree = require('bree');
var ExpressServer = require ('./lib/express-server')
var Web3Plug = require('./lib/js/web3plug')
const Graceful = require('@ladjs/graceful');
const thread = require('bthreads');
const Cabin = require('cabin');
//var CoinManager = require ('./lib/coin-manager')
//var PunkManager = require ('./lib/punk-manager')
function init()
{
console.log('Booting 0xBTC API bot.')
const bree = new Bree({
logger: new Cabin(),
jobs: [
// runs `./jobs/foo-bar.js` on start
// runs `./jobs/worker-1.js` on the last day of the month
{
name: 'collectbasicdata',
interval: '1h'
},
// runs `./jobs/worker-2.js` every other day
{
name: 'collectmints',
interval: '5m'
}
]
})
const graceful = new Graceful({ brees: [bree] });
graceful.listen();
// start all jobs (this is the equivalent of reloading a crontab):
bree.start();
bree.run('collectbasicdata');
//var expressServer = new ExpressServer();
//CoinManager.init( ethConnection );
//PunkManager.init( ethConnection );
var expressServer = new ExpressServer( );
}
init();