-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.js
81 lines (78 loc) · 3.35 KB
/
index.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
const path = require('path');
const constants = {
'CHANNEL_ID': 'kumachannel',
'KEYSTORE_PATH': path.resolve(__dirname, '../../network/generated/hfc-key-store')
};
const env = process.env.NODE_ENV || 'dev';
if (env.toLowerCase() === 'prod') {
constants.PEER = {
url: 'grpcs://kumapeer.org.kunstmaan.be:7051',
/**
* The url which is used to subscribe to the event hub to wait for the transaction to be completed
*/
broadcastUrl: 'grpcs://kumapeer.org.kunstmaan.be:7053',
/**
* Id of the user which can listen to the event hub, not all users can do this by default
*/
adminUserId: 'admin-kuma',
/**
* Path to the certificate, you only need to specify this when using the grpcs protocol
*/
certPath: path.resolve(__dirname, '../../network/generated/crypto-config/org.kunstmaan.be/peers/kumapeer.org.kunstmaan.be/tlsca.combined.kumapeer.org.kunstmaan.be-cert.pem'),
/**
* Extra options to pass to the grpc module, you only need to specify this when using the grpcs protocol
*/
certOptions: {
'ssl-target-name-override': 'kumapeer.org.kunstmaan.be'
}
};
constants.ORDERER = {
url: 'grpcs://orderer.org.kunstmaan.be:7050',
/**
* Path to the certificate, you only need to specify this when using the grpcs protocol
*/
certPath: path.resolve(__dirname, '../../network/generated/crypto-config/org.kunstmaan.be/orderers/orderer.org.kunstmaan.be/tlsca.combined.orderer.org.kunstmaan.be-cert.pem'),
/**
* Extra options to pass to the grpc module, you only need to specify this when using the grpcs protocol
*/
certOptions: {
'ssl-target-name-override': 'orderer.org.kunstmaan.be'
}
};
} else {
constants.PEER = {
url: 'grpc://localhost:7051',
/**
* The url which is used to subscribe to the event hub to wait for the transaction to be completed
*/
broadcastUrl: 'grpc://localhost:7053',
/**
* Id of the user which can listen to the event hub, not all users can do this by default
*/
adminUserId: 'admin-kuma',
/**
* Path to the certificate, you only need to specify this when using the grpcs protocol
*/
certPath: path.resolve(__dirname, '../../network/generated/crypto-config/kunstmaan.be/peers/kumapeer.kunstmaan.be/tlsca.combined.kumapeer.kunstmaan.be-cert.pem'),
/**
* Extra options to pass to the grpc module, you only need to specify this when using the grpcs protocol
*/
certOptions: {
'ssl-target-name-override': 'kumapeer.org.kunstmaan.be'
}
};
constants.ORDERER = {
url: 'grpc://localhost:7050',
/**
* Path to the certificate, you only need to specify this when using the grpcs protocol
*/
certPath: path.resolve(__dirname, '../../network/generated/crypto-config/kunstmaan.be/orderers/orderer.kunstmaan.be/tlsca.combined.orderer.kunstmaan.be-cert.pem'),
/**
* Extra options to pass to the grpc module, you only need to specify this when using the grpcs protocol
*/
certOptions: {
'ssl-target-name-override': 'orderer.org.kunstmaan.be'
}
};
}
module.exports = constants;