-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.js
77 lines (73 loc) · 1.71 KB
/
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
require('dotenv')
.config({ path: __dirname + '/.env' })
const convict = require('convict')
const config = convict({
env: {
doc: 'The application environment.',
format: ['production', 'development'],
default: 'development',
env: 'NODE_ENV',
},
db: {
doc: 'Mongo connection url.',
format: String,
default: 'mongodb://localhost:27017/ton-notify',
env: 'MONGODB_URI',
},
bot: {
token: {
doc: 'Telegram Bot token.',
format: String,
default: '',
env: 'BOT_TOKEN',
},
notifications_channel_id: {
doc: 'Notifications channel ID.',
format: String,
default: '',
env: 'NOTIFICATIONS_CHANNEL_ID',
},
},
min_transaction_amount: {
doc: 'Minimum amount of a transaction to send a notification to the channel',
format: Number,
default: 1000,
env: 'MIN_TRANSACTION_AMOUNT',
},
ton: {
node: {
doc: 'TON Node API URL.',
format: String,
default: 'https://testnet.toncenter.com/api/v2/jsonRPC',
env: 'TON_NODE_URL',
},
index: {
doc: 'TON Index API URL.',
format: String,
default: 'https://testnet.toncenter.com/api/index',
env: 'TON_INDEX_URL',
},
node_key: {
doc: 'TON Node API Key.',
format: String,
default: '',
env: 'TON_NODE_API_KEY',
},
index_key: {
doc: 'TON Index API Key.',
format: String,
default: '',
env: 'TON_INDEX_API_KEY',
},
},
synchronizer: {
interval: {
doc: 'Sync interval in seconds (expected block generation time).',
format: Number,
default: 5,
env: 'SYNCHRONIZER_INTERVAL',
},
},
})
config.validate({ allowed: 'strict' })
module.exports = config