UNPKG

4.01 kBJavaScriptView Raw
1const config = {
2 basePath: '/ws/api',
3 port: 3232,
4 ignoreRateLimiter: false,
5
6 // Log levels; debug, warn, info, error
7 log: {
8 disable: true,
9 level: process.env.LOG_LEVEL || 'info'
10 },
11
12 cluster: true,
13
14 storageOpts: {
15 mongoDb: {
16 uri: process.env.DB_CONN_STRING || 'mongodb://localhost:27017/ws_test'
17 }
18 },
19
20 lockOpts: {
21 lockerServer: {
22 host: process.env.LOCKER_SERVER_NAME || 'localhost',
23 port: Number(process.env.LOCKER_SERVER_PORT) || 3231
24 }
25 },
26
27 messageBrokerOpts: {
28 port: Number(process.env.MESSAGE_BROKER_PORT) || 3380,
29 // If using a remote service.
30 messageBrokerServer: {
31 url: process.env.MESSAGE_BROKER_URL || `http://localhost:${Number(process.env.MESSAGE_BROKER_PORT) || 3380}`
32 }
33 },
34
35 emailOpts: {
36 transport: {
37 host: process.env.EMAIL_TRANSPORT_HOST || 'localhost',
38 port: Number(process.env.EMAIL_TRANSPORT_PORT) || 25,
39 ignoreTLS: process.env.EMAIL_TRANSPORT_IGNORE_TLS ? true : false
40 },
41 defaultLanguage: 'en',
42 subjectPrefix: process.env.EMAIL_SUBJECT_PREFIX || '[Wallet Service]',
43 from: process.env.EMAIL_FROM || 'wallet-service@owstack.com',
44 templatePath: process.env.EMAIL_TEMPLATE_DIR || './base-service/lib/templates',
45 publicTxUrlTemplate: {
46 livenet: process.env.EMAIL_EXPLORER_URL_TEMPLATE || 'http://explorer.owstack.org/explorer/tx/{{txid}}',
47 // testnet: 'http://explorer.owstack.org/explorer/tx/{{txid}}'
48 }
49 },
50
51 // Sendgrid.
52 // const sgMail = require('@sendgrid/mail');
53 // sgMail.setApiKey(process.env.SENDGRID_API_KEY);
54 //
55 // Add config:
56 // mailer: sgMail,
57
58 pushNotificationsOpts: {
59 templatePath: './base-service/lib/templates',
60 defaultLanguage: 'en',
61 subjectPrefix: process.env.EMAIL_SUBJECT_PREFIX || '',
62 pushServerUrl: 'https://fcm.googleapis.com/fcm',
63 authorizationKeys: process.env.GOOGLE_FCM_AUTH_KEYS || ''
64 },
65
66 fiatRateServiceOpts: {
67 provider: 'OpenWalletStack',
68 fetchInterval: 60 // in minutes
69 },
70
71 // Each server (by coin network) has it's own configuration. Where the same services
72 // run for each coin network the url's must be unique across all coin networks.
73
74 BTC: {
75 blockchainExplorerOpts: {
76 defaultProvider: 'explorer',
77 explorer: {
78 // Multiple servers (in priority order)
79 // url: ['http://a.b.c', 'https://test-explorer.owstack.com:443'],
80 livenet: {
81 url: process.env.BTC_LIVENET_EXPLORER_API || 'http://btc.livenet.explorer-api.owstack.org',
82 apiPrefix: process.env.BTC_LIVENET_EXPLORER_API_PATH || '/explorer-api'
83 }
84 }
85 }
86 },
87
88 BCH: {
89 blockchainExplorerOpts: {
90 defaultProvider: 'explorer',
91 explorer: {
92 // Multiple servers (in priority order)
93 // url: ['http://a.b.c', 'https://test-explorer.owstack.com:443'],
94 livenet: {
95 url: process.env.BCH_LIVENET_EXPLORER_API || 'http://bch.livenet.explorer-api.owstack.org',
96 apiPrefix: process.env.BCH_LIVENET_EXPLORER_API_PATH || '/explorer-api'
97 }
98 }
99 }
100 },
101
102 LTC: {
103 blockchainExplorerOpts: {
104 defaultProvider: 'explorer',
105 explorer: {
106 // Multiple servers (in priority order)
107 // url: ['http://a.b.c', 'https://test-explorer.owstack.com:443'],
108 livenet: {
109 url: process.env.LTC_LIVENET_EXPLORER_API || 'http://ltc.livenet.explorer-api.owstack.org',
110 apiPrefix: process.env.LTC_LIVENET_EXPLORER_API_PATH || '/explorer-api'
111 }
112 }
113 }
114 }
115
116};
117
118module.exports = config;