Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Runtime APIs instead of RPCs #503

Open
gregdhill opened this issue Jul 24, 2023 · 2 comments · May be fixed by #531
Open

Use Runtime APIs instead of RPCs #503

gregdhill opened this issue Jul 24, 2023 · 2 comments · May be fixed by #531
Assignees

Comments

@gregdhill
Copy link
Member

The latest subxt release (v0.29.0) includes support for metadata v15 and generating a runtime API interface. See this PR for more detail on how to consume the new (unstable) interface. We can replace any existing RPC calls (.rpc().request("xxx")) with the generated code and presumably use the static metadata for types such as BalanceWrapper.

@nakul1010
Copy link
Member

nakul1010 commented Jul 27, 2023

The interbtc substrate dependencies needs to be upgraded to v1.0.0 release to generate the v15 metadata that can be decoded by subxt.

@nakul1010
Copy link
Member

subxt cli command to generate metadata
subxt metadata --version unstable -f bytes > metadata-parachain-kintsugi.scale

Error received

Error: 
   0: Could not decode `RuntimeMetadataPrefixed.1`:
   0:     Could not decode `RuntimeMetadata::V15.0`:
   0:         Could not decode `RuntimeMetadataV15::extrinsic`:
   0:             Could not decode `ExtrinsicMetadata::extra_ty`:
   0:                 Could not decode `UntrackedSymbol::id`:
   0:                     out of range decoding Compact<u32>
   0: 
   1: Could not decode `RuntimeMetadata::V15.0`:
   1:     Could not decode `RuntimeMetadataV15::extrinsic`:
   1:         Could not decode `ExtrinsicMetadata::extra_ty`:
   1:             Could not decode `UntrackedSymbol::id`:
   1:                 out of range decoding Compact<u32>
   1: 
   2: Could not decode `RuntimeMetadataV15::extrinsic`:
   2:     Could not decode `ExtrinsicMetadata::extra_ty`:
   2:         Could not decode `UntrackedSymbol::id`:
   2:             out of range decoding Compact<u32>
   2: 
   3: Could not decode `ExtrinsicMetadata::extra_ty`:
   3:     Could not decode `UntrackedSymbol::id`:
   3:         out of range decoding Compact<u32>
   3: 
   4: Could not decode `UntrackedSymbol::id`:
   4:     out of range decoding Compact<u32>
   4: 
   5: out of range decoding Compact<u32>

The v15 metadata is stabilised in 1.0.0 release.

@nakul1010 nakul1010 linked a pull request Oct 5, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants