@@ -156,10 +156,10 @@ You can verify that the aggregator signs **CardanoTransactions** by running the
156
156
wget -q -O - YOUR_AGGREGATOR_ENDPOINT | jq ' .capabilities.signed_entity_types | contains(["CardanoTransactions"])'
157
157
```
158
158
159
- For example with the aggregator on ` testing-sanchonet ` Mithril network:
159
+ For example with the aggregator on ` pre-release-preview ` Mithril network:
160
160
161
161
``` bash
162
- wget -q -O - https://aggregator.testing-sanchonet .api.mithril.network/aggregator | jq ' .capabilities.signed_entity_types | contains(["CardanoTransactions"])'
162
+ wget -q -O - https://aggregator.pre-release-preview .api.mithril.network/aggregator | jq ' .capabilities.signed_entity_types | contains(["CardanoTransactions"])'
163
163
```
164
164
165
165
:::
@@ -191,8 +191,68 @@ console.log(
191
191
);
192
192
```
193
193
194
+ With the same logic as above, if the aggregator signs ** CardanoStakeDistribution** , you can add the code below to the previous example:
195
+
194
196
::: tip
195
197
196
- You can read the complete [ Rust developer documentation] ( https://mithril.network/rust-doc/mithril_client_wasm/index.html ) .
198
+ You can verify that the aggregator signs ** CardanoStakeDistribution** by running the command below:
199
+
200
+ ``` bash
201
+ wget -q -O - YOUR_AGGREGATOR_ENDPOINT | jq ' .capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])'
202
+ ```
203
+
204
+ For example with the aggregator on ` testing-preview ` Mithril network:
205
+
206
+ ``` bash
207
+ wget -q -O - https://aggregator.testing-preview.api.mithril.network/aggregator | jq ' .capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])'
208
+ ```
197
209
198
210
:::
211
+
212
+ ``` js
213
+ let cardano_stake_distributions_list =
214
+ await client .unstable .list_cardano_stake_distributions ();
215
+ console .log (" cardano stake distributions:" , cardano_stake_distributions_list);
216
+
217
+ let last_cardano_stake_distribution =
218
+ await client .unstable .get_cardano_stake_distribution (
219
+ cardano_stake_distributions_list[0 ].hash ,
220
+ );
221
+ console .log (
222
+ " last_cardano_stake_distribution:" ,
223
+ last_cardano_stake_distribution,
224
+ );
225
+
226
+ let certificate = await client .get_mithril_certificate (
227
+ last_cardano_stake_distribution .certificate_hash ,
228
+ );
229
+ console .log (" certificate:" , certificate);
230
+
231
+ let last_certificate_from_chain = await client .verify_certificate_chain (
232
+ certificate .hash ,
233
+ );
234
+ console .log (
235
+ " verify certificate chain OK, last_certificate_from_chain:" ,
236
+ last_certificate_from_chain,
237
+ );
238
+
239
+ let cardano_stake_distribution_message =
240
+ await client .unstable .compute_cardano_stake_distribution_message (
241
+ certificate,
242
+ last_cardano_stake_distribution,
243
+ );
244
+ console .log (
245
+ " cardano_stake_distribution_message:" ,
246
+ cardano_stake_distribution_message,
247
+ );
248
+
249
+ let valid_cardano_stake_distribution_message =
250
+ await client .verify_message_match_certificate (
251
+ cardano_stake_distribution_message,
252
+ last_certificate_from_chain,
253
+ );
254
+ console .log (
255
+ " valid_cardano_stake_distribution_message:" ,
256
+ valid_cardano_stake_distribution_message,
257
+ );
258
+ ```
0 commit comments