subwasm icon indicating copy to clipboard operation
subwasm copied to clipboard

Error: 0: Generic error: Request error

Open forgetso opened this issue 2 years ago • 1 comments

Hi,

Whenever I run this

subwasm meta wss://rpc.polkadot.io:433

or similar, I get the message

subwasm get --url http://0.0.0.0:9933  
Error: 
   0: Generic error: Request error

Location:
   cli/src/main.rs:55

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

I've tried this with local node running:

b56afcaab32c   substrate-contracts-node:v0.29   "/bin/sh -c 'exec /b…"   5 days ago   Up About an hour   0.0.0.0:9615->9615/tcp, :::9615->9615/tcp, 0.0.0.0:9933->9933/tcp, :::9933->9933/tcp, 0.0.0.0:9944->9944/tcp, :::9944->9944/tcp, 0.0.0.0:30333->30333/tcp, :::30333->30333/tcp   docker-substrate-1

forgetso avatar Oct 02 '23 12:10 forgetso

Hello, thanks for the report. It looks like a bug related to some rework with the args.

Here are a few workarounds for now:

  • Do not pass the url: subwasm meta --chain polkadot is actually simpler :)
  • Get the runtime locally first: subwasm get wss://polkadot-rpc.dwellir.com -o /tmp/runtime.wasm; subwasm meta /tmp/runtime.wasm

I just tested with wss://rpc.polkadot.io:433 and it would not respond, that could also be an issue with that one RPC.

if you search for RPC urls, you may also checkout [subrpc]*(https://github.com/chevdor/subrpc) to abstract away this URL and run:

TMP=/tmp/runtime.was
URL=$(subrpc ep get polkadot | head -n 1)
subwasm get $URL -o $TMP
subwasm meta $TMP

chevdor avatar Oct 16 '23 09:10 chevdor