Skip to content

Commit

Permalink
nft minting example
Browse files Browse the repository at this point in the history
  • Loading branch information
tadeohepperle committed Jul 6, 2023
1 parent d6d0c79 commit 4a632f1
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 75 deletions.
111 changes: 107 additions & 4 deletions examples/parachain-example/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 examples/parachain-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = ["./metadata"]

[dependencies]
subxt = { path = "../../subxt" }
subxt-signer = { path = "../../signer", features=["subxt"] }
futures = { version = "0.3.27", default-features = false, features = ["std"] }
tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"] }
metadata = { path = "./metadata" }
Expand Down
4 changes: 2 additions & 2 deletions examples/parachain-example/asset-hub-zombienet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_image = "docker.io/parity/polkadot:latest"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "kusama-local"
chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
Expand All @@ -15,7 +15,7 @@ chain = "kusama-local"

[[parachains]]
id = 100
chain = "asset-hub-kusama-local"
chain = "asset-hub-polkadot-local"

[parachains.collator]
name = "collator01"
Expand Down
17 changes: 10 additions & 7 deletions examples/parachain-example/src/bin/fetch_blocks.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
//! In this example we connect to the official polkadot asset hub parachain and subscribe to blocks that get produced.
//! You can just switch out `StatemintConfig` for `StatemintConfig2` or `StatemintConfig3` and the behavior should be the same.
//!
//! To run this example:
//! ```txt
//! cargo run --bin fetch_blocks
//! ```
use futures::StreamExt;
use subxt::OnlineClient;
use parachain_example::StatemintConfig;
use subxt::OnlineClient;

/// In this example we connect to the official polkadot asset hub parachain and subscribe to blocks that get produced.
/// You can just switch out `StatemintConfig` for `StatemintConfig2` or `StatemintConfig3` and the behavior should be the same.
///
/// To run this example:
/// ```txt
/// cargo run --bin fetch_blocks
/// ```
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let rpc_endpoint = "wss://polkadot-asset-hub-rpc.polkadot.io:443";
Expand All @@ -35,6 +37,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ext = ext?;
let idx = ext.index();
let events = ext.events().await?;

// here we make use of the generated metadata code:
let decoded_ext = ext.as_root_extrinsic::<metadata::statemint::Call>();

Expand Down
Loading

0 comments on commit 4a632f1

Please sign in to comment.