Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: update aggregator in examples #2150

Merged
merged 7 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/client-cardano-stake-distribution/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "client-cardano-stake-distribution"
description = "Mithril client cardano stake distribution example"
version = "0.1.4"
version = "0.1.5"
authors = ["[email protected]", "[email protected]"]
documentation = "https://mithril.network/doc"
edition = "2021"
Expand Down
9 changes: 6 additions & 3 deletions examples/client-cardano-stake-distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This example shows how to implement a Mithril client and use the features related to the `Cardano stake distribution` type.

In this example, the client interacts by default with a real aggregator on the network `testing-preview` to:
In this example, the client interacts by default with a real aggregator on the network `release-preprod` to:

- list the available Cardano stake distributions
- get a single Cardano stake distribution
Expand All @@ -17,6 +17,9 @@ The crates [`slog`](https://docs.rs/slog/latest/slog/) and [`slog_term`](https:/
## Build and run the example

```bash
# Switch to the latest release tag
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')

# Build from the crate directory
cargo build

Expand All @@ -26,8 +29,8 @@ cargo run
# Run with your custom network configuration
AGGREGATOR_ENDPOINT=YOUR_AGGREGATOR_ENDPOINT GENESIS_VERIFICATION_KEY=YOUR_GENESIS_VERIFICATION_KEY cargo run

# Example with 'pre-release-preview' network
AGGREGATOR_ENDPOINT=https://aggregator.pre-release-preview.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey) cargo run
# Example with 'release-preprod' network
AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey) cargo run
```

## Links
Expand Down
4 changes: 2 additions & 2 deletions examples/client-cardano-stake-distribution/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This example shows how to implement a Mithril client and use its features.
//!
//! In this example, the client interacts by default with a real aggregator (`testing-preview`) to get the data.
//! In this example, the client interacts by default with a real aggregator (`release-preprod`) to get the data.

use anyhow::anyhow;
use clap::Parser;
Expand All @@ -24,7 +24,7 @@ pub struct Args {
#[clap(
long,
env = "AGGREGATOR_ENDPOINT",
default_value = "https://aggregator.testing-preview.api.mithril.network/aggregator"
default_value = "https://aggregator.release-preprod.api.mithril.network/aggregator"
)]
aggregator_endpoint: String,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/client-cardano-transaction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "client-cardano-transaction"
description = "Mithril client cardano-transaction example"
version = "0.1.14"
version = "0.1.15"
authors = ["[email protected]", "[email protected]"]
documentation = "https://mithril.network/doc"
edition = "2021"
Expand Down
7 changes: 5 additions & 2 deletions examples/client-cardano-transaction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ In this example, the client interacts with an aggregator and performs the follow
## Build and run the example

```bash
# Switch to the latest release tag
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')

# Build from the crate directory
cargo build

# Run from the crate directory
AGGREGATOR_ENDPOINT=YOUR_AGGREGATOR_ENDPOINT GENESIS_VERIFICATION_KEY=YOUR_GENESIS_VERIFICATION_KEY cargo run CARDANO_TX_HASH1,CARDANO_TX_HASH2,CARDANO_TX_HASH3

# Example with from 'testing-sanchonet' network
AGGREGATOR_ENDPOINT=https://aggregator.testing-sanchonet.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-sanchonet/genesis.vkey) cargo run db0dfab664045b117375a743a925385a7a3fa6a104f8bd95fa0f748088bcaff0,b457a094439cc5e371474f5758b4ecded3e1b035fe0717e39d78080e6fe169b2
# Example with from 'release-preprod' network
AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey) cargo run 0ea207ab71493f012faab0d1f8151eaf931901141c1482ce6e9a501498076484,326b5b67d926937bf19c6113d0957a39f2eae9df94875ce8a96eff5c8521303b
```

## Links
Expand Down
2 changes: 1 addition & 1 deletion examples/client-cardano-transaction/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct Args {
#[clap(
long,
env = "AGGREGATOR_ENDPOINT",
default_value = "https://aggregator.testing-sanchonet.api.mithril.network/aggregator"
default_value = "https://aggregator.release-preprod.api.mithril.network/aggregator"
)]
aggregator_endpoint: String,

