Backfills starknet events , transaction ,blocks and a tool to decode starknet transactions to get execution trace & also decodes events and ABI
This tool does the following
Event decoder :- To decode an event , user provides the contract hash and the name of the event and block range , firstly the abi is fetched and parsed and the data for the particular event and block range is fetched The data fetched contains the keys and data required to decode the event , the decoder then initiates a new decoder class for that particular event and the event’s data is decoded with the provided inputs of hash,block range and event name
Function decoder:- Similar as above but instead of keys and data pairs we give call data as input that we will fetch in the provided blockrange
You can do all that using cli This tool is inspired from nethermind/entro but our tool is written in golang and uses goroutines to produce results faster.
Firstly we worked on the abi parser , to parse each event and function ie to get its name and parameters and their datatype to help us in decoding Further for event decoder the keys and data values are converted into bytes and are decoded according to the arguments and datatype that we obtained by parsing the abi
For function decoder we take the call data as input and it is also decoded acc to arguments and datatypes obtained by parsing the abi.
Backfilling uses goroutines to fetch block & transaction data using rpc http calls so that it is faster , we are using nethermind/starknet.go to fetch events , class hash & apply filter to events. For block data and transaction receipt we use direct http calls to rpc and goroutines to make it fast. We used cobra to interact with cli & morph to create a database to store ABIs and backfilled data. The databse is used to save the abi which can be used to decode transaction database is created using mySQL