Skip to content

stacksfoundation/stacksstatus

Repository files navigation

Stacks Status

License: MIT Pull Requests Welcome

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.

Getting Started

Clone this repo and enter its directory

# Clone this repo and enter its directory
git clone https://github.com/stacksfoundation/stacksstatus && cd stacksstatus

Create .env file

cp .env.local.example .env

Edit .env file,

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"

Install dependencies

npm install

Run development server

npm run dev

Run production server

npm run build && npm run prismamigrate && npm run start

Open http://localhost:3000 with your browser to see the result.

Configuration

Environment Variables

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