paritytech / subxt

Interact with Substrate based nodes in Rust or WebAssembly
Other
425 stars 248 forks source link

Enable to decode metadata #1096

Closed nakul1010 closed 1 year ago

nakul1010 commented 1 year ago

Command use to run the node

docker run --network=host interlayhq/interbtc:1.25.0-rc1 --dev --instant-seal

Subxt version

subxt-cli 0.30.1-unknown

Command use 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>

Location:
   /Users/nakul/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subxt-cli-0.30.1/src/commands/metadata.rs:42

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
jsdw commented 1 year ago

Possibly the issue here is the:

subxt metadata --version unstable -f bytes > metadata-parachain-kintsugi.scale

The unstable metadata from your node is likely not compatible with stable V15 or V14 metadata now (probably because your node isn't uptodate enough to have it yet).

Try just calling subxt metadata -f bytes > metadata-parachain-kintsugi.scale to get your metadata; this should do the trick (also try --version 14 and --version 15 if you want to be explicit)! I'll close this for now but please re-open if you try the above and still have an issue!