Skip to content

Commit

Permalink
fix version, community and total staked functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid5594 committed Feb 26, 2024
1 parent 5b407d0 commit 66732be
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkadot-staking-dashboard",
"version": "0.1.0",
"version": "1.7.0",
"type": "module",
"license": "GPL-3.0-only",
"private": false,
Expand Down
214 changes: 214 additions & 0 deletions src/config/validators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
// Copyright 2022 @paritytech/polkadot-staking-dashboard authors & contributors
// SPDX-License-Identifier: Apache-2.0

/* Import your SVG Here.
* Use upper camel-case for your SVG import, lower camel case for the svg.
* import ValidatorEntityName from './thumbnails/validatorEntityName.svg';
*/
import Thumbnail4T2CAPITAL from './thumbnails/4t2.svg';
import AnyValid from './thumbnails/anyvalid.svg';
import Brightlystake from './thumbnails/Brightlystake-logo.svg';
import Cere from './thumbnails/cere.svg';
import EdgeServices from './thumbnails/edgeservices.svg';
import garm99 from './thumbnails/garm99.svg';
import Jinogami from './thumbnails/Jinogami.svg';
import medium from './thumbnails/medium.svg';
import SerGo from './thumbnails/SerGo.svg';
import StakeAngle from './thumbnails/stakeangle.svg';
import Testnetrun from './thumbnails/Testnetrun.svg';
import Tokem from './thumbnails/tomek.svg';
import TRK from './thumbnails/TRK.svg';
import wombat from './thumbnails/wombat.svg';
import XameyzIdentity from './thumbnails/xameyz.svg';

