Check endpoints sort order (#5564)
* Check endpoints sort order * colors adjust * Adjust * Sorting via objects * linting * shared santize
This commit is contained in:
parent
17296cc259
commit
b47f6cbacf
@ -39,7 +39,7 @@ describe('--SLOW--: check configured chain connections', (): void => {
|
||||
)
|
||||
.map(({ text, value }): Partial<Endpoint> => ({
|
||||
name: text as string,
|
||||
ws: value as string
|
||||
ws: value
|
||||
}))
|
||||
.filter((v): v is Endpoint => !!v.ws)
|
||||
.forEach(({ name, ws }) =>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { assert, isString } from '@polkadot/util';
|
||||
import { assert, isNumber, isString } from '@polkadot/util';
|
||||
|
||||
import { createWsEndpoints } from '.';
|
||||
|
||||
@ -10,21 +10,49 @@ interface Endpoint {
|
||||
ws: string;
|
||||
}
|
||||
|
||||
const allEndpoints = createWsEndpoints((k: string, v?: string) => v || k);
|
||||
|
||||
describe('urls are all valid', (): void => {
|
||||
createWsEndpoints((k: string, v?: string) => v || k)
|
||||
allEndpoints
|
||||
.filter(({ value }) =>
|
||||
value &&
|
||||
isString(value) &&
|
||||
!value.includes('127.0.0.1')
|
||||
)
|
||||
.map(({ text, value }): Partial<Endpoint> => ({
|
||||
.map(({ text, value }): Endpoint => ({
|
||||
name: text as string,
|
||||
ws: value as string
|
||||
ws: value
|
||||
}))
|
||||
.filter((v): v is Endpoint => !!v.ws)
|
||||
.forEach(({ name, ws }) =>
|
||||
it(`${name} @ ${ws}`, (): void => {
|
||||
assert(ws.startsWith('wss://'), `${name} @ ${ws} should start with wss://`);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
describe('urls are sorted', (): void => {
|
||||
let hasDevelopment = false;
|
||||
let lastHeader = '';
|
||||
const filtered = allEndpoints.filter(({ isHeader, isUnreachable, text }): boolean => {
|
||||
hasDevelopment = hasDevelopment || (!!isHeader && text === 'Development');
|
||||
|
||||
return !isUnreachable && !hasDevelopment;
|
||||
});
|
||||
|
||||
filtered.forEach(({ isHeader, text }, index): void => {
|
||||
if (isHeader) {
|
||||
lastHeader = text as string;
|
||||
} else {
|
||||
it(`${lastHeader}:: ${text as string}`, (): void => {
|
||||
assert((
|
||||
filtered[index - 1].isHeader ||
|
||||
filtered[index - 1].linked ||
|
||||
(isNumber(filtered[index - 1].paraId) && (filtered[index - 1].paraId as number) < 2000) ||
|
||||
filtered[index - 1].text === '' ||
|
||||
text === filtered[index - 1].text ||
|
||||
(text as string).localeCompare(filtered[index - 1].text as string) === 1
|
||||
), `${lastHeader}:: ${text as string} needs to be before ${filtered[index - 1].text as string}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -25,13 +25,6 @@ export function createProduction (t: TFunction, firstOnly?: boolean): LinkOption
|
||||
Centrifuge: 'wss://fullnode.centrifuge.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'crab',
|
||||
text: t('rpc.prod.crab', 'Darwinia Crab', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Darwinia Network': 'wss://crab-rpc.darwinia.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'chainx',
|
||||
text: t('rpc.prod.chainx', 'ChainX', { ns: 'apps-config' }),
|
||||
@ -48,6 +41,13 @@ export function createProduction (t: TFunction, firstOnly?: boolean): LinkOption
|
||||
'Patract Elara': 'wss://darwinia.elara.patract.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'crab',
|
||||
text: t('rpc.prod.crab', 'Darwinia Crab', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Darwinia Network': 'wss://crab-rpc.darwinia.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'dock-mainnet',
|
||||
text: t('rpc.prod.dock-mainnet', 'Dock', { ns: 'apps-config' }),
|
||||
|
||||
@ -138,6 +138,15 @@ export function createKusama (t: TFunction): EndpointOption {
|
||||
'KILT Protocol': 'wss://spiritnet.kilt.io/'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'moonriver',
|
||||
homepage: 'https://moonbeam.foundation/moonriver-crowdloan/',
|
||||
paraId: 2023,
|
||||
text: t('rpc.kusama.moonriver', 'Moonriver', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Purestake: 'wss://wss.moonriver.moonbeam.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'polkasmith',
|
||||
homepage: 'https://polkasmith.polkafoundry.com/',
|
||||
@ -175,15 +184,6 @@ export function createKusama (t: TFunction): EndpointOption {
|
||||
providers: {
|
||||
StakeTechnologies: 'wss://rpc.shiden.plasmnet.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'moonriver',
|
||||
homepage: 'https://moonbeam.foundation/moonriver-crowdloan/',
|
||||
paraId: 2023,
|
||||
text: t('rpc.kusama.moonriver', 'Moonriver', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Purestake: 'wss://wss.moonriver.moonbeam.network'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@ -38,13 +38,6 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[]
|
||||
'Commonwealth Labs': 'wss://beresheet1.edgewa.re'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'bitcountry',
|
||||
text: t('rpc.test.bitcountry', 'Bit.Country Tewai', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Bit.Country': 'wss://whenua.bit.country'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'bifrost',
|
||||
text: t('rpc.test.bifrost', 'Bifrost Asgard', { ns: 'apps-config' }),
|
||||
@ -52,6 +45,13 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[]
|
||||
Bifrost: 'wss://bifrost-rpc.liebi.com/ws'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'bitcountry',
|
||||
text: t('rpc.test.bitcountry', 'Bit.Country Tewai', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Bit.Country': 'wss://whenua.bit.country'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'canvas',
|
||||
text: t('rpc.test.canvas', 'Canvas', { ns: 'apps-config' }),
|
||||
@ -288,13 +288,6 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[]
|
||||
'phoenix Protocol': 'wss://phoenix-ws.coinid.pro/'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'polkadex',
|
||||
text: t('rpc.test.polkadex', 'Polkadex', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Polkadex Team': 'wss://blockchain.polkadex.trade'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'polkabtc',
|
||||
text: t('rpc.test.polkabtc', 'PolkaBTC', { ns: 'apps-config' }),
|
||||
@ -302,6 +295,13 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[]
|
||||
Interlay: 'wss://beta.polkabtc.io/api/parachain'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'polkadex',
|
||||
text: t('rpc.test.polkadex', 'Polkadex', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Polkadex Team': 'wss://blockchain.polkadex.trade'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'polymesh',
|
||||
text: t('rpc.test.polymesh', 'Polymesh ITN', { ns: 'apps-config' }),
|
||||
|
||||
@ -86,6 +86,14 @@ export function createWestend (t: TFunction): EndpointOption {
|
||||
'Acala Foundation': 'wss://karura-westend-rpc.aca-staging.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'whala',
|
||||
paraId: 2013,
|
||||
text: t('rpc.westend.whala', 'Whala', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Phala: 'wss://whala.phala.network/ws'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'kilt',
|
||||
homepage: 'https://www.kilt.io/',
|
||||
@ -94,14 +102,6 @@ export function createWestend (t: TFunction): EndpointOption {
|
||||
providers: {
|
||||
'KILT Protocol': 'wss://westend.kilt.io:9977'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'whala',
|
||||
paraId: 2013,
|
||||
text: t('rpc.westend.whala', 'Whala', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Phala: 'wss://whala.phala.network/ws'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@ -35,4 +35,5 @@ export interface LinkOption extends Option {
|
||||
summary?: string;
|
||||
teleport?: number[];
|
||||
textBy: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
|
||||
/* eslint sort-keys: ["error", "asc", { caseSensitive: false }] */
|
||||
|
||||
import { sanitize } from './util';
|
||||
|
||||
// The mapping here is done on the actual chain name (system.chain RPC) or
|
||||
// the actual RPC node it is corrected to (system.name RPC)
|
||||
|
||||
@ -267,84 +269,84 @@ export const chainColors = Object.entries({
|
||||
'ZERO.IO': chainZero
|
||||
}).reduce<Record<string, string>>((colors, [chain, color]) => ({
|
||||
...colors,
|
||||
[chain.toLowerCase()]: color
|
||||
[sanitize(chain)]: color
|
||||
}), {});
|
||||
|
||||
// Alphabetical overrides based on the actual software node type
|
||||
// NOTE: This is as retrieved via the system.name RPC
|
||||
export const nodeColors = [
|
||||
['Apron Node', nodeApron],
|
||||
['Basilisk', nodeBasilisk],
|
||||
['Bit.Country Node', nodeBitCountry],
|
||||
['Bifrost Node', nodeBifrost],
|
||||
['Canvas Node', nodeCanvas],
|
||||
['centrifuge chain', nodeCentrifuge],
|
||||
['Centrifuge Chain Node', nodeCentrifuge],
|
||||
['DOTMog Node', nodeDotMog],
|
||||
['edgeware node', nodeEdgeware],
|
||||
['Encointer Node', nodeEncointerNotee],
|
||||
['Encointer Node noTEE', nodeEncointerNotee],
|
||||
['Encointer Node TEE proxy', nodeEncointerTeeproxy],
|
||||
['Galital', nodeGalital],
|
||||
['Galital Parachain Collator', nodeGalital],
|
||||
['GamePower Node', nodeGamePower],
|
||||
['GEEK', nodeGeek],
|
||||
['IpseTestnet', nodeIpse],
|
||||
['Konomi Collator', nodeKonomi],
|
||||
['Kylin Collator', nodeKylin],
|
||||
['Klug Dossier Node', nodeKlug],
|
||||
['Litentry Collator', nodeLitentry],
|
||||
['Manta Collator', nodeManta],
|
||||
['Manta Node', nodeManta],
|
||||
['mybank.network node', nodeMybank],
|
||||
['NFTMart Testnet', nodeNFTMart],
|
||||
['NFTMart Staging', nodeNFTMart],
|
||||
['nodle chain node', nodeNodle],
|
||||
['OAK Testnet', nodeOakTestnet],
|
||||
['Opportunity', nodeOpportunity],
|
||||
['OriginTrail Parachain', nodeOriginTrail],
|
||||
['Pangolin', nodePangolin],
|
||||
['Parami Collator', nodeParami],
|
||||
['Patract Node', nodeJupiter],
|
||||
['Polkadex Node', nodePolkadex],
|
||||
['Polymesh Node', nodePolymesh],
|
||||
['Pontem', nodePontem],
|
||||
['Prism Node', nodePrism],
|
||||
['Prism Collator', nodePrism],
|
||||
['ReAlis Network', nodeRealis],
|
||||
['Rio Defi Chain Node', nodeRiochain],
|
||||
['Riochain Staging', nodeRiochain],
|
||||
['Shiden Collator', chainShiden],
|
||||
['SORA', nodeSora],
|
||||
['Stafi node', nodeStafi],
|
||||
['Statemine Collator', specStatemint],
|
||||
['Statemint Collator', specStatemint],
|
||||
['SubDAO Collator', nodeSubDAO],
|
||||
['subsocial node', nodeSubsocial],
|
||||
['subzero node', nodeZero],
|
||||
['Ternoa Node', nodeTernoa],
|
||||
['uni arts node', nodeUniarts],
|
||||
['UniArts Node', nodeUniarts],
|
||||
['Unique Node', nodeUnique],
|
||||
['Web3games', nodeWeb3games],
|
||||
['Westlake', nodeWestlake],
|
||||
['Westmint Collator', specWestmint],
|
||||
['Zeitgeist Node', nodeZeitgeist],
|
||||
['Zeitgeist Collator', nodeZeitgeist],
|
||||
['Zenlink Collator', nodeZenlink]
|
||||
].reduce<Record<string, string>>((colors, [node, color]) => ({
|
||||
export const nodeColors = Object.entries({
|
||||
'Apron Node': nodeApron,
|
||||
Basilisk: nodeBasilisk,
|
||||
'Bifrost Node': nodeBifrost,
|
||||
'Bit.Country Node': nodeBitCountry,
|
||||
'Canvas Node': nodeCanvas,
|
||||
'centrifuge chain': nodeCentrifuge,
|
||||
'Centrifuge Chain Node': nodeCentrifuge,
|
||||
'DOTMog Node': nodeDotMog,
|
||||
'edgeware node': nodeEdgeware,
|
||||
'Encointer Node': nodeEncointerNotee,
|
||||
'Encointer Node noTEE': nodeEncointerNotee,
|
||||
'Encointer Node TEE proxy': nodeEncointerTeeproxy,
|
||||
Galital: nodeGalital,
|
||||
'Galital Parachain Collator': nodeGalital,
|
||||
'GamePower Node': nodeGamePower,
|
||||
GEEK: nodeGeek,
|
||||
IpseTestnet: nodeIpse,
|
||||
'Klug Dossier Node': nodeKlug,
|
||||
'Konomi Collator': nodeKonomi,
|
||||
'Kylin Collator': nodeKylin,
|
||||
'Litentry Collator': nodeLitentry,
|
||||
'Manta Collator': nodeManta,
|
||||
'Manta Node': nodeManta,
|
||||
'mybank.network node': nodeMybank,
|
||||
'NFTMart Staging': nodeNFTMart,
|
||||
'NFTMart Testnet': nodeNFTMart,
|
||||
'nodle chain node': nodeNodle,
|
||||
'OAK Testnet': nodeOakTestnet,
|
||||
Opportunity: nodeOpportunity,
|
||||
'OriginTrail Parachain': nodeOriginTrail,
|
||||
Pangolin: nodePangolin,
|
||||
'Parami Collator': nodeParami,
|
||||
'Patract Node': nodeJupiter,
|
||||
'Polkadex Node': nodePolkadex,
|
||||
'Polymesh Node': nodePolymesh,
|
||||
Pontem: nodePontem,
|
||||
'Prism Collator': nodePrism,
|
||||
'Prism Node': nodePrism,
|
||||
'ReAlis Network': nodeRealis,
|
||||
'Rio Defi Chain Node': nodeRiochain,
|
||||
'Riochain Staging': nodeRiochain,
|
||||
'Shiden Collator': chainShiden,
|
||||
SORA: nodeSora,
|
||||
'Stafi node': nodeStafi,
|
||||
'Statemine Collator': specStatemint,
|
||||
'Statemint Collator': specStatemint,
|
||||
'SubDAO Collator': nodeSubDAO,
|
||||
'subsocial node': nodeSubsocial,
|
||||
'subzero node': nodeZero,
|
||||
'Ternoa Node': nodeTernoa,
|
||||
'uni arts node': nodeUniarts,
|
||||
'UniArts Node': nodeUniarts,
|
||||
'Unique Node': nodeUnique,
|
||||
Web3games: nodeWeb3games,
|
||||
Westlake: nodeWestlake,
|
||||
'Westmint Collator': specWestmint,
|
||||
'Zeitgeist Collator': nodeZeitgeist,
|
||||
'Zeitgeist Node': nodeZeitgeist,
|
||||
'Zenlink Collator': nodeZenlink
|
||||
}).reduce<Record<string, string>>((colors, [node, color]) => ({
|
||||
...colors,
|
||||
[node.toLowerCase().replace(/-/g, ' ')]: color
|
||||
[sanitize(node)]: color
|
||||
}), {});
|
||||
|
||||
// Alphabetical overrides based on the actual software node type
|
||||
// NOTE: This is as retrieved via the system.name RPC
|
||||
export const specColors = [
|
||||
['shell', specShell],
|
||||
['statemine', specStatemine],
|
||||
['statemint', specStatemint],
|
||||
['westmint', specWestmint]
|
||||
].reduce<Record<string, string>>((colors, [spec, color]) => ({
|
||||
export const specColors = Object.entries({
|
||||
shell: specShell,
|
||||
statemine: specStatemine,
|
||||
statemint: specStatemint,
|
||||
westmint: specWestmint
|
||||
}).reduce<Record<string, string>>((colors, [spec, color]) => ({
|
||||
...colors,
|
||||
[spec.toLowerCase().replace(/-/g, ' ')]: color
|
||||
[sanitize(spec)]: color
|
||||
}), {});
|
||||
|
||||
@ -3,13 +3,10 @@
|
||||
|
||||
import { chainColors, nodeColors, specColors } from './colors';
|
||||
import { identityNodes, identitySpec } from './identityIcons';
|
||||
import { sanitize } from './util';
|
||||
|
||||
export * from './logos';
|
||||
|
||||
function sanitize (value?: string): string {
|
||||
return value?.toLowerCase().replace(/-/g, ' ') || '';
|
||||
}
|
||||
|
||||
export function getSystemIcon (systemName: string, specName: string): 'beachball' | 'polkadot' | 'substrate' {
|
||||
return (
|
||||
identityNodes[sanitize(systemName)] ||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
|
||||
// anything for a specific chain, most would probably fit into the node category (but allow for chain-specific)
|
||||
// alphabetical
|
||||
import { sanitize } from '../util';
|
||||
import chainAltair from './chains/altair.svg';
|
||||
import chainDusty from './chains/dusty.png';
|
||||
import chainEquilibrium from './chains/equilibrium.svg';
|
||||
@ -123,249 +124,247 @@ import emptyLogo from './empty.svg';
|
||||
|
||||
// Alphabetical overrides based on the actual matched chain name
|
||||
// NOTE: This is as retrieved via system.chain RPC
|
||||
export const chainLogos: Record<string, unknown> = [
|
||||
['Altair', chainAltair],
|
||||
['Apron PC1', nodeApron],
|
||||
['Ares PC1', nodeAres],
|
||||
['Beast Developer', nodeBeast],
|
||||
['Crust PC1', nodeCrust],
|
||||
['ChainX', nodeChainx],
|
||||
['Charcoal Testnet', nodeCentrifuge],
|
||||
['darwinia crab', nodeCrab],
|
||||
['Darwinia Crab PC2', nodeCrab],
|
||||
['Darwinia PC2', nodeDarwinia],
|
||||
['DataHighway', nodeDataHighway],
|
||||
['Dusty', chainDusty],
|
||||
['EquilibriumTestnet', chainGenshiro],
|
||||
['Equilibrium', chainEquilibrium],
|
||||
['Steam PC', nodeEave],
|
||||
['Galital', nodeGalital],
|
||||
['Galois', nodeMath],
|
||||
['GamePower Network', nodeGamePower],
|
||||
['GEEK', nodeGeek],
|
||||
['HydraDX Hydrate', chainHydrate],
|
||||
['HydraDX Snakenet', chainSnakenet],
|
||||
['HydraDX Snakenet Gen2', chainSnakenet],
|
||||
['HydraDX Snakenet Gen3', chainSnakenet],
|
||||
['Encointer Canary', nodeEncointerNotee],
|
||||
['Encointer PC1', nodeEncointerNotee],
|
||||
['Idavoll', nodeIdavoll],
|
||||
['IntegriTEE Network', nodeIntegritee],
|
||||
['IntegriTEE PC1', nodeIntegritee],
|
||||
['IpseTestnet', nodeIpse],
|
||||
['Jupiter A1', nodeJupiter],
|
||||
['Jupiter PC1', nodeJupiter],
|
||||
['KILT', nodeKilt],
|
||||
['KILT Local', nodeKilt],
|
||||
['KILT Peregrine Testnet', nodeKilt],
|
||||
['KILT Testnet', nodeKilt],
|
||||
['Karura', chainKarura],
|
||||
['Konomi', nodeKonomi],
|
||||
['Kusama', chainKusama], // new name after CC3
|
||||
['Kusama CC1', chainKusama],
|
||||
['Kusama CC2', chainKusama],
|
||||
['Kusama CC3', chainKusama],
|
||||
['Kylin Testnet', nodeKylin],
|
||||
['KlugDossier', nodeKlug],
|
||||
['Litentry', nodeLitentry],
|
||||
['Manta Testnet', nodeManta],
|
||||
['MathChain PC1', nodeMath],
|
||||
['Moonbase Alpha', moonbeam],
|
||||
['Moonbase Stage', moonbeam],
|
||||
['Moonbase Development Testnet', moonbeam],
|
||||
['Moonriver', moonriver],
|
||||
['Moonrock', nodeMoonrock],
|
||||
['Moonshadow', moonshadow],
|
||||
['mybank.network PC1', mybank],
|
||||
['NFTMart Testnet', nodeNFTMart],
|
||||
['NFTMart Staging', nodeNFTMart],
|
||||
['OAK Testnet', oakTestnet],
|
||||
['OriginTrail Parachain', nodeOriginTrail],
|
||||
['Pangolin', nodePangolin],
|
||||
['Parami PC2', nodeParami],
|
||||
['PHOENIX PC1', nodePhoenix],
|
||||
['PolkaBTC', nodePolkaBTC],
|
||||
['PolkaBTC Staging', nodePolkaBTC],
|
||||
['Polkadex Testnet', nodePolkadex],
|
||||
['PolkaFoundry PC1', nodePolkaFoundry],
|
||||
['Pontem Testnet', nodePontem],
|
||||
['Prism Testnet', nodePrism],
|
||||
['Prism PC1', nodePrism],
|
||||
['Phala PC1', nodePhala],
|
||||
['ReAlis Network', nodeRealis],
|
||||
['Rococo', chainRococo],
|
||||
['RioChain CC-1', nodeRiochain],
|
||||
['RioChain Staging', nodeRiochain],
|
||||
['Shiden', chainShiden],
|
||||
['Shiden Shell', chainShiden],
|
||||
['Statemine', nodeStatemine],
|
||||
['Statemine Test', nodeStatemine],
|
||||
['Statemint', nodeStatemine],
|
||||
['Statemint Test', nodeStatemine],
|
||||
['SubDAO PC1', nodeSubDAO],
|
||||
['Subsocial', nodeSubsocial],
|
||||
['Subsocial PC', nodeSubsocial],
|
||||
['Tick', chainRococoTick],
|
||||
['Track', chainRococoTrack],
|
||||
['Trick', chainRococoTrick],
|
||||
['TrustBase PC1', nodeTrustBase],
|
||||
['uni arts staging network', nodeUniarts],
|
||||
['UniArts Mainnet', nodeUniarts],
|
||||
['Unique', chainUnique],
|
||||
['Unit Network', nodeUnitv],
|
||||
['VLN PC', nodeVln],
|
||||
['Vln', nodeVln],
|
||||
['Web3games', nodeWeb3games],
|
||||
['Westlake', nodeWestlake],
|
||||
['Westmint', nodeStatemine],
|
||||
['Westmint Test', nodeStatemine],
|
||||
['WILT', nodeKilt]
|
||||
].reduce((logos, [chain, logo]): Record<string, unknown> => ({
|
||||
export const chainLogos = Object.entries({
|
||||
Altair: chainAltair,
|
||||
'Apron PC1': nodeApron,
|
||||
'Ares PC1': nodeAres,
|
||||
'Beast Developer': nodeBeast,
|
||||
ChainX: nodeChainx,
|
||||
'Charcoal Testnet': nodeCentrifuge,
|
||||
'Crust PC1': nodeCrust,
|
||||
'darwinia crab': nodeCrab,
|
||||
'Darwinia Crab PC2': nodeCrab,
|
||||
'Darwinia PC2': nodeDarwinia,
|
||||
DataHighway: nodeDataHighway,
|
||||
Dusty: chainDusty,
|
||||
'Encointer Canary': nodeEncointerNotee,
|
||||
'Encointer PC1': nodeEncointerNotee,
|
||||
Equilibrium: chainEquilibrium,
|
||||
EquilibriumTestnet: chainGenshiro,
|
||||
Galital: nodeGalital,
|
||||
Galois: nodeMath,
|
||||
'GamePower Network': nodeGamePower,
|
||||
GEEK: nodeGeek,
|
||||
'HydraDX Hydrate': chainHydrate,
|
||||
'HydraDX Snakenet': chainSnakenet,
|
||||
'HydraDX Snakenet Gen2': chainSnakenet,
|
||||
'HydraDX Snakenet Gen3': chainSnakenet,
|
||||
Idavoll: nodeIdavoll,
|
||||
'IntegriTEE Network': nodeIntegritee,
|
||||
'IntegriTEE PC1': nodeIntegritee,
|
||||
IpseTestnet: nodeIpse,
|
||||
'Jupiter A1': nodeJupiter,
|
||||
'Jupiter PC1': nodeJupiter,
|
||||
Karura: chainKarura,
|
||||
KILT: nodeKilt,
|
||||
'KILT Local': nodeKilt,
|
||||
'KILT Peregrine Testnet': nodeKilt,
|
||||
'KILT Testnet': nodeKilt,
|
||||
KlugDossier: nodeKlug,
|
||||
Konomi: nodeKonomi,
|
||||
Kusama: chainKusama, // new name after CC3
|
||||
'Kusama CC1': chainKusama,
|
||||
'Kusama CC2': chainKusama,
|
||||
'Kusama CC3': chainKusama,
|
||||
'Kylin Testnet': nodeKylin,
|
||||
Litentry: nodeLitentry,
|
||||
'Manta Testnet': nodeManta,
|
||||
'MathChain PC1': nodeMath,
|
||||
'Moonbase Alpha': moonbeam,
|
||||
'Moonbase Development Testnet': moonbeam,
|
||||
'Moonbase Stage': moonbeam,
|
||||
Moonriver: moonriver,
|
||||
Moonrock: nodeMoonrock,
|
||||
Moonshadow: moonshadow,
|
||||
'mybank.network PC1': mybank,
|
||||
'NFTMart Staging': nodeNFTMart,
|
||||
'NFTMart Testnet': nodeNFTMart,
|
||||
'OAK Testnet': oakTestnet,
|
||||
'OriginTrail Parachain': nodeOriginTrail,
|
||||
Pangolin: nodePangolin,
|
||||
'Parami PC2': nodeParami,
|
||||
'Phala PC1': nodePhala,
|
||||
'PHOENIX PC1': nodePhoenix,
|
||||
PolkaBTC: nodePolkaBTC,
|
||||
'PolkaBTC Staging': nodePolkaBTC,
|
||||
'Polkadex Testnet': nodePolkadex,
|
||||
'PolkaFoundry PC1': nodePolkaFoundry,
|
||||
'Pontem Testnet': nodePontem,
|
||||
'Prism PC1': nodePrism,
|
||||
'Prism Testnet': nodePrism,
|
||||
'ReAlis Network': nodeRealis,
|
||||
'RioChain CC-1': nodeRiochain,
|
||||
'RioChain Staging': nodeRiochain,
|
||||
Rococo: chainRococo,
|
||||
Shiden: chainShiden,
|
||||
'Shiden Shell': chainShiden,
|
||||
Statemine: nodeStatemine,
|
||||
'Statemine Test': nodeStatemine,
|
||||
Statemint: nodeStatemine,
|
||||
'Statemint Test': nodeStatemine,
|
||||
'Steam PC': nodeEave,
|
||||
'SubDAO PC1': nodeSubDAO,
|
||||
Subsocial: nodeSubsocial,
|
||||
'Subsocial PC': nodeSubsocial,
|
||||
Tick: chainRococoTick,
|
||||
Track: chainRococoTrack,
|
||||
Trick: chainRococoTrick,
|
||||
'TrustBase PC1': nodeTrustBase,
|
||||
'uni arts staging network': nodeUniarts,
|
||||
'UniArts Mainnet': nodeUniarts,
|
||||
Unique: chainUnique,
|
||||
'Unit Network': nodeUnitv,
|
||||
Vln: nodeVln,
|
||||
'VLN PC': nodeVln,
|
||||
Web3games: nodeWeb3games,
|
||||
Westlake: nodeWestlake,
|
||||
Westmint: nodeStatemine,
|
||||
'Westmint Test': nodeStatemine,
|
||||
WILT: nodeKilt
|
||||
}).reduce<Record<string, unknown>>((logos, [chain, logo]) => ({
|
||||
...logos,
|
||||
[(chain as string).toLowerCase()]: logo
|
||||
[sanitize(chain)]: logo
|
||||
}), {});
|
||||
|
||||
// Alphabetical overrides based on the actual software node type
|
||||
// NOTE: This is as retrieved via system.name RPC
|
||||
export const nodeLogos: Record<string, unknown> = [
|
||||
['Acala Node', nodeAcala],
|
||||
['Apron Node', nodeApron],
|
||||
['Apron Parachain Collator', nodeApron],
|
||||
['Ares Node', nodeAres],
|
||||
['Ares Parachain Collator', nodeAres],
|
||||
['airalab-robonomics', nodeRobonomics],
|
||||
['Basilisk', nodeBasilisk],
|
||||
['Beast Node', nodeBeast],
|
||||
['Bifrost Node', nodeBifrost],
|
||||
['Bifrost', nodeBifrost],
|
||||
['BitCountry Node', nodeBitCountry],
|
||||
['Bit.Country', nodeBitCountry],
|
||||
['Bit Country Tewai Parachain Collator', nodeBitCountry],
|
||||
['Canvas Node', nodeCanvas],
|
||||
['centrifuge chain', nodeCentrifuge],
|
||||
['Centrifuge Chain Node', nodeCentrifuge],
|
||||
['ChainX Node', nodeChainx],
|
||||
['Clover Node', nodeClover],
|
||||
['darwinia crab', nodeCrab],
|
||||
['crust', nodeCrust],
|
||||
['Crust Collator', nodeCrust],
|
||||
['darwinia', nodeDarwinia],
|
||||
['darwinia parachain', nodeDarwinia],
|
||||
['Darwinia Runtime Module Library', nodeDarwinia],
|
||||
['DataHighway', nodeDataHighway],
|
||||
['DataHighway Node', nodeDataHighway],
|
||||
['DataHighway Parachain Collator', nodeDataHighway],
|
||||
['Dock Full Node', nodeDockMainnet],
|
||||
['DOTMog Node', nodeDotMog],
|
||||
['Eave Node', nodeEave],
|
||||
['Edgeware Node', nodeEdgeware],
|
||||
['IpseTestnet', nodeIpse],
|
||||
['Encointer Node', nodeEncointerNotee],
|
||||
['Encointer Node noTEE', nodeEncointerNotee],
|
||||
['Encointer Node TEE proxy', nodeEncointerTeeproxy],
|
||||
['Galital Parachain Collator', nodeGalital],
|
||||
['Galois', nodeMath],
|
||||
['GamePower Node', nodeGamePower],
|
||||
['GEEK', nodeGeek],
|
||||
['Halongbay Parachain Collator', nodePolkaFoundry],
|
||||
['hanonycash', nodeHanonycash],
|
||||
['Idavoll Node', nodeIdavoll],
|
||||
['Khala', nodeKhala],
|
||||
['Khala Node', nodeKhala],
|
||||
['KILT', nodeKilt],
|
||||
['KILT Local', nodeKilt],
|
||||
['KILT Peregrine Testnet', nodeKilt],
|
||||
['Kylin Node', nodeKylin],
|
||||
['kulupu', nodeKulupu],
|
||||
['Klug Dossier Node', nodeKlug],
|
||||
['Laminar Node', nodeLaminar],
|
||||
['Litentry', nodeLitentry],
|
||||
['Litentry Collator', nodeLitentry],
|
||||
['mandala node', nodeAcala],
|
||||
['Manta Node', nodeManta],
|
||||
['Manta Node', nodeManta],
|
||||
['Manta Parachain Collator', nodeManta],
|
||||
['Moonrock', nodeMoonrock],
|
||||
['mybank.network', mybank],
|
||||
['NFTMart Testnet', nodeNFTMart],
|
||||
['NFTMart Staging', nodeNFTMart],
|
||||
['node-template', nodeSubstrate],
|
||||
['Nodle Chain Node', nodeNodle],
|
||||
['OAK Testnet', oakTestnet],
|
||||
['Opportunity', nodeOpportunity],
|
||||
['OriginTrail Parachain', nodeOriginTrail],
|
||||
['Pangolin', nodePangolin],
|
||||
['Patract Node', nodeJupiter],
|
||||
['Polkadex Node', nodePolkadex],
|
||||
['Pontem', nodePontem],
|
||||
['Prism Node', nodePrism],
|
||||
['Prism Collator', nodePrism],
|
||||
['parity-polkadot', nodePolkadot],
|
||||
['Parami', nodeParami],
|
||||
['Plasm', nodePlasm],
|
||||
['Plasm Node', nodePlasm],
|
||||
['Plasm Parachain Collator', nodePlasm],
|
||||
['phala-substrate-node', nodePhala],
|
||||
['Phala Collator', nodePhala],
|
||||
['PHOENIX Node', nodePhoenix],
|
||||
['PHOENIX Collator', nodePhoenix],
|
||||
['polkadot-js', nodePolkadotJs],
|
||||
['PolkaFoundry Node', nodePolkaFoundry],
|
||||
['PolkaFoundry Parachain Collator', nodePolkaFoundry],
|
||||
['PolkaSmith Parachain Collator', nodePolkaSmith],
|
||||
['Pontem', nodePontem],
|
||||
['ReAlis Network', nodeRealis],
|
||||
['Rio Defi Chain Node', nodeRiochain],
|
||||
['RioChain Staging', nodeRiochain],
|
||||
['Sakura', nodeSakura],
|
||||
['Shadow', nodeShadow],
|
||||
['Shiden Collator', chainShiden],
|
||||
['SORA', nodeSora],
|
||||
['Stafi Node', nodeStafi],
|
||||
['Stafi', nodeStafi],
|
||||
['Statemine Collator', nodeStatemine],
|
||||
['Statemint Collator', nodeStatemine],
|
||||
['SubDAO Collator', nodeSubDAO],
|
||||
['subsocial-node', nodeSubsocial],
|
||||
['Subsocial Node', nodeSubsocial],
|
||||
['Subsocial PC', nodeSubsocial],
|
||||
['sherpax', nodeChainx],
|
||||
['substrate-node', nodeSubstrate],
|
||||
['subzero node', nodeZero],
|
||||
['Ternoa Node', nodeTernoa],
|
||||
['TrustBase Node', nodeTrustBase],
|
||||
['TrustBase Collator', nodeTrustBase],
|
||||
['uni arts node', nodeUniarts],
|
||||
['UniArts Node', nodeUniarts],
|
||||
['Unit Node', nodeUnitv],
|
||||
['Unit Collator', nodeUnitv],
|
||||
['Unique Node', nodeUnique],
|
||||
['Vln', nodeVln],
|
||||
['VLN PC', nodeVln],
|
||||
['Web3games', nodeWeb3games],
|
||||
['Westlake', nodeWestlake],
|
||||
['Westmint Collator', nodeStatemine],
|
||||
['Whala', nodeWhala],
|
||||
['Whala Node', nodeWhala],
|
||||
['WILT', nodeKilt],
|
||||
['Zenlink', nodeZenlink],
|
||||
['Zenlink Collator', nodeZenlink],
|
||||
['Zeitgeist Node', nodeZeitgeist],
|
||||
['Zeitgeist Collator', nodeZeitgeist]
|
||||
].reduce((logos, [node, logo]): Record<string, unknown> => ({
|
||||
export const nodeLogos = Object.entries({
|
||||
'Acala Node': nodeAcala,
|
||||
'airalab-robonomics': nodeRobonomics,
|
||||
'Apron Node': nodeApron,
|
||||
'Apron Parachain Collator': nodeApron,
|
||||
'Ares Node': nodeAres,
|
||||
'Ares Parachain Collator': nodeAres,
|
||||
Basilisk: nodeBasilisk,
|
||||
'Beast Node': nodeBeast,
|
||||
Bifrost: nodeBifrost,
|
||||
'Bifrost Node': nodeBifrost,
|
||||
'Bit Country Tewai Parachain Collator': nodeBitCountry,
|
||||
'Bit.Country': nodeBitCountry,
|
||||
'BitCountry Node': nodeBitCountry,
|
||||
'Canvas Node': nodeCanvas,
|
||||
'centrifuge chain': nodeCentrifuge,
|
||||
'Centrifuge Chain Node': nodeCentrifuge,
|
||||
'ChainX Node': nodeChainx,
|
||||
'Clover Node': nodeClover,
|
||||
crust: nodeCrust,
|
||||
'Crust Collator': nodeCrust,
|
||||
darwinia: nodeDarwinia,
|
||||
'darwinia crab': nodeCrab,
|
||||
'darwinia parachain': nodeDarwinia,
|
||||
'Darwinia Runtime Module Library': nodeDarwinia,
|
||||
DataHighway: nodeDataHighway,
|
||||
'DataHighway Node': nodeDataHighway,
|
||||
'DataHighway Parachain Collator': nodeDataHighway,
|
||||
'Dock Full Node': nodeDockMainnet,
|
||||
'DOTMog Node': nodeDotMog,
|
||||
'Eave Node': nodeEave,
|
||||
'Edgeware Node': nodeEdgeware,
|
||||
'Encointer Node': nodeEncointerNotee,
|
||||
'Encointer Node noTEE': nodeEncointerNotee,
|
||||
'Encointer Node TEE proxy': nodeEncointerTeeproxy,
|
||||
'Galital Parachain Collator': nodeGalital,
|
||||
Galois: nodeMath,
|
||||
'GamePower Node': nodeGamePower,
|
||||
GEEK: nodeGeek,
|
||||
'Halongbay Parachain Collator': nodePolkaFoundry,
|
||||
hanonycash: nodeHanonycash,
|
||||
'Idavoll Node': nodeIdavoll,
|
||||
IpseTestnet: nodeIpse,
|
||||
Khala: nodeKhala,
|
||||
'Khala Node': nodeKhala,
|
||||
KILT: nodeKilt,
|
||||
'KILT Local': nodeKilt,
|
||||
'KILT Peregrine Testnet': nodeKilt,
|
||||
'Klug Dossier Node': nodeKlug,
|
||||
kulupu: nodeKulupu,
|
||||
'Kylin Node': nodeKylin,
|
||||
'Laminar Node': nodeLaminar,
|
||||
Litentry: nodeLitentry,
|
||||
'Litentry Collator': nodeLitentry,
|
||||
'mandala node': nodeAcala,
|
||||
'Manta Node': nodeManta,
|
||||
'Manta Parachain Collator': nodeManta,
|
||||
Moonrock: nodeMoonrock,
|
||||
'mybank.network': mybank,
|
||||
'NFTMart Staging': nodeNFTMart,
|
||||
'NFTMart Testnet': nodeNFTMart,
|
||||
'node-template': nodeSubstrate,
|
||||
'Nodle Chain Node': nodeNodle,
|
||||
'OAK Testnet': oakTestnet,
|
||||
Opportunity: nodeOpportunity,
|
||||
'OriginTrail Parachain': nodeOriginTrail,
|
||||
Pangolin: nodePangolin,
|
||||
Parami: nodeParami,
|
||||
'parity-polkadot': nodePolkadot,
|
||||
'Patract Node': nodeJupiter,
|
||||
'Phala Collator': nodePhala,
|
||||
'phala-substrate-node': nodePhala,
|
||||
'PHOENIX Collator': nodePhoenix,
|
||||
'PHOENIX Node': nodePhoenix,
|
||||
Plasm: nodePlasm,
|
||||
'Plasm Node': nodePlasm,
|
||||
'Plasm Parachain Collator': nodePlasm,
|
||||
'Polkadex Node': nodePolkadex,
|
||||
'polkadot-js': nodePolkadotJs,
|
||||
'PolkaFoundry Node': nodePolkaFoundry,
|
||||
'PolkaFoundry Parachain Collator': nodePolkaFoundry,
|
||||
'PolkaSmith Parachain Collator': nodePolkaSmith,
|
||||
Pontem: nodePontem,
|
||||
'Prism Collator': nodePrism,
|
||||
'Prism Node': nodePrism,
|
||||
'ReAlis Network': nodeRealis,
|
||||
'Rio Defi Chain Node': nodeRiochain,
|
||||
'RioChain Staging': nodeRiochain,
|
||||
Sakura: nodeSakura,
|
||||
Shadow: nodeShadow,
|
||||
sherpax: nodeChainx,
|
||||
'Shiden Collator': chainShiden,
|
||||
SORA: nodeSora,
|
||||
Stafi: nodeStafi,
|
||||
'Stafi Node': nodeStafi,
|
||||
'Statemine Collator': nodeStatemine,
|
||||
'Statemint Collator': nodeStatemine,
|
||||
'SubDAO Collator': nodeSubDAO,
|
||||
'Subsocial Node': nodeSubsocial,
|
||||
'Subsocial PC': nodeSubsocial,
|
||||
'subsocial-node': nodeSubsocial,
|
||||
'substrate-node': nodeSubstrate,
|
||||
'subzero node': nodeZero,
|
||||
'Ternoa Node': nodeTernoa,
|
||||
'TrustBase Collator': nodeTrustBase,
|
||||
'TrustBase Node': nodeTrustBase,
|
||||
'uni arts node': nodeUniarts,
|
||||
'UniArts Node': nodeUniarts,
|
||||
'Unique Node': nodeUnique,
|
||||
'Unit Collator': nodeUnitv,
|
||||
'Unit Node': nodeUnitv,
|
||||
Vln: nodeVln,
|
||||
'VLN PC': nodeVln,
|
||||
Web3games: nodeWeb3games,
|
||||
Westlake: nodeWestlake,
|
||||
'Westmint Collator': nodeStatemine,
|
||||
Whala: nodeWhala,
|
||||
'Whala Node': nodeWhala,
|
||||
WILT: nodeKilt,
|
||||
'Zeitgeist Collator': nodeZeitgeist,
|
||||
'Zeitgeist Node': nodeZeitgeist,
|
||||
Zenlink: nodeZenlink,
|
||||
'Zenlink Collator': nodeZenlink
|
||||
}).reduce<Record<string, unknown>>((logos, [node, logo]) => ({
|
||||
...logos,
|
||||
[(node as string).toLowerCase().replace(/-/g, ' ')]: logo
|
||||
[sanitize(node)]: logo
|
||||
}), {});
|
||||
|
||||
// Alphabetical overrides based on the actual specName
|
||||
export const specLogos: Record<string, unknown> = [
|
||||
['shell', nodeShell],
|
||||
['statemine', nodeStatemine],
|
||||
['statemint', nodeStatemine],
|
||||
['westmint', nodeStatemine]
|
||||
].reduce((logos, [spec, logo]): Record<string, unknown> => ({
|
||||
export const specLogos = Object.entries({
|
||||
shell: nodeShell,
|
||||
statemine: nodeStatemine,
|
||||
statemint: nodeStatemine,
|
||||
westmint: nodeStatemine
|
||||
}).reduce<Record<string, unknown>>((logos, [spec, logo]) => ({
|
||||
...logos,
|
||||
[(spec as string).toLowerCase().replace(/-/g, ' ')]: logo
|
||||
[sanitize(spec)]: logo
|
||||
}), {});
|
||||
|
||||
// Alphabetical overrides when we pass an explicit logo name
|
||||
|
||||
6
packages/apps-config/src/ui/util.ts
Normal file
6
packages/apps-config/src/ui/util.ts
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export function sanitize (value?: string): string {
|
||||
return value?.toLowerCase().replace(/-/g, ' ') || '';
|
||||
}
|
||||
@ -49,7 +49,7 @@ function combineEndpoints (endpoints: LinkOption[]): Group[] {
|
||||
result.push({ header: e.text, isDevelopment: e.isDevelopment, isSpaced: e.isSpaced, networks: [] });
|
||||
} else {
|
||||
const prev = result[result.length - 1];
|
||||
const prov = { name: e.textBy, url: e.value as string };
|
||||
const prov = { name: e.textBy, url: e.value };
|
||||
|
||||
if (prev.networks[prev.networks.length - 1] && e.text === prev.networks[prev.networks.length - 1].name) {
|
||||
prev.networks[prev.networks.length - 1].providers.push(prov);
|
||||
|
||||
@ -35,7 +35,7 @@ function getApiUrl (): string {
|
||||
const option = endpoints.find(({ dnslink }) => dnslink === ipnsChain);
|
||||
|
||||
if (option) {
|
||||
return option.value as string;
|
||||
return option.value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ function getApiUrl (): string {
|
||||
return [stored.apiUrl, process.env.WS_URL].includes(settings.apiUrl)
|
||||
? settings.apiUrl // keep as-is
|
||||
: fallbackUrl
|
||||
? fallbackUrl.value as string // grab the fallback
|
||||
? fallbackUrl.value // grab the fallback
|
||||
: 'ws://127.0.0.1:9944'; // nothing found, go local
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ export function useParaApi (paraId: BN | number): Result {
|
||||
mountedRef.current && setState({
|
||||
api: null,
|
||||
endpoints,
|
||||
urls: endpoints.map(({ value }) => value as string).reverse()
|
||||
urls: endpoints.map(({ value }) => value).reverse()
|
||||
});
|
||||
}, [endpoints, mountedRef]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user