Skip to content

Commit 8ae73bc

Browse files
authored
docs: update staging docs with testnet docs (#973) (#985)
2 parents 13cdc86 + fe29562 commit 8ae73bc

File tree

6 files changed

+61
-27
lines changed

6 files changed

+61
-27
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ You can use the link to the explorer to check the status of your transaction.
7272
aligned verify-proof-onchain \
7373
--aligned-verification-data ~/.aligned/aligned_verification_data/*.json \
7474
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
75-
--chain holesky
75+
--chain holesky \
76+
--payment_service_addr 0x815aeCA64a974297942D2Bbf034ABEe22a38A003
7677
```
7778
7879
This is reading the result of the verification of the proof in Ethereum.
@@ -92,7 +93,7 @@ If the proof wasn't verified you should get this result:
9293
Aligned works in:
9394
- MacOS Arm64 (M1 or higher)
9495
- Linux x86 with GLIBC_2.32 or superior (For example, Ubuntu 22.04 or higher)
95-
If you don't meet these requirements, clone the repository, install rust, and then run:
96+
If you don't meet these requirements, clone the repository, install rust, and then run:
9697
9798
```bash
9899
make uninstall_aligned

docs/1_introduction/1_getting_started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ Use the link in the response to check the status of your transaction in the Alig
5353
aligned verify-proof-onchain \
5454
--aligned-verification-data ~/.aligned/aligned_verification_data/*.json \
5555
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
56-
--chain holesky
56+
--chain holesky \
57+
--payment_service_addr 0x815aeCA64a974297942D2Bbf034ABEe22a38A003
5758
```
5859
5960
This is reading the result of the proof verification in Ethereum.

docs/3_guides/1_SDK_how_to.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this SDK in your Rust project, add the following to your `Cargo.toml`:
1212

1313
```toml
1414
[dependencies]
15-
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.5.2" }
15+
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.6.0" }
1616
```
1717

1818
To find the latest release tag go to [releases](https://github.com/yetanotherco/aligned_layer/releases) and copy the

docs/3_guides/2_integrating_aligned_into_your_application.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ The proof submission and verification can be done either with the SDK or by usin
118118

119119
To submit a proof using the SDK, you can use the `submit_and_wait_verification` function.
120120
This function submits the proof to aligned and waits for it to be verified in Aligned.
121-
Alternatively you can call `submit` if you dont want to wait for proof verification.
121+
Alternatively you can call `submit` if you don't want to wait for proof verification.
122+
122123
The following code is an example of how to submit a proof using the SDK:
123124

124125
```rust
@@ -162,9 +163,6 @@ async fn submit_proof_to_aligned(
162163
#[tokio::main]
163164
async fn main() {
164165
let wallet = // Initialize wallet
165-
166-
let wallet = wallet.with_chain_id(17000u64)
167-
168166
let proof = // Generate or obtain proof
169167

170168
match submit_proof_to_aligned(proof, wallet).await {
@@ -174,6 +172,41 @@ async fn main() {
174172
}
175173
```
176174

175+
The following code is an example of how to verify the proof was correctly verified in Aligned using the SDK:
176+
177+
```rust
178+
use aligned_sdk::sdk::verify_proof_onchain;
179+
use aligned_sdk::types::{AlignedVerificationData, Chain};
180+
use ethers::prelude::*;
181+
use tokio::time::{sleep, Duration};
182+
183+
async fn wait_for_proof_verification(
184+
aligned_verification_data: AlignedVerificationData,
185+
rpc_url: String,
186+
) -> Result<(), anyhow::Error> {
187+
for _ in 0..10 {
188+
if verify_proof_onchain(aligned_verification_data.clone(), Chain::Holesky, rpc_url.as_str()).await.is_ok_and(|r| r) {
189+
println!("Proof verified successfully.");
190+
return Ok(());
191+
}
192+
println!("Proof not verified yet. Waiting 10 seconds before checking again...");
193+
sleep(Duration::from_secs(10)).await;
194+
}
195+
anyhow::bail!("Proof verification failed")
196+
}
197+
198+
#[tokio::main]
199+
async fn main() {
200+
let aligned_verification_data = // Obtain aligned verification data
201+
let rpc_url = "https://ethereum-holesky-rpc.publicnode.com".to_string();
202+
203+
match wait_for_proof_verification(aligned_verification_data, rpc_url).await {
204+
Ok(_) => println!("Proof verified"),
205+
Err(err) => println!("Error: {:?}", err),
206+
}
207+
}
208+
```
209+
177210
You can find an example of the proof submission and verification in the [ZKQuiz Program](../../examples/zkquiz/quiz/script/src/main.rs).
178211

179212
This example generates a proof, instantiates a wallet to submit the proof, and then submits the proof to Aligned for verification. It then waits for the proof to be verified in Aligned.

docs/3_guides/3_validating_public_input.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This guide assumes you are in the `examples/validating-public-input` directory.
1010

1111
## Generate your ZK Proof
1212

13-
> [!IMPORTANT]
13+
> [!IMPORTANT]
1414
> To generate the proof ensure you have [docker](https://www.docker.com/get-started/) installed and the docker daemon running.
1515
> This is necessary to ensure deterministic builds of the binary we want to generate a proof of. If not used, builds may differ depending on the system you are running on. To know more about this, check [this link](https://dev.risczero.com/terminology#deterministic-builds) from RiscZero docs.
1616
@@ -119,7 +119,6 @@ contract FibonacciValidator {
119119
return (first, second);
120120
}
121121
}
122-
123122
```
124123

125124
### Explanation

examples/zkquiz/quiz/program/Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)