-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunBatch.js
33 lines (29 loc) · 1.01 KB
/
runBatch.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
const {
registerBulk,
logger
} = require("./batcher");
// setting arguments
const args = {
"receiptCollectionName": "l1_transactions",
"layer": "l1",
"blockRangeSize" : parseInt(process.env.BLOCK_RANGE_SIZE),
"retrieveDays": parseFloat(process.env.RETRIEVE_DAYS),
"waitTime" : parseInt(process.env.WAIT_TIME),
"router" : process.env.UNIVERSAL_ROUTER_ADDRESS,
"wss": process.env.RPC_WEBSOCKET_URL
}
const args2 = {
"receiptCollectionName": "l2_transactions",
"layer": "l2",
"blockRangeSize" : parseInt(process.env.L2_BLOCK_RANGE_SIZE),
"retrieveDays": parseFloat(process.env.L2_RETRIEVE_DAYS),
"waitTime" : parseInt(process.env.L2_WAIT_TIME),
"router" : process.env.L2_UNIVERSAL_ROUTER_ADDRESS,
"wss": process.env.L2_RPC_WEBSOCKET_URL
}
process.env.RPC_WEBSOCKET_URL
? registerBulk(args)
: logger.info("No RPC settings! So, L1 Batch Skipping");
process.env.L2_RPC_WEBSOCKET_URL
? registerBulk(args2)
: logger.info("No L2RPC settings! So, L2 Batch Skipping");