#events #cache #read #contract #ethereum #index #address

bin+lib vibegraph

Reads ethereum contract events from a lightweight RPC and caches them to a database

9 releases

0.3.2 Jan 25, 2024
0.3.1 Jan 25, 2024
0.2.5 Oct 3, 2023
0.2.2 Sep 29, 2023
0.1.0 Sep 29, 2023

#17 in #reads

35 downloads per month

MIT license

35KB
525 lines

Vibegraph-rs

A microservice application that reads ethereum contract events from a lightweight RPC and caches them to a database (Postgres).

cargo add vibegraph

Quickstart

cargo run config/payspec_config.json   

Example config:

 
  let  app_config = AppConfig {
     
     indexing_config,
     contract_config 
    
 }; 
 
 Vibegraph::init( &app_config ).await;
 

Example output:


[2023-09-28T19:42:47Z INFO  vibegraph] index starting at 4286418
[2023-09-28T19:42:52Z INFO  vibegraph] index starting at 4288418
[2023-09-28T19:42:57Z INFO  vibegraph] index starting at 4290418
[2023-09-28T19:43:02Z INFO  vibegraph] index starting at 4292418
[2023-09-28T19:43:02Z INFO  vibegraph] decoded event log ContractEvent { name: "Transfer", signature: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, args: [LogParam { name: "from", value: Address(0xf637ce9928a9e6632920338b98f2543ea0b5526f) }, LogParam { name: "to", value: Address(0x5a5b978142c8f08dd013901b50892bac49f3b700) }, LogParam { name: "tokenId", value: Uint(0) }], address: 0x4590383ae832ebdfb262d750ee81361e690cfc9c, data: [], transaction_hash: Some(0x5c9e7eb1aa7fe6564eeeaef6e251c44c80bd4c0e059818f548edc744f9bae999), block_number: Some(4294096), block_hash: Some(0x384e1d61b85d7e5a41a8a2e490b7e019a707301809f18508a004768ced29b94b), log_index: Some(57), transaction_index: Some(39) }

image Event logs stored to Supabase (PSQL)


Dependencies

~33–51MB
~1M SLoC