Expand Down
2 changes: 1 addition & 1 deletion examples/client-mithril-stake-distribution/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "client-mithril-stake-distribution"
description = "Mithril client stake distribution example"
version = "0.2.2"
version = "0.2.3"
authors = ["[email protected]", "[email protected]"]
documentation = "https://mithril.network/doc"
edition = "2021"
Expand Down
9 changes: 6 additions & 3 deletions examples/client-mithril-stake-distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This example shows how to implement a Mithril client and use the features related to the `Mithril stake distribution` type.

In this example, the client interacts by default with a real aggregator on the network `testing-preview` to:
In this example, the client interacts by default with a real aggregator on the network `release-preprod` to:

- list the available Mithril stake distributions
- get a single Mithril stake distribution
Expand All @@ -17,6 +17,9 @@ The crates [`slog`](https://docs.rs/slog/latest/slog/) and [`slog_term`](https:/
## Build and run the example

```bash
# Switch to the latest release tag
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')

# Build from the crate directory
cargo build

Expand All @@ -26,8 +29,8 @@ cargo run
# Run with your custom network configuration
AGGREGATOR_ENDPOINT=YOUR_AGGREGATOR_ENDPOINT GENESIS_VERIFICATION_KEY=YOUR_GENESIS_VERIFICATION_KEY cargo run

# Example with 'pre-release-preview' network
AGGREGATOR_ENDPOINT=https://aggregator.pre-release-preview.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey) cargo run
# Example with 'release-preprod' network
AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey) cargo run
```

## Links
Expand Down
4 changes: 2 additions & 2 deletions examples/client-mithril-stake-distribution/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This example shows how to implement a Mithril client and use its features.
//!
//! In this example, the client interacts by default with a real aggregator (`testing-preview`) to get the data.
//! In this example, the client interacts by default with a real aggregator (`release-preprod`) to get the data.

use anyhow::anyhow;
use clap::Parser;
Expand All @@ -24,7 +24,7 @@ pub struct Args {
#[clap(
long,
env = "AGGREGATOR_ENDPOINT",
default_value = "https://aggregator.testing-preview.api.mithril.network/aggregator"
default_value = "https://aggregator.release-preprod.api.mithril.network/aggregator"
)]
aggregator_endpoint: String,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/client-snapshot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "client-snapshot"
description = "Mithril client snapshot example"
version = "0.1.18"
version = "0.1.19"
authors = ["[email protected]", "[email protected]"]
documentation = "https://mithril.network/doc"
edition = "2021"
Expand Down
9 changes: 6 additions & 3 deletions examples/client-snapshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This example shows how to implement a Mithril client and use its features related to the `Snapshot` type.

In this example, the client interacts by default with a real aggregator on the network `testing-preview` to:
In this example, the client interacts by default with a real aggregator on the network `release-preprod` to:

- list the available snapshots
- get a single snapshot
Expand All @@ -19,6 +19,9 @@ The crate [indicatif](https://docs.rs/indicatif/latest/indicatif/) is used to ni
## Build and run the example

```bash
# Switch to the latest release tag
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')

# Build from the crate directory
cargo build

Expand All @@ -28,8 +31,8 @@ cargo run
# Run with your custom network configuration
AGGREGATOR_ENDPOINT=YOUR_AGGREGATOR_ENDPOINT GENESIS_VERIFICATION_KEY=YOUR_GENESIS_VERIFICATION_KEY cargo run

# Example with 'pre-release-preview' network
AGGREGATOR_ENDPOINT=https://aggregator.pre-release-preview.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey) cargo run
# Example with 'release-preprod' network
AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey) cargo run
```

## Links
Expand Down
4 changes: 2 additions & 2 deletions examples/client-snapshot/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This example shows how to implement a Mithril client and use its features.
//!
//! In this example, the client interacts by default with a real aggregator (`testing-preview`) to get the data.
//! In this example, the client interacts by default with a real aggregator (`release-preprod`) to get the data.
//!
//! A [FeedbackReceiver] using [indicatif] is used to nicely report the progress to the console.

Expand Down Expand Up @@ -33,7 +33,7 @@ pub struct Args {
#[clap(
long,
env = "AGGREGATOR_ENDPOINT",
default_value = "https://aggregator.testing-preview.api.mithril.network/aggregator"
default_value = "https://aggregator.release-preprod.api.mithril.network/aggregator"
)]
aggregator_endpoint: String,
}
Expand Down
10 changes: 8 additions & 2 deletions examples/client-wasm-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This example shows how to implement a Mithril client and use its features in a Node.js environment.

In this example, the client interacts by default with a real aggregator on the network `testing-sanchonet` to:
In this example, the client interacts by default with a real aggregator on the network `release-preprod` to:

