#tangle #subxt #blockchain

no-std tangle-subxt

Rust bindings and interface to interact with Tangle Network using subxt

7 releases (breaking)

new 0.6.0 Nov 27, 2024
0.5.0 Nov 4, 2024
0.4.0 Oct 21, 2024
0.3.0 Sep 6, 2024
0.1.5 Aug 26, 2024

#4 in #subxt

Download history 108/week @ 2024-08-07 52/week @ 2024-08-14 230/week @ 2024-08-21 73/week @ 2024-08-28 280/week @ 2024-09-04 68/week @ 2024-09-11 74/week @ 2024-09-18 77/week @ 2024-09-25 112/week @ 2024-10-02 46/week @ 2024-10-09 187/week @ 2024-10-16 243/week @ 2024-10-23 224/week @ 2024-10-30 293/week @ 2024-11-06 174/week @ 2024-11-13 116/week @ 2024-11-20

828 downloads per month
Used in 6 crates (5 directly)

Unlicense and maybe GPL-3.0-or-later…

4.5MB
119K 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.37.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::ServiceBlueprint=serde::Serialize,recursive\
    --derive-for-type tangle_primitives::services::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

~17–35MB
~538K SLoC