BSWP-PIPELINE

Use Case

spin up some kind of pipeline that will index all of the sweep for Stakehouse validators and produce a sum of accurate earnings

Problem Solving

  1. base on thisDocumentation we can create simple query in graphql for getting all public keys.
    {
        stakehouseAccounts(first:1000,skip:0) {
            id
        }
    }

we can loop use this query until the result is empty.

  1. After we get the public keys. we can use this api for getting validators information.

  2. next base on this Documentation. we can use this formula total_eth_obtained = 32 - current_balance (in ETH)

Screenshot 2023-07-16 at 18 05 55

Coding

I use rust because currently i'm learning this language since one week ago. the resut example already saved in data folders

How To use

  1. install rust with following this instruction
  2. Download this repo
  3. enter this repo through terminal/command prompt
  4. run cargo build
  5. run ./target/debug/bswp-pipeline --help for seing the details
         blockswap simple pipeline
    
         Usage: bswp-pipeline [OPTIONS]
         
         Options:
           -s, --start-page <START_PAGE>  first batch pub keys data [default: 0]
           -e, --end-page <END_PAGE>      end batch pub keys data [default: 0]
           -h, --help                     Print help
           -V, --version                  Print version
    

Limitation

Currently because the access to sss still free plan so we can use multi threading for process the datas Screenshot 2023-07-16 at 18 12 36