dkg.js 6.0.16 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants.js +51 -24
- package/dist/dkg.min.js +1 -1
- package/examples/demo-private.js +2 -0
- package/examples/demo.html +1 -0
- package/examples/demo.js +3 -1
- package/managers/asset-operations-manager.js +13 -15
- package/managers/blockchain-operations-manager.js +0 -2
- package/managers/network-operations-manager.js +5 -12
- package/package.json +2 -2
- package/services/base-service-manager.js +8 -1
- package/services/blockchain-service/blockchain-service-base.js +32 -7
- package/services/blockchain-service/implementations/node-blockchain-service.js +5 -3
- package/services/custom-errors.js +12 -0
- package/services/input-service.js +24 -11
- package/services/utilities.js +7 -5
- package/services/validation-service.js +5 -4
package/constants.js
CHANGED
|
@@ -15,36 +15,60 @@ const PRIVATE_ASSERTION_PREDICATE = 'https://ontology.origintrail.io/dkg/1.0#pri
|
|
|
15
15
|
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
16
16
|
|
|
17
17
|
const BLOCKCHAINS = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
development: {
|
|
19
|
+
'hardhat1:31337': {
|
|
20
|
+
rpc: 'http://localhost:8545',
|
|
21
|
+
hubContract: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
|
|
22
|
+
},
|
|
23
|
+
'hardhat2:31337': {
|
|
24
|
+
rpc: 'http://localhost:9545',
|
|
25
|
+
hubContract: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
|
|
26
|
+
},
|
|
27
|
+
'otp::2043': {
|
|
28
|
+
rpc: 'http://parachain-alphanet-02.origin-trail.network:9933',
|
|
29
|
+
hubContract: '0x7585a99C5C150a08f5CDeFD16465C6De8D41EbbD',
|
|
30
|
+
},
|
|
21
31
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
devnet: {
|
|
33
|
+
'otp:2160': {
|
|
34
|
+
rpc: 'https://lofar-tm-rpc.origin-trail.network',
|
|
35
|
+
hubContract: '0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB',
|
|
36
|
+
},
|
|
37
|
+
'gnosis:10200': {
|
|
38
|
+
rpc: 'https://rpc.chiadochain.net',
|
|
39
|
+
hubContract: '0xD2bA102A0b11944d00180eE8136208ccF87bC39A',
|
|
40
|
+
gasPriceOracleLink: 'https://blockscout.chiadochain.net/api/v1/gas-price-oracle',
|
|
41
|
+
},
|
|
25
42
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
testnet: {
|
|
44
|
+
'otp:20430': {
|
|
45
|
+
rpc: 'https://lofar-testnet.origin-trail.network',
|
|
46
|
+
hubContract: '0xBbfF7Ea6b2Addc1f38A0798329e12C08f03750A6',
|
|
47
|
+
},
|
|
48
|
+
'gnosis:10200': {
|
|
49
|
+
rpc: 'https://rpc.chiadochain.net',
|
|
50
|
+
hubContract: '0xC06210312C9217A0EdF67453618F5eB96668679A',
|
|
51
|
+
gasPriceOracleLink: 'https://blockscout.chiadochain.net/api/v1/gas-price-oracle',
|
|
52
|
+
},
|
|
29
53
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
rpc: 'https://lofar-tm-rpc.origin-trail.network',
|
|
36
|
-
hubContract: '0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB',
|
|
37
|
-
},
|
|
38
|
-
'otp::testnet': {
|
|
39
|
-
rpc: 'https://lofar-testnet.origin-trail.network',
|
|
40
|
-
hubContract: '0xBbfF7Ea6b2Addc1f38A0798329e12C08f03750A6',
|
|
41
|
-
},
|
|
42
|
-
'otp::mainnet': {
|
|
43
|
-
rpc: 'https://astrosat-parachain-rpc.origin-trail.network',
|
|
44
|
-
hubContract: '0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA',
|
|
54
|
+
mainnet: {
|
|
55
|
+
'otp:2043': {
|
|
56
|
+
rpc: 'https://astrosat-parachain-rpc.origin-trail.network',
|
|
57
|
+
hubContract: '0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA',
|
|
58
|
+
},
|
|
45
59
|
},
|
|
46
60
|
};
|
|
47
61
|
|
|
62
|
+
const BLOCKCHAINS_RENAME_PAIRS = {
|
|
63
|
+
hardhat1: 'hardhat1:31337',
|
|
64
|
+
hardhat2: 'hardhat2:31337',
|
|
65
|
+
'otp::devnet': 'otp:2160',
|
|
66
|
+
'otp::testnet': 'otp:20430',
|
|
67
|
+
'otp::mainnet': 'otp:2043',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const MAX_BLOCKCHAIN_CALL_RETRIES = 3;
|
|
71
|
+
|
|
48
72
|
const TRANSACTION_RETRY_ERRORS = [
|
|
49
73
|
'transaction was not mined',
|
|
50
74
|
'already known',
|
|
@@ -134,6 +158,7 @@ const OPERATIONS_STEP_STATUS = {
|
|
|
134
158
|
const DEFAULT_GET_LOCAL_STORE_RESULT_FREQUENCY = 0.5;
|
|
135
159
|
|
|
136
160
|
const DEFAULT_PARAMETERS = {
|
|
161
|
+
ENVIRONMENT: 'mainnet',
|
|
137
162
|
PORT: 8900,
|
|
138
163
|
FREQUENCY: 5,
|
|
139
164
|
MAX_NUMBER_OF_RETRIES: 5,
|
|
@@ -155,6 +180,8 @@ module.exports = {
|
|
|
155
180
|
PRIVATE_ASSERTION_PREDICATE,
|
|
156
181
|
ZERO_ADDRESS,
|
|
157
182
|
BLOCKCHAINS,
|
|
183
|
+
BLOCKCHAINS_RENAME_PAIRS,
|
|
184
|
+
MAX_BLOCKCHAIN_CALL_RETRIES,
|
|
158
185
|
TRANSACTION_RETRY_ERRORS,
|
|
159
186
|
WEBSOCKET_PROVIDER_OPTIONS,
|
|
160
187
|
OPERATIONS,
|