Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.61 KB

README.md

File metadata and controls

80 lines (52 loc) · 1.61 KB

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