Giter Site home page Giter Site logo

colm3na / polkastats-v2 Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 24.0 1.6 MB

Polkadot Kusama network statistics

Home Page: https://polkastats.io/

License: GNU General Public License v3.0

Vue 89.97% JavaScript 10.03%
blockchain polkadot kusama polkadot-js

polkastats-v2's Introduction

PolkaStats v2

Polkadot Kusama CC2 network statistics

This repository is ARCHIVED, for latest version go to https://github.com/polkastats/polkastats

Build frontend

# Clone this repo
$ git clone https://github.com/Colm3na/polkastats-v2.git
$ cd polkastats-v2

# Install dependencies
$ npm install

# Serve with hot reload at localhost:3000
$ npm run dev

# Build for production
$ npm run build

# generate static project
$ npm run generate

Build backend

See: https://github.com/Colm3na/polkastats-backend-v2

How to include your Kusama validator information in PolkaStats

You will need both Keybase and GitHub accounts in order to continue.

Make sure you have properly filled your full name, website, social links and have uploaded a profile picture in your Keybase profile.

Step 1

Login with your GitHub user and make a Fork of PolkaStats v2 repo: https://github.com/Colm3na/polkastats-v2.

Step 2

In your fork, create a new folder named "stash_address_of_your_validator" in identities folder. In that folder create a new file named keybase_username with your Keybase username on it.

Step 3

Make a Pull Request to the master branch of the original repo: https://github.com/Colm3na/polkastats-v2.

Old v1 version (Alexander network):

polkastats-v2's People

Contributors

abouzidi avatar aitorjs avatar awrelll avatar bneiluj avatar derfredy avatar distractivekatie avatar edouardlvdl avatar eduadiez avatar fgimenez avatar kwunyeung avatar mariopino avatar realgar avatar redpenguin-validator avatar scriptonita avatar soc1c avatar sweetpotatoz avatar tutzo avatar wimel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

polkastats-v2's Issues

Migrate to latest offline-phragmen

The latest offline-phragmen by kiaenigma already have json output so there is no need to keep using the modified version.

https://github.com/kianenigma/offline-phragmen

The output is different so we should do a data transform at backend level or modify the whole implementation. My vote goes to transform the data at backend level so we don't need to change the frontend.

Add block information

We are currently collecting this info from each new block:

  • Block heigh
  • Finalized block height
  • Block author
  • Hash
  • Parent hash
  • Extrinsics root
  • State root
  • Total issuance
  • Session info json
  • System events

Next Pending Thing -> Extrinsics

// Subscribe to new blocks and get extrinsics
const unsub = await api.rpc.chain.subscribeNewHeads(async (header) => {
  console.log(`Block #${header.number} extrinsics:`);
  const blockHash = await api.rpc.chain.getBlockHash(header.number);
  getBlock = await api.rpc.chain.getBlock(blockHash);
  getBlock.block.extrinsics.forEach((extrinsic, index) => {
    console.log(`\t#${index} '${extrinsic.meta.name}'`);
    console.log(`\t\t${extrinsic.meta.documentation}`);
  });
});

Add session index

Currently we don't show the current session index, we can also display the block height when next session starts.

We need to replace session by epoch at top.

Add advanced filtering

It would be great if you could add filters in addition to sorting.

Some ideas for filters:

  • Commission (less than, greater than, range)
  • Amount at stake, absolute or percentage
  • Known entity (e.g. you hold a signed message from entity running the validator)
  • Last slashed (e.g. no slashes for previous x sessions)

For example, let's say I want to sort by amount at stake, but only for validators with commission less than 30%. First I could filter to only show validators that have less than 30% commission, then I could sort by stake low to high.

Add search!

We can implement a search box to find validators/intentions by:

  • Identity name (mm or maybe all Keybase identity fields)
  • Nickname
  • Any of the addresses

UX improvement for messages inside blocks with x

screenshot

All that info is interesting, but it is very annoying that it is shown in all menus and must be closed with the "X" continuously. We need a solution. To give some example solution: Create a section only for this info, get it to close only once for all menus (cookie?)...

More flexible paginator on validators page

Some users have also asked us that a larger number of them can be shown in the list of validators. Right now the pagination is limited to 10. The idea is to give the possibility to choose that number .. 100 - 200 ...

Finish Polkadot identity support

Polkadot identity support is currently implemented in:

  • Backend
  • Frontend: Vuex store module
  • Frontend: VALIDATORS, INTENTIONS, FAVORITES, PHRAGMEN, NOMINATORS and ACCOUNTS pages.

We need to implement in:

  • Validator page (pages/validator/index.vue)
  • Intention page (pages/intention/index.vue)
  • Phragmen candidate page (pages/phragmen-candidate/index.vue)
  • Nominator page (pages/nominator/index.vue)

Change links to Colmena Labs Kusama block explorer at https://kusama.colmenalabs.org

When our Kusama block explorer at https://kusama.colmenalabs.org gets fully sync, we should change links from:

blockExplorer: {
  block: 'https://polkascan.io/pre/kusama-cc2/block/',
  account: 'https://polkascan.io/pre/kusama-cc2/account/'
},

To:

blockExplorer: {
  block: 'https://kusama.colmenalabs.org/block/',
  account: 'https://kusama.colmenalabs.org/account/'
},

In pages/index.vue, validator/index.vue and intention/index.vue.

This is a perfect example of why we need an app confirg file! :-) Maybe we can finish #17 first to simply add the urls to one_single_config_file XDD.

Create app config file

And import it when needed.

It should include:

  • Unit (i.e: KSM)
  • Decimals (i.e: 12)
  • Block explorer base URLs (for account and block links)
  • Backend base URL

Integrate Cypress for test

We need to add tests to our code.

Cypress is a complete end-to-end testing tool that can cover all our needs.

Add % of total stake per validator

This is a very useful parameter to include in the validators table.
On the top of the page we could show the total token amount and the total staked amount. Inflation of the network depends on it.
Later in each validator we could show what percentage of the total is staked in that validator.

Add a validators table view with search, sorting and pagination

Would be nice to have a validators table view with search, sorting and pagination features to improve the navigation over the fast increasing number of validators.

Maybe we can implement a switch to change between old and new view, setting new table view as default.

UPDATE: @Bitcoinera is actually making a great job testing and implementing vuetify data tables, so maybe soon we can have this view ready!

Add i18n

Would be nice to have the possibility to translate PolkaStats to another languages.

We can use nuxt-i18n to accomplish it.

Add Eslint and Prettier to proyect

Eslint and Prettier are very useful tools that we should use in our project.

Eslint: Find and fix problems in your JavaScript code.
Prettier: an opinionated code formatter

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.