Skip to content

Commit

Permalink
Merge pull request #17 from Cerebellum-Network/release/1.2.0
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
shamilkhan authored Jul 12, 2023
2 parents 041ce52 + 50126b1 commit 8b04633
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 175 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2023-07-11

## Changed

- Enabled the Community Page.
- Updated the instructions for setting up the **Validator Entity** in the README.
- Improved the display of validators' identities.

## Added

- Added validators for Cere.

## [1.1.1] - 2023-06-01

## Changed
Expand Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Validators can add their identity, contact information and validator list to the

To add your entity, submit a PR with the following changes:

- **Thumbnail SVG:** Add your entity's thumbnail as an SVG file to [this folder](https://github.com/paritytech/polkadot-staking-dashboard/tree/master/src/config/validators/thumbnails).
- **Entity details:** Add your entity details to the `VALIDATORS_COMMUNITY`JSON object in [this file](https://github.com/paritytech/polkadot-staking-dashboard/blob/master/src/config/validators/index.ts).
- **Thumbnail SVG:** Add your entity's thumbnail as an SVG file to [this folder](https://github.com/Cerebellum-Network/staking-dashboard/tree/dev-cere/src/config/validators/thumbnails).
- **Entity details:** Add your entity details to the `VALIDATORS_COMMUNITY`JSON object in [this file](https://github.com/Cerebellum-Network/staking-dashboard/blob/dev-cere/src/config/validators/index.ts).

## Entity Structure

Expand All @@ -28,29 +28,34 @@ The following table outlines the structure of a `VALIDATOR_COMMUNITY` entry:
At the top of `config/validators/index.ts`, import the SVG you added in the corresponding `./thumbnails` folder as a React component:

```
import { ReactComponent as ValidatorCentral } from './thumbnails/validatorCentral.svg';
import { ReactComponent as Cere } from './thumbnails/cere.svg';
```

Then add your entity details to the `VALIDATOR_COMMUNITY` object. Only provide the validator(s) for the particular network(s) you are operating in. If you have no operating validators on Kusama, for example, the `kusama` key can be omitted.
Then add your entity details to the `VALIDATOR_COMMUNITY` object. Only provide the validator(s) for the particular network(s) you are operating in.

The following example defines 2 validators on the Polkadot network, and 1 on Kusama:
The following example defines 8 validators on the Cere Network

```
export const VALIDATOR_COMMUNITY = [
...
{
name: 'Validator Central',
Thumbnail: ValidatorCentral,
bio: 'Summing up my validator identity in a sentence or so. Maximum 300 characters.',
email: '[email protected]',
twitter: '@ParityTech',
website: 'https://parity.io',
name: '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: {
polkadot: [
'1hYiMW8KSfUYChzCQSPGXvMSyKVqmyvMXqohjKr3oU5PCXF',
'14QSBoJMHF2Zn2XEoLNSeWgqBRr8XoKPy4BxToD6yLSeFFYe'
cere: [
'6S4mrsCrqWoBAYrp2PKQNh7CYcCtyEtYpx5J626Kj5vszSyy',
'6QhzyvZQm3dLjDmeaoUnLPXzfuTi6X1HEo6AX6gfVbC3shzD',
'6RgfwDiQTLjgbkQ5CorrKtRtCaDABQKYsibk9MeyvzmKFrk2',
'6TBhZAgtFc3Wr8BeNu5tdMJG1NDpxKbG2Hwf2UbVtMGyFxzN',
'6Pyh9zZgp4XCP338VDG7oshK7PvsAdyuBN6S2NNm7CBoCXx8',
'6S9tXQmPYoeBXYey8vKYi9BMbNMD8Zgqb62k7SYMNQLUbydZ',
'6PwAv2L43zGPEwHTb1L7LyCWv7yq2Hc4dSVYHvvi1kscCR91',
'6Qshjra42mLDtc9ouHzUz1bMmYXg2qasmW2xSLgendRdsYED',
],
kusama: ['FykhnPA3pn269LAcQ8VQKDgUQ8ieAaSLwJDhAVhu3dcokVR'],
},
},
...
Expand Down
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": "1.1.1",
"version": "1.2.0",
"license": "apache-2.0",
"private": false,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ReactComponent as CereLogoSvg } from 'img/cere_logo.svg';
import { ReactComponent as CereIconSvg } from 'img/cere_icon.svg';

const cereMainnet = {
name: 'Cere Mainnet',
name: 'Cere',
colors: {
primary: {
light: 'rgb(183, 174, 255)',
Expand Down
9 changes: 9 additions & 0 deletions src/config/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Pools from 'pages/Pools';
import Browse from 'pages/Validators';
import Favourites from 'pages/Favourites';
import Payouts from 'pages/Payouts';
import Community from 'pages/Community';
import { URI_PREFIX } from 'consts';
import { PageCategories, PagesConfig } from 'types';

Expand Down Expand Up @@ -76,6 +77,14 @@ export const PAGES_CONFIG: PagesConfig = [
Entry: Browse,
icon: faServer,
},
{
category: 3,
title: 'Community',
uri: `${URI_PREFIX}/community`,
hash: '/community',
Entry: Community,
icon: faHashtag,
},
{
category: 3,
title: 'Favourites',
Expand Down
146 changes: 17 additions & 129 deletions src/config/validators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,139 +5,27 @@
* Use upper camel-case for your SVG import, lower camel case for the svg.
* import { ReactComponent as ValidatorEntityName } from './thumbnails/validatorEntityName.svg';
*/
import { ReactComponent as Amforc } from './thumbnails/amforc.svg';
import { ReactComponent as Crifferent } from './thumbnails/crifferent.svg';
import { ReactComponent as HighStake } from './thumbnails/highstake.svg';
import { ReactComponent as Polkachu } from './thumbnails/polkachu.svg';
import { ReactComponent as Polkadotters } from './thumbnails/polkadotters.svg';
import { ReactComponent as Stakerspace } from './thumbnails/stakerspace.svg';
import { ReactComponent as TurboFlakes } from './thumbnails/turboflakes.svg';
import { ReactComponent as Wojdot } from './thumbnails/wojdot.svg';
import { ReactComponent as Cere } from './thumbnails/cere.svg';

export const VALIDATOR_COMMUNITY = [
{
name: '🍁 HIGH/STAKE 🥩',
Thumbnail: HighStake,
bio: 'We came for the memes, we stay for the tech. Located in Switzerland with 15+ years of experience in running reliable online services. We are exclusively running our validators on dedicated hardware in datacenters across Europe.',
email: '[email protected]',
website: 'https://highstake.tech/',
validators: {
polkadot: [
'12bget8jJWnyjqYPiCwkXZjDh5tDBkta1WUcDYyndbXVDmQ1',
'12Dw4SzhsxX3fpDiLUYXm9oGbfxcbg1Peq67gc5jkkEo1TKr',
],
kusama: [
'DbRgw96nMQcFEFZWTLd6LSPNdh8u3NBuUDfAhDmB6UU8cJC',
'HQuPha82sRy91zZn73XRGJVV3ernBh5HZKftUcoDT8CSUwK',
],
},
},
{
name: 'Amforc',
Thumbnail: Amforc,
bio: 'We are a independent and experienced staking provider from Switzerland. We run our validators in a hybrid cloud setup across multiple geographical locations. Our validators run significantly above average and close to no blocks are missed as para-validator.',
email: '[email protected]',
twitter: '@amforcag',
website: 'https://amforc.com/',
validators: {
polkadot: ['1y6CPLgccsysCEii3M7jQF834GZsz9A3HMcZz3w7RjGPpBL'],
kusama: [
'DVUNoinHdSNfismcrFaBwdJfysxc7A48QkNvTDnTSPXPw3q',
'DpLatoXXBiSAPooF17bzUZGo7huNB7USfRqd2SgL6RBy2zr',
'E8zY6KdAH1vuKKMaPdHYLAziht32v2BLqXk6qBw7WtiV2Dv',
'Ff3xdNrXA47svhiTJHj9uNhxLo29PYjYcJ9cUseAd9FK6iQ',
],
},
},
{
name: 'polkachu.com',
Thumbnail: Polkachu,
bio: 'Polkachu Validators helps investors compound their crypto investments with low commission and advanced support.',
email: '[email protected]',
twitter: '@polka_chu',
website: 'https://polkachu.com/',
validators: {
polkadot: ['15ym3MDSG4WPABNoEtx2rAzBB1EYWJDWbWYpNg1BwuWRAQcY'],
kusama: [
'CsKvJ4fdesaRALc5swo5iknFDpop7YUwKPJHdmUvBsUcMGb',
'GpyTMuLmG3ADWRxhZpHQh5rqMgNpFoNUyxA1DJAXfvsQ2Ly',
'CeD8Kk3QLzp2HDRSciF6YQAc2xYAPurMsHAQUGwEJgCWAf2',
'GZmbAW7rRi2qkMrHYzmeG2a3fS7nTaAZpjdum8QZ7CvmM7H',
'G1qbViqnm6yCZwEbfB4oE38ro8VqJx21zyvW7QN8zAJC2B7',
],
},
},
{
name: 'Polkadotters',
Thumbnail: Polkadotters,
bio: 'We are Polkadot focused node operators and community builders from Czechia.',
email: '[email protected]',
twitter: '@Polkadotters1',
website: 'https://polkadotters.com/',
validators: {
polkadot: ['16A4n4UQqgxw5ndeehPjUAobDNmuX2bBoPXVKj4xTe16ktRN'],
kusama: ['FVAFUJhJy9tj1X4PaEXX3tDzjaBEVsVunABAdsDMD4ZYmWA'],
},
},
{
name: 'Sik | crifferent.de',
Thumbnail: Crifferent,
bio: 'Crifferent offers reliable and secure staking services made in Germany. Combining professionals from IT, marketing, and finance, they evaluate the best projects and offer services to its full extent.',
email: '[email protected]',
twitter: '@dev0_sik',
website: 'https://crifferent.de/',
validators: {
polkadot: ['15wepZh1jWNqxBjsgErm8HmYiE21n79c5krQJeTsYAjHddeM'],
kusama: [
'HWyLYmpW68JGJYoVJcot6JQ1CJbtUQeTdxfY1kUTsvGCB1r',
'GLSikJaXTVWvWtUhzB3Bj6xb5TcnhTUp6EuAkxaCohT9UBv',
],
},
},
{
name: 'Staker Space',
Thumbnail: Stakerspace,
bio: 'Hi! We are an independent and experienced staking provider. Our homebase is the Netherlands, but we have a run across multiple geographical locations dedicated hardware for our validators. We have been running Kusama and Polkadot validators since the start of the network are highly experienced in doing so. If you have any questions, please get in touch with us.',
email: '[email protected]',
twitter: '@stakerspace',
website: 'https://staker.space',
validators: {
polkadot: [
'16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p',
'14N5nJ4oR4Wj36DsBcPLh1JqjvrM2Uf23No2yc2ojjCvSC24',
'1NqVmUJCyaj5yZ9jp7ZZa58hbUx2QaBZ4eSCu9bqAdZXgAm',
],
kusama: [
'FcjmeNzPk3vgdENm1rHeiMCxFK96beUoi2kb59FmCoZtkGF',
'Eksma7JmWh8DenpNKi2uCavwaKJ9QrJJbtcnmwJr3hbHSmC',
'Dm64aaAUyy5dvYCSmyzz3njGrWrVaki9F6BvUDSYjDDoqR2',
'DfHkfoKa6xzNMWTNGL8SH8VyY69gajen4ijgmegeU4cZm1H',
name: '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: 'TurboFlakes',
Thumbnail: TurboFlakes,
bio: 'TurboFlakes provides validators with character running on top of dedicated and high performance servers. Raiden, Coco and Momo are our named validators serving non-stop Polkadot and Kusama. We also provide end-user tooling to help you to interact with substrate blockchain networks. Feel free to reach out.',
email: '[email protected]',
twitter: '@turboflakes',
website: 'https://turboflakes.io',
validators: {
polkadot: ['12gPFmRqnsDhc9C5DuXyXBFA23io5fSGtKTSAimQtAWgueD2'],
kusama: [
'FZsMKYHoQG1dAVhXBMyC7aYFYpASoBrrMYsAn1gJJUAueZX',
'GA7j1FHWXpEU4kavowEte6LWR3NgZ8bkv4spWa9joiQF5R2',
],
},
},
{
name: 'WOJDOT ʕ •ᴥ•ʔ',
Thumbnail: Wojdot,
bio: 'Independent Polkadot Validator. We run our service on bare metal machines via a cloud service with the ability to spin up validator nodes in different regions within a matter of minutes.',
email: '[email protected]',
twitter: '@wojdot',
validators: {
polkadot: ['13kz33kotYa3M75u5avMS367zJY3Fx2y5ZYASEPunqfEeCjD'],
},
},
];
15 changes: 15 additions & 0 deletions src/config/validators/thumbnails/cere.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 41 additions & 28 deletions src/library/ValidatorList/Validator/Utils.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,56 @@
// Copyright 2022 @paritytech/polkadot-staking-dashboard authors & contributors
// Copyright 2023 @paritytech/polkadot-staking-dashboard authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { u8aToString, u8aUnwrapBytes } from '@polkadot/util';

export const getIdentityDisplay = (identity: any, _superIdentity: any) => {
// first check identity of validator
export const getIdentityDisplay = (_identity: any, _superIdentity: any) => {
let displayFinal = '';
let foundSuper = false;

// display.Raw
let display = identity?.info?.display?.Raw ?? null;
// legal.Raw
display = display === null ? identity?.info?.legal.Raw ?? null : display;

// check if identity has been byte encoded
const displayAsBytes = u8aToString(u8aUnwrapBytes(display));

if (displayAsBytes !== '') {
return displayAsBytes;
}
if (display !== null) {
return display;
}

// if still null, check super identity
// check super identity exists, get display.Raw if it does
const superIdentity = _superIdentity?.identity ?? null;
const superRaw = _superIdentity?.[1]?.Raw ?? null;
const superDisplay = superIdentity?.info?.display?.Raw ?? null;

// display.Raw
display = superIdentity?.info?.display?.Raw ?? null;
// legal.Raw
display = display === null ? superIdentity?.info?.legal.Raw ?? null : display;
// check if super raw has been encoded
const superRawAsBytes = u8aToString(u8aUnwrapBytes(superRaw));

// check if super identity has been byte encoded
const superIdentityAsBytes = u8aToString(u8aUnwrapBytes(display));
const superIdentityAsBytes = u8aToString(u8aUnwrapBytes(superDisplay));

if (superIdentityAsBytes !== '') {
return superIdentityAsBytes;
displayFinal = superIdentityAsBytes;
foundSuper = true;
} else if (superDisplay !== null) {
displayFinal = superDisplay;
foundSuper = true;
}

if (!foundSuper) {
// cehck sub identity exists, get display.Raw if it does
const identity = _identity?.info?.display?.Raw ?? null;

// check if identity has been byte encoded
const subIdentityAsBytes = u8aToString(u8aUnwrapBytes(identity));

if (subIdentityAsBytes !== '') {
displayFinal = subIdentityAsBytes;
} else if (identity !== null) {
displayFinal = identity;
}
}
if (display !== null) {
return display;
if (displayFinal === '') {
return null;
}

return display;
return (
<>
{displayFinal}
{superRawAsBytes !== '' ? (
<span> / {superRawAsBytes}</span>
) : superRaw !== null ? (
<span> / {superRaw}</span>
) : null}
</>
);
};
2 changes: 1 addition & 1 deletion src/library/ValidatorList/Validator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface IdentityProps {
}

export interface MetricsProps {
display: string;
display: any;
address: string;
}

Expand Down

0 comments on commit 8b04633

Please sign in to comment.