GithubHelp home page GithubHelp logo

mathcryptodoc / insights-1kv Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 4.21 MB

A dashboard - and more - for 1kv members in Polkadot & Kusama.

License: GNU Affero General Public License v3.0

JavaScript 2.80% SCSS 12.52% HTML 17.28% Python 10.95% Jupyter Notebook 56.29% Shell 0.16%

insights-1kv's Introduction

insights-1kv

Overview

Insights into the Polkadot/Kusama 1kv programme.

Public version: insights.math-crypto.com

The website is static and built with doks, whose source files are generated by a python backend. The backend stores its data in dataframes that are easily loaded in, for example, notebooks. Uploading of the website is done with rclone but can be easily changed since we host a static website.

Backend Python installation and deployment

Install deps

pip3 install urllib3 certifi idna matplotlib pandas paramiko pyarrow joblib

Run cd scripts; ./make_dirs.sh

Test

cd python
./active_eras.py
./dump-1kv-data.py
./make_score_figures.py
./generate_web_pages.py

Use notebooks to inspect dataframes.

Deploy with service files

cd services

sudo cp 1kv-dump-json.service /etc/systemd/system/
sudo systemctl start 1kv-dump-json.service
sudo systemctl status 1kv-dump-json.service
sudo journalctl -u 1kv-dump-json --since today -f
sudo systemctl enable 1kv-dump-json.service

sudo cp 1kv-dump-chain.service /etc/systemd/system/
sudo systemctl start 1kv-dump-chain.service
sudo systemctl status 1kv-dump-chain.service
sudo journalctl -u 1kv-dump-chain --since today -f
sudo systemctl enable 1kv-dump-chain.service

sudo cp 1kv-score.service /etc/systemd/system/
sudo systemctl start 1kv-score.service
sudo systemctl status 1kv-score.service
sudo journalctl -u 1kv-score --since today -f
sudo systemctl enable 1kv-score.service

sudo cp 1kv-website.service /etc/systemd/system/
sudo systemctl start 1kv-website.service
sudo systemctl status 1kv-website.service
sudo journalctl -u 1kv-website.service --since today -f
sudo systemctl enable 1kv-website.service

Doks website

The doks directory is a clone of main doks github at end of 2021. Custom files are in doks/content and (unfortunately) in many other places.

Install deps

Install nvm on github locally as in https://github.com/nvm-sh/nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# log out & in
cd doks
nvm install node
nvm install-latest-npm
npm install

Hugo is in ./node_modules/.bin/hugo/hugo

Test site locally

npm run start

Build

npm run build

Files are in directory public.

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.