@cheqd/sdk 2.1.0-develop.1 → 2.2.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.
Files changed (127) hide show
  1. package/README.md +33 -6
  2. package/build/{index.d.ts → cjs/index.d.ts} +8 -3
  3. package/build/cjs/index.d.ts.map +1 -0
  4. package/build/cjs/index.js +144 -0
  5. package/build/cjs/index.js.map +1 -0
  6. package/build/{modules → cjs/modules}/_.d.ts +1 -1
  7. package/build/cjs/modules/_.d.ts.map +1 -0
  8. package/build/{modules → cjs/modules}/_.js +3 -0
  9. package/build/cjs/modules/_.js.map +1 -0
  10. package/build/{modules → cjs/modules}/did.d.ts +4 -2
  11. package/build/cjs/modules/did.d.ts.map +1 -0
  12. package/build/{modules → cjs/modules}/did.js +42 -25
  13. package/build/cjs/modules/did.js.map +1 -0
  14. package/build/{modules → cjs/modules}/resource.d.ts +2 -2
  15. package/build/cjs/modules/resource.d.ts.map +1 -0
  16. package/build/{modules → cjs/modules}/resource.js +13 -5
  17. package/build/cjs/modules/resource.js.map +1 -0
  18. package/build/cjs/querier.d.ts.map +1 -0
  19. package/build/cjs/querier.js.map +1 -0
  20. package/build/cjs/registry.d.ts.map +1 -0
  21. package/build/cjs/registry.js.map +1 -0
  22. package/build/cjs/signer.d.ts.map +1 -0
  23. package/build/cjs/signer.js.map +1 -0
  24. package/build/{types.d.ts → cjs/types.d.ts} +1 -1
  25. package/build/cjs/types.d.ts.map +1 -0
  26. package/build/cjs/types.js.map +1 -0
  27. package/build/cjs/utils.d.ts.map +1 -0
  28. package/build/{utils.js → cjs/utils.js} +2 -5
  29. package/build/cjs/utils.js.map +1 -0
  30. package/build/types/index.d.ts +45 -0
  31. package/build/types/index.d.ts.map +1 -0
  32. package/build/types/modules/_.d.ts +20 -0
  33. package/build/types/modules/_.d.ts.map +1 -0
  34. package/build/types/modules/did.d.ts +109 -0
  35. package/build/types/modules/did.d.ts.map +1 -0
  36. package/build/types/modules/resource.d.ts +62 -0
  37. package/build/types/modules/resource.d.ts.map +1 -0
  38. package/build/types/querier.d.ts +11 -0
  39. package/build/types/querier.d.ts.map +1 -0
  40. package/build/types/registry.d.ts +4 -0
  41. package/build/types/registry.d.ts.map +1 -0
  42. package/build/types/signer.d.ts +36 -0
  43. package/build/types/signer.d.ts.map +1 -0
  44. package/build/types/types.d.ts +80 -0
  45. package/build/types/types.d.ts.map +1 -0
  46. package/build/types/utils.d.ts +18 -0
  47. package/build/types/utils.d.ts.map +1 -0
  48. package/package.json +48 -25
  49. package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -74
  50. package/.github/ISSUE_TEMPLATE/config.yml +0 -14
  51. package/.github/ISSUE_TEMPLATE/feature-request.yaml +0 -27
  52. package/.github/dependabot.yml +0 -42
  53. package/.github/linters/.commitlint.rules.js +0 -37
  54. package/.github/linters/.eslintrc.json +0 -18
  55. package/.github/linters/.markdown-lint.yml +0 -139
  56. package/.github/linters/mlc_config.json +0 -13
  57. package/.github/workflows/build.yml +0 -30
  58. package/.github/workflows/cleanup-actions.yml +0 -45
  59. package/.github/workflows/cleanup-cache-automatic.yml +0 -24
  60. package/.github/workflows/cleanup-cache-manual.yml +0 -21
  61. package/.github/workflows/codeql.yml +0 -40
  62. package/.github/workflows/dispatch.yml +0 -30
  63. package/.github/workflows/lint.yml +0 -51
  64. package/.github/workflows/pull-request.yml +0 -33
  65. package/.github/workflows/release.yml +0 -42
  66. package/.github/workflows/test.yml +0 -66
  67. package/.releaserc.json +0 -56
  68. package/CHANGELOG.md +0 -256
  69. package/CODE_OF_CONDUCT.md +0 -81
  70. package/NOTICE.md +0 -10
  71. package/SECURITY.md +0 -12
  72. package/build/index.d.ts.map +0 -1
  73. package/build/index.js +0 -97
  74. package/build/index.js.map +0 -1
  75. package/build/modules/_.d.ts.map +0 -1
  76. package/build/modules/_.js.map +0 -1
  77. package/build/modules/did.d.ts.map +0 -1
  78. package/build/modules/did.js.map +0 -1
  79. package/build/modules/resource.d.ts.map +0 -1
  80. package/build/modules/resource.js.map +0 -1
  81. package/build/querier.d.ts.map +0 -1
  82. package/build/querier.js.map +0 -1
  83. package/build/registry.d.ts.map +0 -1
  84. package/build/registry.js.map +0 -1
  85. package/build/signer.d.ts.map +0 -1
  86. package/build/signer.js.map +0 -1
  87. package/build/types.d.ts.map +0 -1
  88. package/build/types.js.map +0 -1
  89. package/build/utils.d.ts.map +0 -1
  90. package/build/utils.js.map +0 -1
  91. package/docker/Dockerfile +0 -55
  92. package/docker/entrypoint.sh +0 -58
  93. package/docker/localnet/build-latest.env +0 -7
  94. package/docker/localnet/container-env/observer-0.env +0 -13
  95. package/docker/localnet/container-env/seed-0.env +0 -17
  96. package/docker/localnet/container-env/validator-0.env +0 -13
  97. package/docker/localnet/container-env/validator-1.env +0 -13
  98. package/docker/localnet/container-env/validator-2.env +0 -13
  99. package/docker/localnet/container-env/validator-3.env +0 -13
  100. package/docker/localnet/docker-compose.yml +0 -281
  101. package/docker/localnet/gen-network-config.sh +0 -259
  102. package/docker/localnet/import-keys.sh +0 -31
  103. package/jest.config.js +0 -6
  104. package/src/index.ts +0 -128
  105. package/src/modules/_.ts +0 -55
  106. package/src/modules/did.ts +0 -564
  107. package/src/modules/resource.ts +0 -213
  108. package/src/querier.ts +0 -33
  109. package/src/registry.ts +0 -15
  110. package/src/signer.ts +0 -258
  111. package/src/types.ts +0 -101
  112. package/src/utils.ts +0 -243
  113. package/tests/index.test.ts +0 -135
  114. package/tests/modules/did.test.ts +0 -965
  115. package/tests/modules/resource.test.ts +0 -785
  116. package/tests/signer.test.ts +0 -179
  117. package/tests/testutils.test.ts +0 -24
  118. package/tests/utils.test.ts +0 -66
  119. package/tsconfig.json +0 -80
  120. /package/build/{querier.d.ts → cjs/querier.d.ts} +0 -0
  121. /package/build/{querier.js → cjs/querier.js} +0 -0
  122. /package/build/{registry.d.ts → cjs/registry.d.ts} +0 -0
  123. /package/build/{registry.js → cjs/registry.js} +0 -0
  124. /package/build/{signer.d.ts → cjs/signer.d.ts} +0 -0
  125. /package/build/{signer.js → cjs/signer.js} +0 -0
  126. /package/build/{types.js → cjs/types.js} +0 -0
  127. /package/build/{utils.d.ts → cjs/utils.d.ts} +0 -0
