Files
pezkuwichain 7af0bcd262 Complete rebrand: Polkadot→Pezkuwi, Substrate→Bizinikiwi
- Replace PolkadotConfig with PezkuwiConfig
- Replace SubstrateConfig with BizinikiwConfig
- Rename config module files (polkadot.rs→pezkuwi.rs, substrate.rs→bizinikiwi.rs)
- Update all documentation and examples
- All 165 files updated, cargo check passes
2025-12-21 21:42:34 +03:00

29 lines
1.1 KiB
Rust

#![allow(missing_docs)]
use pezkuwi_subxt_signer::sr25519::dev;
use pezkuwi_subxt::{OnlineClient, PezkuwiConfig};
// Generate an interface that we can use from the node's metadata.
#[pezkuwi_subxt::subxt(runtime_metadata_path = "../artifacts/pezkuwi_metadata_small.scale")]
pub mod pezkuwi {}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new API client, configured to talk to Pezkuwi nodes.
let api = OnlineClient::<PezkuwiConfig>::new().await?;
let account = dev::alice().public_key().into();
// Build a storage query to access account information.
let storage_query = pezkuwi::storage().system().account();
// Use that query to access a storage entry, fetch a result and decode the value.
// The static address knows that fetching requires a tuple of one value, an
// AccountId32.
let client_at = api.storage().at_latest().await?;
let account_info = client_at.entry(storage_query)?.fetch((account,)).await?.decode()?;
// The static address that we got from the subxt macro knows the expected input
// and return types, so it is decoded into a static type for us.
println!("Alice: {account_info:?}");
Ok(())
}