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.
- Alchemy
- Ankr
- Chainstack
- Pokt Network
- QuickNode
- Clone the project
git clone https://github.com/a26nine/sol-block-derby
- Go to the project directory
cd sol-block-derby
- Install dependencies
npm install
-
Set configuration and environment vairables (as shared below)
-
Start the server
npm start
timeoutSeconds
- Timeout for the RPC requestintervalSeconds
- Time interval between the roundsisDb
- Setting to enable/disable the database operationstableName
- Postgres database table name
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=
You can run Various SQL queries provided in sql/queries
against the database.