How do i query over rpc the maximum weight for normal extrinsics as defined in frame_system here:


1 Answer 1

  1. use state_getMetadata
curl -X POST -H 'Content-Type:application/json' https://rpc.polkadot.io -d '{"id":0,"jsonrpc":"2.0","method":"state_getMetadata","params":[]}'
  1. find the frame system constants part
constants: [
      name: BlockWeights
      type: 161
      value: 0x5872d25c0100000000204aa9d1010000603b14050000000001a094cb9158010000010098f73e5d010000010000000000000000603b14050000000001a01c1efccc0100000100204aa9d1010000010088526a74000000603b140500000000000000
      docs: [
          Block & extrinsics weights: base values and limits.
  1. decode the value
parity_scale_codec::Decode::decode::<FrameSystemLimitsBlockWeights>(&mut &*array_bytes::hex2bytes_unchecked(value)).unwrap();

That's how PolkadotApps do.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.