chain-indexing
chain-indexing copied to clipboard
Problem: Command is a un-necessary in blockchain related actions
The data on the blockchain already went through validation, so the purpose of command in blockchain related context in unnecessary.
When handling blockchain related events, they should be directly transformed as event and persist to the system.
what about commands for aggregated data?
what about commands for aggregated data?
Aggregated data means aggregating data from both on chain and outside the on chain data. For not on-chain data command is still needed I believe.
But for now all the commands is just a transformation of on-chain data. We do crawl data from multiple sources before making into an event (e.g. getting basic data decoded tx + block_results for execution result such as proposal id), however, they are all on-chain data so at the end the command is doing nothing but to pass its params to the event constructor.
My proposal of this task is to introduce a mechanism in which on-chain data no longer need to go through command and become event directly to avoid unnecessary boilerplate. But we still keep the command system for future use cases.