mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
Add runtime_metadata_url to pull metadata directly from a node (#689)
* Allow metadata to be pulled directly from a node with runtime_metadata_url * Update docs * https too, and abstract out block_on fn * tweak a comment in the example
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
#[subxt::subxt()]
|
||||
pub mod node_runtime {}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,7 @@
|
||||
error: One of 'runtime_metadata_path' or 'runtime_metadata_url' must be provided
|
||||
--> src/incorrect/need_url_or_path.rs:1:1
|
||||
|
|
||||
1 | #[subxt::subxt()]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the attribute macro `subxt::subxt` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
@@ -0,0 +1,7 @@
|
||||
#[subxt::subxt(
|
||||
runtime_metadata_path = "../../../artifacts/polkadot_metadata.scale",
|
||||
runtime_metadata_url = "wss://rpc.polkadot.io:443"
|
||||
)]
|
||||
pub mod node_runtime {}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
error: Only one of 'runtime_metadata_path' or 'runtime_metadata_url' can be provided
|
||||
--> src/incorrect/url_and_path_provided.rs:1:1
|
||||
|
|
||||
1 | / #[subxt::subxt(
|
||||
2 | | runtime_metadata_path = "../../../artifacts/polkadot_metadata.scale",
|
||||
3 | | runtime_metadata_url = "wss://rpc.polkadot.io:443"
|
||||
4 | | )]
|
||||
| |__^
|
||||
|
|
||||
= note: this error originates in the attribute macro `subxt::subxt` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
Reference in New Issue
Block a user