/
indexrequeuereverted.js
79 lines (39 loc) · 1.73 KB
/
indexrequeuereverted.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import SegfaultHandler from 'segfault-handler';
SegfaultHandler.registerHandler('crash.log');
//var INFURA_ROPSTEN_URL = 'https://ropsten.infura.io/v3/';
//var INFURA_MAINNET_URL = 'https://mainnet.infura.io/v3/';
var https_enabled = process.argv[2] === 'https';
var pool_env = 'production';
if( process.argv[2] == "staging" )
{
pool_env = 'staging'
}
import FileUtils from './lib/util/file-utils.js'
import cron from 'node-cron'
let poolConfigFull = FileUtils.readJsonFileSync('/pool.config.json');
let poolConfig = poolConfigFull[pool_env]
console.log('poolConfig',poolConfig, poolConfigFull)
console.log('init');
import MongoInterface from './lib/mongo-interface.js'
import RequeueReverted from './lib/requeue-revertedtxs.js';
//import CleanerCoordinator from './lib/cleaner-coordinatorj.js';
import PeerInterface from './lib/peer-interface.js';
import TokenInterface from './lib/token-interface.js';
import Web3ApiHelper from './lib/util/web3-api-helper.js';
import PoolStatsHelper from './lib/util/pool-stats-helper.js'
import WebServer from './lib/web-server.js'
import DiagnosticsManager from './lib/diagnostics-manager.js'
import ContractHelper from './lib/util/contract-helper.js'
import TokenDataHelper from './lib/util/token-data-helper.js'
var accountConfig;
import Web3 from 'web3'
init( );
async function init( )
{
// Code to run if we're in the master process
let mongoInterface = new MongoInterface();
let web3 = new Web3(poolConfig.mintingConfig.web3Provider);
await mongoInterface.init( 'tokenpool_'.concat(pool_env))
let RequeueReverts = new RequeueReverted(web3, poolConfig, mongoInterface )
RequeueReverts.update();
}