-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tangle subxt * clippy fix * export subxt and scale code package * remove build script
- Loading branch information
1 parent
81c5c46
commit 8be20aa
Showing
7 changed files
with
37,725 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "tangle-subxt" | ||
version ={ workspace = true } | ||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
|
||
[dependencies] | ||
parity-scale-codec = { workspace = true, optional = true } | ||
scale-info = { workspace = true, optional = true } | ||
subxt = { version = "0.31.0", optional = true } | ||
subxt-metadata = { version = "0.31.0", optional = true } | ||
subxt-codegen = { version = "0.31.0", optional = true } | ||
serde_json = "1" | ||
syn = { version = "2", features = ["full", "parsing"], optional = true } | ||
|
||
|
||
[features] | ||
default = [ | ||
"subxt", | ||
"subxt-codegen", | ||
"subxt-metadata", | ||
"parity-scale-codec", | ||
"scale-info", | ||
"syn" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<h1 align="center">Tangle-Subxt</h1> | ||
|
||
<p align="center"> | ||
<strong>Rust interface to interact with tangle node via RPC</strong> | ||
<br /> | ||
</p> | ||
|
||
<br /> | ||
|
||
### Downloading metadata from a Substrate node | ||
|
||
Use the [`subxt-cli`](https://lib.rs/crates/subxt-cli) tool to download the metadata for your target runtime from a node. | ||
|
||
1. Install: | ||
```bash | ||
cargo install subxt-cli | ||
``` | ||
|
||
2. To Save the metadata of `tangle`: | ||
Run the release build of the `tangle` node, then on another terminal run: | ||
|
||
```bash | ||
subxt metadata -f bytes > ./metadata/tangle-runtime.scale | ||
``` | ||
|
||
3. Generating the subxt code from the metadata: | ||
|
||
```bash | ||
subxt codegen --file metadata/tangle-runtime.scale > src/tangle_runtime.rs | ||
``` | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![deny( | ||
trivial_casts, | ||
trivial_numeric_casts, | ||
stable_features, | ||
non_shorthand_field_patterns, | ||
renamed_and_removed_lints, | ||
unsafe_code, | ||
clippy::exhaustive_enums | ||
)] | ||
#![allow(clippy::all, clippy::exhaustive_enums)] | ||
pub mod tangle_runtime; | ||
pub use parity_scale_codec; | ||
pub use scale_info; | ||
pub use subxt; |
Oops, something went wrong.