Skip to content
Draft
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
11 changes: 11 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/testing/node-builder",
"crates/testing/prover",
"crates/web-client",
"crates/rpc-client",
]

default-members = ["bin/miden-cli", "crates/rust-client"]
Expand Down
20 changes: 20 additions & 0 deletions crates/rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
authors.workspace = true
description = "RPC client for Miden network"
edition.workspace = true
license.workspace = true
name = "miden-rpc-client"
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lib]
crate-type = ["lib"]

[dependencies]
miden-objects = { workspace = true }
miden-node-proto = { branch = "next", git = "https://github.com/0xMiden/miden-node" }

tonic = { version = "0.13", features = ["tls-native-roots", "tls-ring", "transport"] }
tokio = { workspace = true }
hex = { workspace = true }
43 changes: 43 additions & 0 deletions crates/rpc-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# miden-rpc-client

Minimal Miden RPC client.

## Usage

```rust
use miden_rpc_client::MidenRpcClient;

#[tokio::main]
async fn main() -> Result<(), String> {
// Connect to Miden node
let mut client = MidenRpcClient::connect("https://node.example.com").await?;

// Get node status
let status = client.get_status().await?;
println!("Node version: {}", status.version);

// Get account details
let account_details = client.get_account_details(&account_id).await?;

Ok(())
}
```

## Available RPC Methods

1. `get_status` - Node status information
2. `get_block_header` - Block headers with optional MMR proof
3. `submit_transaction` - Submit single proven transaction
4. `sync_state` - Full state sync (accounts, notes, nullifiers)
5. `check_nullifiers` - Nullifier proofs
6. `get_notes_by_id` - Notes matching IDs
7. `get_account_commitment` - Fetch account commitment as hex string
8. `get_account_details` - Full account details including serialized data
9. `get_account_proof` - Account state proof with storage
10. `get_block_by_number` - Raw block data
11. `submit_proven_batch` - Submit transaction batch
12. `sync_account_vault` - Account vault updates within block range
13. `sync_notes` - Note synchronization by tags
14. `sync_storage_maps` - Storage map updates within block range

For advanced usage, proto types are exported and accessible via `client_mut()`.
Loading
Loading