This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbackend.config.js
83 lines (71 loc) · 2.36 KB
/
backend.config.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
80
81
82
83
require('dotenv').config();
module.exports = {
substrateNetwork: process.env.SUBSTRATE_NETWORK || 'polkadot',
wsProviderUrl: process.env.WS_PROVIDER_URL || 'ws://substrate-node:9944',
postgresConnParams: {
user: process.env.POSTGRES_USER || 'polkastats',
host: process.env.POSTGRES_HOST || 'postgres',
database: process.env.POSTGRES_DATABASE || 'polkastats',
password: process.env.POSTGRES_PASSWORD || 'polkastats',
port: process.env.POSTGRES_PORT || 5432,
},
crawlers: [
{
enabled: !process.env.CRAWLER_SYSTEM_DISABLE,
module: require('./lib/crawlers/system'),
},
{
enabled: !process.env.CRAWLER_BLOCK_LISTENER_DISABLE,
module: require('./lib/crawlers/blockListener'),
},
{
enabled: !process.env.CRAWLER_BLOCK_HARVESTER_DISABLE,
module: require('./lib/crawlers/blockHarvester'),
config: {
pollingTime:
parseInt(process.env.CRAWLER_BLOCK_LISTENER_POLLING_TIME_MS) ||
1 * 60 * 1000,
},
},
{
enabled: !process.env.CRAWLER_STAKING_DISABLE,
module: require('./lib/crawlers/staking'),
},
{
enabled: !process.env.CRAWLER_ACTIVE_ACCOUNTS_DISABLE,
module: require('./lib/crawlers/activeAccounts'),
config: {
pollingTime:
parseInt(process.env.CRAWLER_ACTIVE_ACCOUNTS_POLLING_TIME_MS) ||
60 * 60 * 1000,
},
},
{
enabled: !process.env.CRAWLER_CHAIN_DISABLE,
module: require('./lib/crawlers/chain'),
},
{
enabled: !process.env.CRAWLER_ERA_LISTENER_DISABLE,
module: require('./lib/crawlers/eraListener'),
},
{
enabled: !process.env.CRAWLER_ERA_HARVESTER_DISABLE,
module: require('./lib/crawlers/eraHarvester'),
},
{
enabled: !process.env.CRAWLER_PHRAGMEN_DISABLE,
module: require('./lib/crawlers/phragmen'),
config: {
substrateNetwork: process.env.SUBSTRATE_NETWORK || 'polkadot',
wsProviderUrl:
process.env.WS_PROVIDER_URL || 'ws://substrate-node:9944',
pollingTime: parseInt(process.env.CRAWLER_PHRAGMEN_POLLING_TIME_MS),
phragmenOutputDir:
process.env.CRAWLER_PHRAGMEN_OUTPUT_DIR || '/tmp/phragmen',
offlinePhragmenPath:
process.env.CRAWLER_PHRAGMEN_BINARY_PATH ||
'/usr/app/polkastats-backend-v3/offline-election',
},
},
],
};