#blockchain #tangle #subxt

no-std tangle-subxt

Rust bindings and interface to interact with Tangle Network using subxt

15 breaking releases

Uses new Rust 2024

0.17.0 May 14, 2025
0.15.0 Apr 11, 2025
0.14.0 Mar 13, 2025
0.7.1 Dec 9, 2024
0.6.0 Nov 27, 2024

#971 in Magic Beans

Download history 558/week @ 2025-02-01 254/week @ 2025-02-08 316/week @ 2025-02-15 504/week @ 2025-02-22 382/week @ 2025-03-01 805/week @ 2025-03-08 750/week @ 2025-03-15 589/week @ 2025-03-22 372/week @ 2025-03-29 577/week @ 2025-04-05 546/week @ 2025-04-12 365/week @ 2025-04-19 560/week @ 2025-04-26 601/week @ 2025-05-03 641/week @ 2025-05-10 212/week @ 2025-05-17

2,053 downloads per month
Used in 29 crates (17 directly)

Unlicense and maybe GPL-3.0-only

6MB
152K SLoC

Tangle-Subxt

Rust interface to interact with tangle node via RPC


Downloading metadata from a Substrate node

Use the subxt-cli tool to download the metadata for your target runtime from a node.

  1. Install:
cargo install subxt-cli@0.39.0 --force
  1. To Save the metadata of tangle: Run the release build of the tangle node, then on another terminal run:
subxt metadata -f bytes > ./metadata/tangle-testnet-runtime.scale
  1. Generating the subxt code from the metadata:
subxt codegen --file metadata/tangle-testnet-runtime.scale \
    --crate "::subxt_core" \
    --derive Clone \
    --derive Eq \
    --derive PartialEq \
    --attributes-for-type tangle_primitives::services::field::Field='#[codec(dumb_trait_bound)]' \
    --derive-for-type tangle_primitives::services::service::ServiceBlueprint=serde::Serialize,recursive \
    --derive-for-type tangle_primitives::services::service::ServiceBlueprint=serde::Deserialize,recursive | rustfmt --edition=2021 --emit=stdout > src/tangle_testnet_runtime.rs

Local Testing

You can run following tests to trigger Job pallet events for local development.

  1. Run Local Tangle network
./scripts/run-standalone-local.sh --clean
  1. Run Test
cargo test test_job_submission_event

Dependencies

~18–50MB
~819K SLoC