export const ValidatorCommunity = [
{
name: 'CERE',
Thumbnail: Cere,
thumbnail: 'Cere',
bio: `Official Validators from Cere Network, the world's first Decentralized Data Cloud platform.`,
email: '[email protected]',
website: 'https://cere.network',
twitter: '@CereNetwork',
validators: {
cere: [
'6S4mrsCrqWoBAYrp2PKQNh7CYcCtyEtYpx5J626Kj5vszSyy',
'6QhzyvZQm3dLjDmeaoUnLPXzfuTi6X1HEo6AX6gfVbC3shzD',
'6RgfwDiQTLjgbkQ5CorrKtRtCaDABQKYsibk9MeyvzmKFrk2',
'6TBhZAgtFc3Wr8BeNu5tdMJG1NDpxKbG2Hwf2UbVtMGyFxzN',
'6Pyh9zZgp4XCP338VDG7oshK7PvsAdyuBN6S2NNm7CBoCXx8',
'6S9tXQmPYoeBXYey8vKYi9BMbNMD8Zgqb62k7SYMNQLUbydZ',
'6PwAv2L43zGPEwHTb1L7LyCWv7yq2Hc4dSVYHvvi1kscCR91',
'6Qshjra42mLDtc9ouHzUz1bMmYXg2qasmW2xSLgendRdsYED',
],
},
},
{
name: 'Xameyz',
Thumbnail: XameyzIdentity,
thumbnail: 'Xameyz',
bio: `Just a humble validator on a humble decentralized network.`,
email: '[email protected]',
website: '',
twitter: '@xameyz',
validators: {
cere: ['6TYC5go4hQ85NxmGK8c658cmJozxeohKfp6YbDGC5r1HJ6nZ'],
},
},
{
name: 'AnyValid',
Thumbnail: AnyValid,
thumbnail: 'AnyValid',
bio: `Professional Proof-of-Stake Networks Validation Services`,
email: '[email protected]',
website: 'https://anyvalid.com',
twitter: '@anyvalid',
validators: {
cere: ['6UDVCKB9opndqcRAxTpTvKFTFXUwvE36aYnp1bNyVV3Cfh16'],
},
},
{
name: 'SerGo',
Thumbnail: SerGo,
thumbnail: 'SerGo',
bio: `We validate with expertise, you earn with confidence.`,
email: '[email protected]',
website: 'https://sergo.dev',
twitter: '',
validators: {
cere: ['6SpjH8swCtFwmntQmdikMWyDKgr59q1cLauePYc2iqwwe6Bv'],
},
},
{
name: 'StakeAngle',
Thumbnail: StakeAngle,
thumbnail: 'StakeAngle',
bio: `Non-custodial staking provider`,
email: '[email protected]',
website: 'https://stakeangle.com',
twitter: '',
validators: {
cere: ['6T9794B5HPPNYqds6VNAxcFjYZHzpgbZfdWXSiE6q65eLpVm'],
},
},
{
name: 'medium',
Thumbnail: medium,
thumbnail: 'medium',
bio: `Individual staking services`,
email: '[email protected]',
website: 'https://github.com/mediumwe11',
twitter: '',
validators: {
cere: ['6TsKhZ5o9BFAG1bCY2HVriUXAuQMae744APMMcVgYqYhNJRy'],
},
},
{
name: 'Jinogami',
Thumbnail: Jinogami,
thumbnail: 'Jinogami',
bio: `A Community Cere Validator`,
email: '[email protected]',
website: '',
twitter: '@steganosgraphos',
validators: {
cere: ['6RvHuBMLqBVcwvk62qto81m8DFPoKBq86WCAmVEwHH3rTuNQ'],
},
},
{
name: 'EdgeServices',
Thumbnail: EdgeServices,
thumbnail: 'EdgeServices',
bio: `Blockchain Nodes & Services`,
email: '[email protected]',
website: 'https://edgeservices.io',
twitter: '@EdgeServicesIO',
validators: {
cere: ['6RByFsuHYQET5V78TqaRuyeF8XQRKPuZhkE9admxL48VUEey'],
},
},
{
name: 'wombat',
Thumbnail: wombat,
thumbnail: 'wombat',
bio: `Professional blockchain validator`,
email: '[email protected]',
website: 'https://github.com/wombatqq',
twitter: '',
validators: {
cere: ['6Pqj4UwFRN4mmu25PH8RqWaMT4jNd6ytFNgaJ4KtVTfgByez'],
},
},
{
name: 'Brightlystake',
Thumbnail: Brightlystake,
thumbnail: 'Brightlystake',
bio: `Cere node from Brightlystake. Contact us for any queries https://linktr.ee/brightlystake`,
email: '[email protected]',
website: 'https://brightlystake.com/',
twitter: '@brightlystake',
validators: {
cere: ['6TnQVHWvDtw5W5vqEjNcewypHagW9N5VtvDTDUNWq3drqZTB'],
},
},
{
name: 'garm99',
Thumbnail: garm99,
thumbnail: 'garm99',
bio: `Staking Provider of Proof-of-Stake Networks`,
email: '[email protected]',
website: 'nodeskeeper.com',
twitter: '@GARM799',
validators: {
cere: ['6RLGWVUzwXBvjuyLHY7Hr95TqgdUV6UxboG9i3xZnVp1vVWk'],
},
},
{
name: '4T2.CAPITAL',
Thumbnail: Thumbnail4T2CAPITAL,
thumbnail: '4T2.CAPITAL',
bio: `valid thumbnail: 'XameyzIdentity',ating with love & care | secure and seamless staking experience | based in 🇳🇴`,
email: '[email protected]',
website: 'https://4t2.capital',
twitter: '',
validators: {
cere: ['6VB5dkmPn6zpti4BaEZp2y7Ht8kaj8ELKGAHzpThowzXU66A'],
},
},
{
name: 'TRK',
Thumbnail: TRK,
thumbnail: 'TRK',
bio: `Validating...`,
email: '',
website: '',
twitter: '',
validators: {
cere: ['6TBNtFjPELfrzSa2sXYyTWhbP1omhjxhF5nk6jtR51S3pfrS'],
},
},
{
name: 'Testnetrun',
Thumbnail: Testnetrun,
thumbnail: 'Testnetrun',
bio: `Position yourself for the blockchain-powered future of the next decade by staking today, ensuring you're part of the fastest and most secure validator network in the space.`,
email: '[email protected]',
website: 'https://stake.testnet.run',
twitter: '@testnetrun',
validators: {
cere: ['6QPgrdDzaMqj54YcHm1XpyqN8z9DTZ9sySXwF7uFwfUADkiL'],
},
},
{
name: 'TomekNode',
Thumbnail: Tokem,
thumbnail: 'Tokem',
bio: `Experienced and dedicated, I pride myself on being a reliable community validator node maintainer, ensuring optimal performance and trust for our nominators`,
email: '[email protected]',
website: '',
twitter: '',
validators: {
cere: ['6PbuJRgBSikmBNajCa75Zq9PqXmaYcCZ6e5QKk7sUyeebBDU'],
},
},
];
2 changes: 1 addition & 1 deletion src/contexts/NetworkMetrics/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const activeEra: ActiveEra = {
};
export const metrics: NetworkMetrics = {
totalIssuance: new BigNumber(0),
auctionCounter: new BigNumber(0),
// auctionCounter: new BigNumber(0),
earliestStoredSession: new BigNumber(0),
fastUnstakeErasToCheckPerBlock: 0,
minimumActiveStake: new BigNumber(0),
Expand Down
5 changes: 2 additions & 3 deletions src/contexts/NetworkMetrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,21 @@ export const NetworkMetricsProvider = ({
const unsub = await api.queryMulti(
[
api.query.balances.totalIssuance,
api.query.auctions.auctionCounter,
// api.query.auctions.auctionCounter,
api.query.paraSessionInfo.earliestStoredSession,
api.query.fastUnstake.erasToCheckPerBlock,
api.query.staking.minimumActiveStake,
],
([
totalIssuance,
auctionCounter,
earliestStoredSession,
erasToCheckPerBlock,
minimumActiveStake,
]: AnyApi) => {
setStateWithRef(
{
totalIssuance: new BigNumber(totalIssuance.toString()),
auctionCounter: new BigNumber(auctionCounter.toString()),
// auctionCounter: new BigNumber('0'.toString()),
earliestStoredSession: new BigNumber(
earliestStoredSession.toString()
),
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/NetworkMetrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface NetworkMetricsContextInterface {

export interface NetworkMetrics {
totalIssuance: BigNumber;
auctionCounter: BigNumber;
// auctionCounter: BigNumber;
earliestStoredSession: BigNumber;
fastUnstakeErasToCheckPerBlock: number;
minimumActiveStake: BigNumber;
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/Validators/ValidatorEntries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { greaterThanZero, rmCommas, shuffle } from '@polkadot-cloud/utils';
import BigNumber from 'bignumber.js';
import React, { useEffect, useRef, useState } from 'react';
import { ValidatorCommunity } from '@polkadot-cloud/assets/validators';
import { ValidatorCommunity } from 'config/validators';
import type { AnyApi, AnyJson, BondFor, Fn, Sync } from 'types';
import { useEffectIgnoreInitial } from '@polkadot-cloud/react/hooks';
import { useBonded } from 'contexts/Bonded';
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Community/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const List = () => {
validatorCommunity.filter((v) => v.validators[network] !== undefined)
);

console.warn(`All validators: ${validatorCommunity}`);

useEffect(() => {
setEntityItems(
validatorCommunity.filter((v) => v.validators[network] !== undefined)
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Overview/Stats/SupplyStaked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const SupplyStakedStat = () => {
const { lastTotalStake } = staking;
const { totalIssuance } = metrics;

console.warn(`Total Issuance: ${totalIssuance}`);
console.warn(`Total Stake: ${lastTotalStake}`);
// total supply as percent.
const totalIssuanceUnit = planckToUnit(totalIssuance, units);
const lastTotalStakeUnit = planckToUnit(lastTotalStake, units);
Expand Down

0 comments on commit 66732be

Please sign in to comment.