2

my question is regarding Polkadot, I need to get the value of any "transfer" transactions and there's no problem with it with "transfer_keep_alive" and "transfer" transactions. On "transfer_all", however, extrinsics don't contain the "value". I got a clue that I need to get events of a block via state_getStorage RPC method, but I'm struggling with which keys I should provide as params. There's not much info in docs about it. Also, I'm not using a polkadot-js lib and only use HTTP RPC requests. How do I get the events for the block via state_getStorage method?

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Apr 14, 2022 at 15:22

1 Answer 1

1

You can just use Substrate API Sidecar's GET block endpoint. It will give you all the events associated with each extrinsic.

Sidecar is stateless and requires very few system resources. Just give it a WS connection to a node and use the Sidecar API.

3
  • Can't use it for my use case as I can't have WS connections (hence "I'm not using a polkadot-js lib and only use HTTP RPC requests"). There are several ways I could get these events from API, however, the easiest of the ways are not available for me.
    – Old Man
    Apr 14, 2022 at 9:39
  • They are under system.events: 0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7 Apr 14, 2022 at 11:52
  • Yes, there is an RPC method state_getStorage that supposedly should allow to request events. However, there is very little documentation of what are the "keys" that are supposed to be associated with certain data in storage. On my Polkadot node the state_getKeys method, which is supposed to be called with 0 arguments, returns an error that it expects 1 or more arguments. Seems like the documentation is partially deprecated, since my node is running the latest version.
    – Old Man
    Apr 14, 2022 at 13:05

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.