- Mithril Stake Distribution:
- list the available Mithril Stake Distributions
Expand All @@ -20,7 +20,13 @@ In this example, the client interacts by default with a real aggregator on the n

## Build and run the example

First you need to compile the Mithril client Wasm library:
First you need to switch to the latest release tag:

```bash
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')
```

Compile the Mithril client Wasm library:

```bash
make -C ../../mithril-client-wasm build
Expand Down
6 changes: 3 additions & 3 deletions examples/client-wasm-nodejs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MithrilClient } from "@mithril-dev/mithril-client-wasm";

let aggregator_endpoint = "https://aggregator.testing-sanchonet.api.mithril.network/aggregator";
let aggregator_endpoint = "https://aggregator.release-preprod.api.mithril.network/aggregator";
let genesis_verification_key =
"5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d";
let certificate_chain_validated_occurs = false;
Expand Down Expand Up @@ -109,8 +109,8 @@ async function main() {

console.log(7, "Getting transaction proof...");
const proof = await client.get_cardano_transaction_proofs([
"eac09f970f47ef3ab378db9232914e146773853397e79b904f1a45123a23c21f",
"81fe7a5dab42867ef309b6d7210158bf99331884ac3c3b6c7188a8c9c18d5974",
"0ea207ab71493f012faab0d1f8151eaf931901141c1482ce6e9a501498076484",
"326b5b67d926937bf19c6113d0957a39f2eae9df94875ce8a96eff5c8521303b",
"320c13f4a3e51f6f4f66fcd9007e02bf658aa4ee9a88a509028d867d3b8a8e9a",
]);
console.log("Certificate hash of the returned proof", proof.certificate_hash);
Expand Down
4 changes: 2 additions & 2 deletions examples/client-wasm-nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/client-wasm-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client-wasm-nodejs",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
10 changes: 8 additions & 2 deletions examples/client-wasm-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This example shows how to implement a Mithril client and use its features in a Web browser environment.

In this example, the client interacts by default with a real aggregator on the network `testing-sanchonet` to:
In this example, the client interacts by default with a real aggregator on the network `release-preprod` to:

- Mithril Stake Distribution:
- list the available Mithril Stake Distributions
Expand All @@ -20,7 +20,13 @@ In this example, the client interacts by default with a real aggregator on the n

## Build and run the example

First you need to compile the Mithril client Wasm library:
First you need to switch to the latest release tag:

```bash
git checkout tags/$(curl -sSL https://api.github.com/repos/input-output-hk/mithril/releases/latest | jq -r '.tag_name')
```

Compile the Mithril client Wasm library:

```bash
make -C ../../mithril-client-wasm build
Expand Down
8 changes: 4 additions & 4 deletions examples/client-wasm-web/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import initMithrilClient, { MithrilClient } from "@mithril-dev/mithril-client-wasm";

// This example uses sanchonet network aggregator as it handles Cardano transactions entity type
let aggregator_endpoint = "https://aggregator.testing-sanchonet.api.mithril.network/aggregator";
// This example uses 'release-preprod' network aggregator as it handles Cardano transactions entity type
let aggregator_endpoint = "https://aggregator.release-preprod.api.mithril.network/aggregator";
let genesis_verification_key =
"5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d";
let certificate_chain_validated_occurs = false;
Expand Down Expand Up @@ -133,8 +133,8 @@ console.log("valid_stake_distribution_message:", valid_stake_distribution_messag

displayStepInDOM(7, "Getting transaction proof...");
const proof = await client.get_cardano_transaction_proofs([
"eac09f970f47ef3ab378db9232914e146773853397e79b904f1a45123a23c21f",
"81fe7a5dab42867ef309b6d7210158bf99331884ac3c3b6c7188a8c9c18d5974",
"0ea207ab71493f012faab0d1f8151eaf931901141c1482ce6e9a501498076484",
"326b5b67d926937bf19c6113d0957a39f2eae9df94875ce8a96eff5c8521303b",
"320c13f4a3e51f6f4f66fcd9007e02bf658aa4ee9a88a509028d867d3b8a8e9a",
]);
displayMessageInDOM("Certificate hash of the returned proof", proof.certificate_hash);
Expand Down
4 changes: 2 additions & 2 deletions examples/client-wasm-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/client-wasm-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client-wasm-web",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"scripts": {
"build": "webpack --config webpack.config.js",
Expand Down