-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
79 lines (71 loc) · 1.89 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
78
'use strict';
var path = require('path'),
rootPath = path.normalize(__dirname + '/..'),
env,
db,
port,
b_port,
p2p_port;
if (process.env.INSIGHT_NETWORK === 'livenet') {
env = 'livenet';
db = rootPath + '/db';
port = '30000';
b_port = '15715';
p2p_port = '15714';
}
else {
env = 'testnet';
db = rootPath + '/db/testnet';
port = '30001';
b_port = '25715';
p2p_port = '25714';
}
switch(process.env.NODE_ENV) {
case 'production':
env += '';
break;
case 'test':
env += ' - test environment';
break;
default:
env += ' - development';
break;
}
var network = process.env.INSIGHT_NETWORK || 'testnet';
var dataDir = process.env.BLACKCOIND_DATADIR;
var isWin = /^win/.test(process.platform);
var isMac = /^darwin/.test(process.platform);
var isLinux = /^linux/.test(process.platform);
if (!dataDir) {
if (isWin) dataDir = '%APPDATA%\\Blackcoin\\';
if (isMac) dataDir = process.env.HOME + '/Library/Application Support/Blackcoin/';
if (isLinux) dataDir = process.env.HOME + '/.blackcoin/';
}
dataDir += network === 'testnet' ? 'testnet3' : '';
module.exports = {
root: rootPath,
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
appName: 'Blackchain ' + env,
apiPrefix: '/api',
port: port,
leveldb: db,
blackcoind: {
protocol: process.env.BLACKCOIND_PROTO || 'http',
user: process.env.BLACKCOIND_USER || 'blackcoinrpc',
pass: process.env.BLACKCOIND_PASS || 'password',
host: process.env.BLACKCOIND_HOST || '127.0.0.1',
port: process.env.BLACKCOIND_PORT || b_port,
p2pPort: process.env.BLACKCOIND_P2P_PORT || p2p_port,
dataDir: dataDir,
// DO NOT CHANGE THIS!
disableAgent: true
},
network: network,
disableP2pSync: false,
disableHistoricSync: false,
// Time to refresh the currency rate. In minutes
currencyRefresh: 10,
keys: {
segmentio: process.env.INSIGHT_SEGMENTIO_KEY
}
};