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 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
- ganache: {
19
- rpc: 'http://localhost:7545',
20
- hubContract: '0x209679fA3B658Cd0fC74473aF28243bfe78a9b12',
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
- hardhat: {
23
- rpc: 'http://localhost:8545',
24
- hubContract: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
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
- polygon: {
27
- rpc: 'https://matic-mumbai.chainstacklabs.com',
28
- hubContract: '0xdaa16AC171CfE8Df6F79C06E7EEAb2249E2C9Ec8', // TODO: change to Asset Contract
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
- 'otp::alphanet': {
31
- rpc: 'http://parachain-alphanet-02.origin-trail.network:9933',
32
- hubContract: '0x7585a99C5C150a08f5CDeFD16465C6De8D41EbbD',
33
- },
34
- 'otp::devnet': {
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,