@@ -1,281 +0,0 @@
1
- version: '3.8'
2
-
3
- services:
4
- validator-0:
5
- image: ${BUILD_IMAGE}
6
- ports:
7
- - target: 26656
8
- published: 26656 # Tendermint peer-to-peer (P2P) port
9
- - target: 26657
10
- published: 26657 # Tendermint RPC port
11
- - target: 1317
12
- published: 1317 # Cosmos REST API port
13
- - target: 9090
14
- published: 9090 # gRPC port
15
- - target: 9091
16
- published: 9091 # gRPC-Gateway port
17
- - target: 26660
18
- published: 26660 # Prometheus metrics port
19
- entrypoint: [ "node-start", "--chain-id cheqd" ]
20
- healthcheck:
21
- test: curl -s http://localhost:26657/status | grep -c true
22
- interval: 10s
23
- timeout: 2s
24
- retries: 6
25
- start_period: 15s
26
- volumes:
27
- - type: volume
28
- source: validator-0-data
29
- target: /home/cheqd
30
- env_file:
31
- - container-env/validator-0.env
32
- configs:
33
- - source: genesis
34
- target: /genesis
35
- - source: seeds
36
- target: /seeds
37
- - source: validator-0-node-key
38
- target: /node_key
39
- - source: validator-0-priv-val-key
40
- target: /priv_validator_key
41
-
42
- validator-1:
43
- image: ${BUILD_IMAGE}
44
- ports:
45
- - target: 26656
46
- published: 26756 # Tendermint peer-to-peer (P2P) port
47
- - target: 26657
48
- published: 26757 # Tendermint RPC port
49
- - target: 1317
50
- published: 1417 # Cosmos REST API port
51
- - target: 9090
52
- published: 9190 # gRPC port
53
- - target: 9091
54
- published: 9191 # gRPC-Gateway port
55
- - target: 26660
56
- published: 26760 # Prometheus metrics port
57
- entrypoint: [ "node-start", "--chain-id cheqd" ]
58
- healthcheck:
59
- test: curl -s http://localhost:26757/status | grep -c true
60
- interval: 10s
61
- timeout: 2s
62
- retries: 6
63
- start_period: 15s
64
- volumes:
65
- - type: volume
66
- source: validator-1-data
67
- target: /home/cheqd
68
- env_file:
69
- - container-env/validator-1.env
70
- configs:
71
- - source: genesis
72
- target: /genesis
73
- - source: seeds
74
- target: /seeds
75
- - source: validator-1-node-key
76
- target: /node_key
77
- - source: validator-1-priv-val-key
78
- target: /priv_validator_key
79
-
80
- validator-2:
81
- image: ${BUILD_IMAGE}
82
- ports:
83
- - target: 26656
84
- published: 26856 # Tendermint peer-to-peer (P2P) port
85
- - target: 26657
86
- published: 26857 # Tendermint RPC port
87
- - target: 1317
88
- published: 1517 # Cosmos REST API port
89
- - target: 9090
90
- published: 9290 # gRPC port
91
- - target: 9091
92
- published: 9291 # gRPC-Gateway port
93
- - target: 26660
94
- published: 26860 # Prometheus metrics port
95
- entrypoint: [ "node-start", "--chain-id cheqd" ]
96
- healthcheck:
97
- test: curl -s http://localhost:26857/status | grep -c true
98
- interval: 10s
99
- timeout: 2s
100
- retries: 6
101
- start_period: 15s
102
- volumes:
103
- - type: volume
104
- source: validator-2-data
105
- target: /home/cheqd
106
- env_file:
107
- - container-env/validator-2.env
108
- configs:
109
- - source: genesis
110
- target: /genesis
111
- - source: seeds
112
- target: /seeds
113
- - source: validator-2-node-key
114
- target: /node_key
115
- - source: validator-2-priv-val-key
116
- target: /priv_validator_key
117
-
118
- validator-3:
119
- image: ${BUILD_IMAGE}
120
- ports:
121
- - target: 26656
122
- published: 26956 # Tendermint peer-to-peer (P2P) port
123
- - target: 26657
124
- published: 26957 # Tendermint RPC port
125
- - target: 1317
126
- published: 1617 # Cosmos REST API port
127
- - target: 9090
128
- published: 9390 # gRPC port
129
- - target: 9091
130
- published: 9391 # gRPC-Gateway port
131
- - target: 26660
132
- published: 26960 # Prometheus metrics port
133
- entrypoint: [ "node-start", "--chain-id cheqd" ]
134
- healthcheck:
135
- test: curl -s http://localhost:26957/status | grep -c true
136
- interval: 10s
137
- timeout: 2s
138
- retries: 6
139
- start_period: 15s
140
- volumes:
141
- - type: volume
142
- source: validator-3-data
143
- target: /home/cheqd
144
- env_file:
145
- - container-env/validator-3.env
146
- configs:
147
- - source: genesis
148
- target: /genesis
149
- - source: seeds
150
- target: /seeds
151
- - source: validator-3-node-key
152
- target: /node_key
153
- - source: validator-3-priv-val-key
154
- target: /priv_validator_key
155
-
156
- seed-0:
157
- image: ${BUILD_IMAGE}
158
- ports:
159
- - target: 26656
160
- published: 27056 # Tendermint peer-to-peer (P2P) port
161
- - target: 26657
162
- published: 27057 # Tendermint RPC port
163
- - target: 1317
164
- published: 1717 # Cosmos REST API port
165
- - target: 9090
166
- published: 9490 # gRPC port
167
- - target: 9091
168
- published: 9491 # gRPC-Gateway port
169
- - target: 26660
170
- published: 27060 # Prometheus metrics port
171
- entrypoint: [ "node-start", "--chain-id cheqd" ]
172
- healthcheck:
173
- test: curl -s http://localhost:27057/status | grep -c true
174
- interval: 10s
175
- timeout: 2s
176
- retries: 6
177
- start_period: 15s
178
- volumes:
179
- - type: volume
180
- source: seed-0-data
181
- target: /home/cheqd
182
- env_file:
183
- - container-env/seed-0.env
184
- configs:
185
- - source: genesis
186
- target: /genesis
187
- - source: seeds
188
- target: /seeds
189
- - source: seed-0-node-key
190
- target: /node_key
191
- - source: seed-0-priv-val-key
192
- target: /priv_validator_key
193
-
194
- observer-0:
195
- image: ${BUILD_IMAGE}
196
- ports:
197
- - target: 26656
198
- published: 27156 # Tendermint peer-to-peer (P2P) port
199
- - target: 26657
200
- published: 27157 # Tendermint RPC port
201
- - target: 1317
202
- published: 1817 # Cosmos REST API port
203
- - target: 9090
204
- published: 9590 # gRPC port
205
- - target: 9091
206
- published: 9591 # gRPC-Gateway port
207
- - target: 26660
208
- published: 27160 # Prometheus metrics port
209
- volumes:
210
- - type: volume
211
- source: observer-0-data
212
- target: /home/cheqd
213
- entrypoint: [ "node-start", "--chain-id cheqd" ]
214
- healthcheck:
215
- test: curl -s http://localhost:27157/status | grep -c true
216
- interval: 10s
217
- timeout: 2s
218
- retries: 6
219
- start_period: 15s
220
- env_file:
221
- - container-env/observer-0.env
222
- configs:
223
- - source: genesis
224
- target: /genesis
225
- - source: seeds
226
- target: /seeds
227
- - source: observer-0-node-key
228
- target: /node_key
229
- - source: observer-0-priv-val-key
230
- target: /priv_validator_key
231
-
232
- configs:
233
- # Genesis and seeds
234
- genesis:
235
- file: network-config/genesis.json
236
- seeds:
237
- file: network-config/seeds.txt
238
-
239
- # Validator 0
240
- validator-0-node-key:
241
- file: network-config/validator-0/config/node_key.json
242
- validator-0-priv-val-key:
243
- file: network-config/validator-0/config/priv_validator_key.json
244
-
245
- # Validator 1
246
- validator-1-node-key:
247
- file: network-config/validator-1/config/node_key.json
248
- validator-1-priv-val-key:
249
- file: network-config/validator-1/config/priv_validator_key.json
250
-
251
- # Validator 2
252
- validator-2-node-key:
253
- file: network-config/validator-2/config/node_key.json
254
- validator-2-priv-val-key:
255
- file: network-config/validator-2/config/priv_validator_key.json
256
-
257
- # Validator 3
258
- validator-3-node-key:
259
- file: network-config/validator-3/config/node_key.json
260
- validator-3-priv-val-key:
261
- file: network-config/validator-3/config/priv_validator_key.json
262
-
263
- # Seed 0
264
- seed-0-node-key:
265
- file: network-config/seed-0/config/node_key.json
266
- seed-0-priv-val-key:
267
- file: network-config/seed-0/config/priv_validator_key.json
268
-
269
- # Observer 0
270
- observer-0-node-key:
271
- file: network-config/observer-0/config/node_key.json
272
- observer-0-priv-val-key:
273
- file: network-config/observer-0/config/priv_validator_key.json
274
-
275
- volumes:
276
- validator-0-data:
277
- validator-1-data:
278
- validator-2-data:
279
- validator-3-data:
280
- seed-0-data:
281
- observer-0-data:
@@ -1,259 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Generates network configuration for an arbitrary amount of validators, observers, and seeds.
4
-
5
- set -euo pipefail
6
-
7
- # sed in macos requires extra argument
8
- if [[ "$OSTYPE" == "linux-gnu"* ]]; then
9
- SED_EXT=''
10
- elif [[ "$OSTYPE" == "darwin"* ]]; then
11
- SED_EXT='.orig'
12
- fi
13
-
14
- # Params
15
- CHAIN_ID=${1:-"cheqd"} # First parameter, default is "cheqd"
16
-
17
- VALIDATORS_COUNT=${2:-4} # Second parameter, default is 4
18
- SEEDS_COUNT=${3:-1} # Third parameter, default is 1
19
- OBSERVERS_COUNT=${4:-1} # Fourth parameter, default is 1
20
-
21
- function init_node() {
22
- NODE_HOME=$1
23
- NODE_MONIKER=$2
24
-
25
- echo "[${NODE_MONIKER}] Initializing"
26
-
27
- cheqd-noded init "${NODE_MONIKER}" --chain-id "${CHAIN_ID}" --home "${NODE_HOME}" 2> /dev/null
28
- cheqd-noded tendermint show-node-id --home "${NODE_HOME}" > "${NODE_HOME}/node_id.txt"
29
- cheqd-noded tendermint show-validator --home "${NODE_HOME}" > "${NODE_HOME}/node_val_pubkey.txt"
30
- }
31
-
32
- function configure_node() {
33
- NODE_HOME=$1
34
- NODE_MONIKER=$2
35
-
36
- echo "[${NODE_MONIKER}] Configuring app.toml and config.toml"
37
-
38
- APP_TOML="${NODE_HOME}/config/app.toml"
39
- CONFIG_TOML="${NODE_HOME}/config/config.toml"
40
-
41
- sed -i $SED_EXT 's/minimum-gas-prices = ""/minimum-gas-prices = "25ncheq"/g' "${APP_TOML}"
42
- sed -i $SED_EXT 's/enable = false/enable = true/g' "${APP_TOML}"
43
-
44
- sed -i $SED_EXT 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|g' "${CONFIG_TOML}"
45
- sed -i $SED_EXT 's|addr_book_strict = true|addr_book_strict = false|g' "${CONFIG_TOML}"
46
-
47
- sed -i $SED_EXT 's/timeout_propose = "3s"/timeout_propose = "500ms"/g' "${CONFIG_TOML}"
48
- sed -i $SED_EXT 's/timeout_prevote = "1s"/timeout_prevote = "500ms"/g' "${CONFIG_TOML}"
49
- sed -i $SED_EXT 's/timeout_precommit = "1s"/timeout_precommit = "500ms"/g' "${CONFIG_TOML}"
50
- sed -i $SED_EXT 's/timeout_commit = "5s"/timeout_commit = "500ms"/g' "${CONFIG_TOML}"
51
- }
52
-
53
- function configure_genesis() {
54
- NODE_HOME=$1
55
- NODE_MONIKER=$2
56
-
57
- echo "[${NODE_MONIKER}] Configuring genesis"
58
-
59
- GENESIS="${NODE_HOME}/config/genesis.json"
60
- GENESIS_TMP="${NODE_HOME}/config/genesis_tmp.json"
61
-
62
- # Default denom
63
- sed -i $SED_EXT 's/"stake"/"ncheq"/' "${GENESIS}"
64
-
65
- # Short voting period
66
- sed -i $SED_EXT 's/"voting_period": "172800s"/"voting_period": "12s"/' "${GENESIS}"
67
-
68
- # Test accounts
69
- BASE_ACCOUNT_1="cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96"
70
- # Mnemonic: sketch mountain erode window enact net enrich smoke claim kangaroo another visual write meat latin bacon pulp similar forum guilt father state erase bright
71
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_1}'", "coins": [{"denom": "ncheq", "amount": "100001000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
72
- mv "${GENESIS_TMP}" "${GENESIS}"
73
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_1}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
74
- mv "${GENESIS_TMP}" "${GENESIS}"
75
-
76
- BASE_ACCOUNT_2="cheqd1l9sq0se0jd3vklyrrtjchx4ua47awug5vsyeeh"
77
- # Mnemonic: ugly dirt sorry girl prepare argue door man that manual glow scout bomb pigeon matter library transfer flower clown cat miss pluck drama dizzy
78
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_2}'", "coins": [{"denom": "ncheq", "amount": "100001000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
79
- mv "${GENESIS_TMP}" "${GENESIS}"
80
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_2}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
81
- mv "${GENESIS_TMP}" "${GENESIS}"
82
-
83
- BASE_ACCOUNT_3="cheqd14wymr6h8a0rvynwayytssy5rhn3evltcpxh0zh"
84
- # Mnemonic: fix wheel picnic about army scan table fence device trust alter erupt wear donkey wood slender gold reunion grant quiz absurd tragic reform attitude
85
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_3}'", "coins": [{"denom": "ncheq", "amount": "100"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
86
- mv "${GENESIS_TMP}" "${GENESIS}"
87
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_3}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
88
- mv "${GENESIS_TMP}" "${GENESIS}"
89
-
90
- BASE_ACCOUNT_4="cheqd1c8tq9wcfwtunkunng5pe442jlmwns9sgve42mf"
91
- # Mnemonic: horn slim pigeon winner capable piano soul find ignore crawl arrow genuine magnet nasty basic lamp scissors treat stick arm dress elbow trash naive
92
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_4}'", "coins": [{"denom": "ncheq", "amount": "100001000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
93
- mv "${GENESIS_TMP}" "${GENESIS}"
94
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_4}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
95
- mv "${GENESIS_TMP}" "${GENESIS}"
96
-
97
- BASE_ACCOUNT_5="cheqd1xnx6fe4fg4etlaxm0ty25j3ae5thhadraskplv"
98
- # Mnemonic: blue town hobby lens hawk deputy father tissue state choose another liquid license start push iron limb visa taste mother cause history tackle fiber
99
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_5}'", "coins": [{"denom": "ncheq", "amount": "100001000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
100
- mv "${GENESIS_TMP}" "${GENESIS}"
101
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_5}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
102
- mv "${GENESIS_TMP}" "${GENESIS}"
103
-
104
- BASE_ACCOUNT_6="cheqd1makysw7c788c7fzkfzn7al80wyfl4at6jtjyg4"
105
- # Mnemonic: gallery hospital vicious demand orient piano melody vanish remind pistol elephant bracket olive kitten caution apart capital protect junior endorse run drama tiny patrol
106
- jq '.app_state.bank.balances += [{"address": "'${BASE_ACCOUNT_6}'", "coins": [{"denom": "ncheq", "amount": "100"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
107
- mv "${GENESIS_TMP}" "${GENESIS}"
108
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.auth.v1beta1.BaseAccount","address": "'${BASE_ACCOUNT_6}'", "pub_key": null,"account_number": "0","sequence": "0"}]' "$GENESIS" > "$GENESIS_TMP" && \
109
- mv "${GENESIS_TMP}" "${GENESIS}"
110
-
111
- BASE_VESTING_ACCOUNT="cheqd1lkqddnapqvz2hujx2trpj7xj6c9hmuq7uhl0md"
112
- # Mnemonic: coach index fence broken very cricket someone casino dial truth fitness stay habit such three jump exotic spawn planet fragile walk enact angry great
113
- # shellcheck disable=SC2089
114
- BASE_VESTING_COIN="{\"denom\":\"ncheq\",\"amount\":\"10001000000000000\"}"
115
- jq '.app_state.bank.balances += [{"address": "'${BASE_VESTING_ACCOUNT}'", "coins": [{"denom": "ncheq", "amount": "5000000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
116
- mv "${GENESIS_TMP}" "${GENESIS}"
117
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.vesting.v1beta1.BaseVestingAccount", "base_account": {"address": "'${BASE_VESTING_ACCOUNT}'","pub_key": null,"account_number": "0","sequence": "0"}, "original_vesting": ['"${BASE_VESTING_COIN}"'], "delegated_free": [], "delegated_vesting": [], "end_time": "1672531199"}]' "$GENESIS" > "$GENESIS_TMP" && \
118
- mv "${GENESIS_TMP}" "${GENESIS}"
119
-
120
- CONTINUOUS_VESTING_ACCOUNT="cheqd1353p46macvn444rupg2jstmx3tmz657yt9gl4l"
121
- # Mnemonic: phone worry flame safe panther dirt picture pepper purchase tiny search theme issue genre orange merit stove spoil surface color garment mind chuckle image
122
- jq '.app_state.bank.balances += [{"address": "'${CONTINUOUS_VESTING_ACCOUNT}'", "coins": [{"denom": "ncheq", "amount": "5000000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
123
- mv "${GENESIS_TMP}" "${GENESIS}"
124
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.vesting.v1beta1.ContinuousVestingAccount", "base_vesting_account": { "base_account": {"address": "'${CONTINUOUS_VESTING_ACCOUNT}'","pub_key": null,"account_number": "0","sequence": "0"}, "original_vesting": ['"${BASE_VESTING_COIN}"'], "delegated_free": [], "delegated_vesting": [], "end_time": "1672531199"}, "start_time": "1630352459"}]' "$GENESIS" > "$GENESIS_TMP" && \
125
- mv "${GENESIS_TMP}" "${GENESIS}"
126
-
127
- DELAYED_VESTING_ACCOUNT="cheqd1njwu33lek5jt4kzlmljkp366ny4qpqusahpyrj"
128
- # Mnemonic: pilot text keen deal economy donkey use artist divide foster walk pink breeze proud dish brown icon shaft infant level labor lift will tomorrow
129
- jq '.app_state.bank.balances += [{"address": "'${DELAYED_VESTING_ACCOUNT}'", "coins": [{"denom": "ncheq", "amount": "5000000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
130
- mv "${GENESIS_TMP}" "${GENESIS}"
131
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.vesting.v1beta1.DelayedVestingAccount", "base_vesting_account": { "base_account": {"address": "'${DELAYED_VESTING_ACCOUNT}'","pub_key": null,"account_number": "0","sequence": "0"}, "original_vesting": ['"${BASE_VESTING_COIN}"'], "delegated_free": [], "delegated_vesting": [], "end_time": "1672531199"}}]' "$GENESIS" > "$GENESIS_TMP" && \
132
- mv "${GENESIS_TMP}" "${GENESIS}"
133
-
134
- PERIODIC_VESTING_ACCOUNT="cheqd1uyngr0l3xtyj07js9sdew9mk50tqeq8lghhcfr"
135
- # Mnemonic: want merge flame plate trouble moral submit wing whale sick meat lonely yellow lens enable oyster slight health vast weird radar mesh grab olive
136
- jq '.app_state.bank.balances += [{"address": "'${PERIODIC_VESTING_ACCOUNT}'", "coins": [{"denom": "ncheq", "amount": "5000000000000000"}] }]' "$GENESIS" > "$GENESIS_TMP" && \
137
- mv "${GENESIS_TMP}" "${GENESIS}"
138
- jq '.app_state.auth.accounts += [{"@type": "/cosmos.vesting.v1beta1.PeriodicVestingAccount", "base_vesting_account": { "base_account": {"address": "'${PERIODIC_VESTING_ACCOUNT}'","pub_key": null,"account_number": "0","sequence": "0"}, "original_vesting": ['"${BASE_VESTING_COIN}"'], "delegated_free": [], "delegated_vesting": [], "end_time": "1672531199"}, "start_time": "1672531179", "vesting_periods": [{"length": "20", "amount": ['"${BASE_VESTING_COIN}"']}]}]' "$GENESIS" > "$GENESIS_TMP" && \
139
- mv "${GENESIS_TMP}" "${GENESIS}"
140
- }
141
-
142
-
143
- NETWORK_CONFIG_DIR="network-config"
144
- rm -rf $NETWORK_CONFIG_DIR
145
- mkdir $NETWORK_CONFIG_DIR
146
-
147
-
148
- # Generating node configurations
149
- for ((i=0 ; i<VALIDATORS_COUNT ; i++))
150
- do
151
- NODE_MONIKER="validator-$i"
152
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
153
-
154
- init_node "${NODE_HOME}" "${NODE_MONIKER}"
155
- configure_node "${NODE_HOME}" "${NODE_MONIKER}"
156
- done
157
-
158
- for ((i=0 ; i<SEEDS_COUNT ; i++))
159
- do
160
- NODE_MONIKER="seed-$i"
161
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
162
-
163
- init_node "${NODE_HOME}" "${NODE_MONIKER}"
164
- configure_node "${NODE_HOME}" "${NODE_MONIKER}"
165
- done
166
-
167
- for ((i=0 ; i<OBSERVERS_COUNT ; i++))
168
- do
169
- NODE_MONIKER="observer-$i"
170
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
171
-
172
- init_node "${NODE_HOME}" "${NODE_MONIKER}"
173
- configure_node "${NODE_HOME}" "${NODE_MONIKER}"
174
- done
175
-
176
-
177
- # Generating genesis
178
- TMP_NODE_MONIKER="tmp"
179
- TMP_NODE_HOME="${NETWORK_CONFIG_DIR}/${TMP_NODE_MONIKER}"
180
- init_node "${TMP_NODE_HOME}" "${TMP_NODE_MONIKER}"
181
- configure_genesis "${TMP_NODE_HOME}" "${TMP_NODE_MONIKER}"
182
-
183
- mkdir "${TMP_NODE_HOME}/config/gentx"
184
-
185
-
186
- # Adding genesis validators
187
- for ((i=0 ; i<VALIDATORS_COUNT ; i++))
188
- do
189
- NODE_MONIKER="validator-$i"
190
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
191
-
192
- cp "${TMP_NODE_HOME}/config/genesis.json" "${NODE_HOME}/config/genesis.json"
193
-
194
- cheqd-noded keys add "operator-$i" --keyring-backend "test" --home "${NODE_HOME}"
195
- cheqd-noded add-genesis-account "operator-$i" 20000000000000000ncheq --keyring-backend "test" --home "${NODE_HOME}"
196
-
197
- NODE_ID=$(cheqd-noded tendermint show-node-id --home "${NODE_HOME}")
198
- NODE_VAL_PUBKEY=$(cheqd-noded tendermint show-validator --home "${NODE_HOME}")
199
- cheqd-noded gentx "operator-$i" 1000000000000000ncheq --chain-id "${CHAIN_ID}" --node-id "${NODE_ID}" \
200
- --pubkey "${NODE_VAL_PUBKEY}" --keyring-backend "test" --home "${NODE_HOME}"
201
-
202
- cp "${NODE_HOME}/config/genesis.json" "${TMP_NODE_HOME}/config/genesis.json"
203
- cp -R "${NODE_HOME}/config/gentx/." "${TMP_NODE_HOME}/config/gentx"
204
- done
205
-
206
-
207
- echo "Collecting gentxs"
208
- cheqd-noded collect-gentxs --home "${TMP_NODE_HOME}"
209
- cheqd-noded validate-genesis --home "${TMP_NODE_HOME}"
210
-
211
- # Distribute final genesis
212
- for ((i=0 ; i<VALIDATORS_COUNT ; i++))
213
- do
214
- NODE_MONIKER="validator-$i"
215
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
216
-
217
- cp "${TMP_NODE_HOME}/config/genesis.json" "${NODE_HOME}/config/genesis.json"
218
- done
219
-
220
- for ((i=0 ; i<SEEDS_COUNT ; i++))
221
- do
222
- NODE_MONIKER="seed-$i"
223
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
224
-
225
- cp "${TMP_NODE_HOME}/config/genesis.json" "${NODE_HOME}/config/genesis.json"
226
- done
227
-
228
- for ((i=0 ; i<OBSERVERS_COUNT ; i++))
229
- do
230
- NODE_MONIKER="observer-$i"
231
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
232
-
233
- cp "${TMP_NODE_HOME}/config/genesis.json" "${NODE_HOME}/config/genesis.json"
234
- done
235
-
236
- # Leave one copy of genesis in the root of network-config
237
- cp "${TMP_NODE_HOME}/config/genesis.json" "${NETWORK_CONFIG_DIR}/genesis.json"
238
-
239
- # Generate seeds.txt
240
- SEEDS_STR=""
241
-
242
- for ((i=0 ; i<SEEDS_COUNT ; i++))
243
- do
244
- NODE_MONIKER="seed-$i"
245
- NODE_P2P_PORT="26656"
246
- NODE_HOME="${NETWORK_CONFIG_DIR}/${NODE_MONIKER}"
247
-
248
- if ((i != 0))
249
- then
250
- SEEDS_STR="${SEEDS_STR},"
251
- fi
252
-
253
- SEEDS_STR="${SEEDS_STR}$(cat "${NODE_HOME}/node_id.txt")@${NODE_MONIKER}:${NODE_P2P_PORT}"
254
- done
255
-
256
- echo "${SEEDS_STR}" > "${NETWORK_CONFIG_DIR}/seeds.txt"
257
-
258
- # We don't need the tmp node anymore
259
- rm -rf "${TMP_NODE_HOME}"
@@ -1,31 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -euox pipefail
4
-
5
- KEYRING_BACKEND="test"
6
-
7
- function import_key() {
8
- ALIAS=${1}
9
- MNEMONIC=${2}
10
-
11
- echo "Importing key: ${ALIAS}"
12
-
13
- if cheqd-noded keys show "${ALIAS}" --keyring-backend ${KEYRING_BACKEND}
14
- then
15
- echo "Key ${ALIAS} already exists"
16
- return 0
17
- fi
18
-
19
- echo "${MNEMONIC}" | cheqd-noded keys add "${ALIAS}" --keyring-backend ${KEYRING_BACKEND} --recover
20
- }
21
-
22
- import_key "base_account_1" "sketch mountain erode window enact net enrich smoke claim kangaroo another visual write meat latin bacon pulp similar forum guilt father state erase bright"
23
- import_key "base_account_2" "ugly dirt sorry girl prepare argue door man that manual glow scout bomb pigeon matter library transfer flower clown cat miss pluck drama dizzy"
24
- import_key "base_account_3" "fix wheel picnic about army scan table fence device trust alter erupt wear donkey wood slender gold reunion grant quiz absurd tragic reform attitude"
25
- import_key "base_account_4" "horn slim pigeon winner capable piano soul find ignore crawl arrow genuine magnet nasty basic lamp scissors treat stick arm dress elbow trash naive"
26
- import_key "base_account_5" "blue town hobby lens hawk deputy father tissue state choose another liquid license start push iron limb visa taste mother cause history tackle fiber"
27
- import_key "base_account_6" "gallery hospital vicious demand orient piano melody vanish remind pistol elephant bracket olive kitten caution apart capital protect junior endorse run drama tiny patrol"
28
- import_key "base_vesting_account" "coach index fence broken very cricket someone casino dial truth fitness stay habit such three jump exotic spawn planet fragile walk enact angry great"
29
- import_key "continuous_vesting_account" "phone worry flame safe panther dirt picture pepper purchase tiny search theme issue genre orange merit stove spoil surface color garment mind chuckle image"
30
- import_key "delayed_vesting_account" "pilot text keen deal economy donkey use artist divide foster walk pink breeze proud dish brown icon shaft infant level labor lift will tomorrow"
31
- import_key "periodic_vesting_account" "want merge flame plate trouble moral submit wing whale sick meat lonely yellow lens enable oyster slight health vast weird radar mesh grab olive"
package/jest.config.js DELETED
@@ -1,6 +0,0 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- modulePathIgnorePatterns: ["tests/testutils.test.ts"],
6
- };