Giter VIP home page Giter VIP logo

near-dashboard's Introduction

⚠️⛔ DEPRECATED

This project is not being actively supported, the code is not expected to work nor reflects the latests improvements in our tooling stack

A toy project to produce a cool looking CLI dashboard for the NEAR platform.

Quickstart

  1. clone this repo
  2. install Sampler with brew install sampler
  3. start the dashboard with npm start

Wat?

Sampler is a "A tool for shell commands execution, visualization and alerting. Configured with a simple YAML file."

This project provides a near.yml configuration file for Sampler that renders a dashboard against the NEAR platform by polling data from various NEAR endpoints over HTTP.

It depends on Sampler being installed along with the availability of curl, awk and printf at the terminal.

Caveat: this project was only tested on a 2015 Macbook Pro.

What does the dashboard look like?

demo

Where is the data coming from?

The NEAR platform exposes multiple status endpoints for polling over HTTP for TestNet:

At the terminal you can use this command (wherever curl is available) to fetch network status

curl -s https://rpc.nearprotocol.com/status

see explainshell for details on the line above

Another utility, jq, is used to process the results that arrive as JSON

curl -s https://rpc.nearprotocol.com/status | jq '.chain_id'

see explainshell for details on the line above

And awk is used to extract data when multiple values are retrieved together and printf us used to format the results for presentation.

curl -s https://rpc.nearprotocol.com/metrics | grep '^block_produced_total' | awk -F ' ' '{ printf(" %d", $2) }'

see explainshell for details on the line above

Note

Another endpoint is available but not currently used by this dashboard

Local Development

The dashboard is configured using near.yml. See Sampler documentation for details on the format.

All requests used by the dashboard are also available in the file dev/requests.sh. This file is executable and running it will generate all the data being used to drive the dashboard, although without the pretty formatting.

A fake /status endpoint is included for sizing the dashboard to variable size data like number of validators. To use this utility use npm run dev to start a local server and edit the near.yml file anywhere you see the /status endpoint being used. Since the data is polled, any edits to dev/db.json will appear in the dashboard with the next request.

Related Resources

There are lots of dashboard builders like this:

near-dashboard's People

Contributors

amgando avatar chadoh avatar thisisjoshford avatar gagdiez avatar janedegtiareva avatar

Stargazers

Will W avatar Kenneth Luster avatar Mourad Kejji avatar

Watchers

Vladimir Grichina avatar Alexander Skidanov avatar James Cloos avatar Evgeny Kapun avatar

Forkers

mouradif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.