This repository contains the code for the Stacks Blockchain Status Page code used by the Stacks Foundation to display blockchain metrics. This is a next.js react app that reads Stacks Blockchain API data from a postgres database to display chainstate data.
- PostgreSQL is a required dependency with a Stacks Blockchain API instance writing chainstate data.
- Vercel cron is used for updating mempool txs
# Clone this repo and enter its directory
git clone https://github.com/stacksfoundation/stacksstatus && cd stacksstatus
cp .env.local.example .env
set DATABASE_URL
to your Stacks Blockchain API database instance.
ex:
DATABASE_URL="postgresql://user:pass@localhost:5432/stacks_blockchain_api?schema=stacks_blockchain_api"
npm install
npm run dev
npm run build && npm run prismamigrate && npm run start
Open http://localhost:3000 with your browser to see the result.
Name | Description | Default Value |
---|---|---|
NODE_ENV |
Sets the node environment | development |
DATABASE_URL |
Postgresql connection URI | postgresql://user:pass@localhost:5432/stacks_blockchain_api?schema=stacks_blockchain_api |
CRON_SECRET |
Auth key to refresh mempool data via vercel cron | secret |