Skip to content

a26nine/sol-block-derby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana Block Derby 🏇🏻

A tool to fetch Solana blockchain's latest slot number using various blockchain node providers, compare them, and compute the winner for the purpose of data reliability.

(Optional) The data can also be sent to a Posgtres DB for querying later.

Current Providers

  • Alchemy
  • Ankr
  • Chainstack
  • Pokt Network
  • QuickNode

Screenshot

sol-block-derby

Run

  1. Clone the project
  git clone https://github.com/a26nine/sol-block-derby
  1. Go to the project directory
  cd sol-block-derby
  1. Install dependencies
  npm install
  1. Set configuration and environment vairables (as shared below)

  2. Start the server

  npm start

Configuration

  • timeoutSeconds - Timeout for the RPC request
  • intervalSeconds - Time interval between the rounds
  • isDb - Setting to enable/disable the database operations
  • tableName - Postgres database table name

Environment Variables

To run this project, you will need to add the following environment variables to your .env file (sample in .env.example file)

  • ALCHEMY_ENDPOINT=
  • ANKR_ENDPOINT=
  • CHAINSTACK_ENDPOINT=
  • POKT_ENDPOINT=
  • QUICKNODE_ENDPOINT=

If you want to push the results to a Postgres Database and if isDb is set to true

  • PGDATABASE=
  • PGHOST=
  • PGPASSWORD=
  • PGPORT=
  • PGUSER=

If you are running the script from multiple servers/locations and want to have individual tables

  • DB_SUFFIX=

Query Database

You can run Various SQL queries provided in sql/queries against the database.

db-schema