Skip to content

VeerChaurasia/Athena

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go package for interacting with starknet. It is a tool which can be used in cli for the following tasks

This is inspired from nethermind/entro but implemented in GoLang and is therefore much faster than Entro. Unlike entro which is limited to being a cli tool , We have implemented frontend as well for Athena(Currently limited to backfilling ) We plan to make the frontend fully functional soon.

The below graph compares the backfilling time taken by Athena and Entro .

Graph

Tasks it can perform

  • Backfill full blocks including events , tx & receipts
  • Get implementation history
  • ABI Decoding
  • Decoding of functions & events from a transaction

Usage/Examples

Specify this in the following fields

from :- block number

to :- block number

jsonRpcUrl - https://rpc.nethermind.io/mainnet-juno?x-apikey=YOUR_API_KEY

output :- your_file_name.csv

abi parser , to parse each event and function ie to get its name and parameters and their datatype to help us in decoding

go run cli/get/starknet.go --classHash 0x01a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003 --jsonRpcUrl "https://rpc.nethermind.io/mainnet-juno?x-apikey=MIkLH4AOTdTH9uqu8PqvSHUBNnAnMU1fXdROa3qc1DsSVxvOcGRrwr6kSj1zsNjT" --decode

Result - list of functions and events decoded in that ABI to your console. WhatsApp Image 2024-09-08 at 16 35 46_eddf7e15

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

go run cli/get/dispatcher.go -event TransactionExecuted -contract 0x005a708f9c84bc709e967086572c6655e2b85eaf5a2ef752d92e24e64c5e392c_1 -from 691000 -to 692000

Result -

Similar as above but instead of keys and data pairs we give call data as input that we will fetch in the provided blockrange

From - Block Number

To - Block Number

go run cli/backfill/starknet_events.go --from 67800 --to 67801 --rpc-url https://starknet-mainnet.public.blastapi.io/rpc/v0_7 --output events.csv --chunk-size 100

With Filters

go run cli/backfill/starknet_filters.go -rpc-url "https://rpc.nethermind.io/mainnet-juno?x-apikey=MIkLH4AOTdTH9uqu8PqvSHUBNnAnMU1fXdROa3qc1DsSVxvOcGRrwr6kSj1zsNjT" -contract-address "0x01a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003" -from 100000 -to 200000 -output "filtered_events.csv"

Result - all events decoded in your excel file

WhatsApp Image 2024-09-08 at 16 35 46_05437c77

go run starknet.go --from 110 --to 130 --rpc-url https://rpc.nethermind.io/mainnet-juno?x-apikey=MIkLH4AOTdTH9uqu8PqvSHUBNnAnMU1fXdROa3qc1DsSVxvOcGRrwr6kSj1zsNjT --output blocks_details.csv --transactionhash (for block data)

Result - all blocks , transaction hashes , receipts & events of that txns data in your csv files.

WhatsApp Image 2024-09-08 at 16 36 25_74cfd3e6

About

Blockchain data decoder in go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 89.7%
  • JavaScript 7.4%
  • CSS 1.7%
  • HTML 1.2%