Command rpc

Send a RPC request to the node's HTTP RPC endpoint.

# Example:
Get the Polkadot's block zero's hash:
# Normal output
subalfred rpc --method chain_getBlockHash --params '[[0,1,2]]'
# Beautiful output
subalfred rpc --method chain_getBlockHash --params '[[0,1,2]]' | jq

Usage: subalfred rpc [OPTIONS] --method <METHOD> <URI>

          Node's HTTP RPC endpoint

          [default: http://localhost:9933]

      --method <METHOD>
          JSONRPC method name

      --params <[PARAMETER]>
          JSONRPC parameters

  -l, --log <TARGET=LEVEL,*>
          Set a custom log filter.

          This flag is also working with the `RUST_LOG` environment variable. If you use `RUST_LOG`
          simultaneously, this will append `RUST_LOG`'s value after the log.

          [default: info]

  -h, --help
          Print help information (use `-h` for a summary)


If you don't have the jq command, then just ignore that. I only use it to beautify the output here.

subalfred rpc --method chain_getBlockHash --params '[[0,1,2]]' | jq
  "id": 0,
  "jsonrpc": "2.0",
  "result": [