Skip to content

bitgreen/carbon-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitgreen Dashboard

https://greenpolkadot.io/

A dashboard monitoring the energy usage and carbon emissions of the Polkadot ecosystem. Providing real-time updates for anyone to explore the relaychain and various parachains.

First, run the development server:

npm run dev
# or
yarn dev

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

Emission analysis is conducted through aggregation of geolocation, grid efficiency and average compuatation data provided by parachain operators.

Update DATABASE_URL in .env to connect your postgres database

To set up the cron job, provide Github secrets with the relevant POSTGRES_PASSWORD and DATABASE_URL OR you can setup cron job by yourself: crontab -e

0 0,6,12,18 * * * node --experimental-json-modules /path/to/scripts/createNetworkData.mjs

To ensure robust database security throughout the dashboard, /api/ endpoints are passed down through getStaticProps, Prisma is never directly used on the client, all database interactions happen using server-side NodeJS code. To prevent reentrancy attacks, a random nonce is generated and signed each time parachain/DApp information is updated.

Docker

You can run this Dashboard in Docker containers with minimal effort as follows:

Requirements:

Install docker and docker composer from https://www.docker.com

Build and Run

From the project folder execute: You can run the server in a docker container executing the following command from the project folder:

docker compose up -d

Please wait for a few minutes to let the server populate some records in the database.
The server will be reachable browsing http://localhost:3001

This is a Next.js project developed by Offsetra.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published