Skip to content

Commit

Permalink
Use apiSystemPeople for identities on {relay | system} chains, and ke…
Browse files Browse the repository at this point in the history
…ep compat for parachains (#10598)

* Use apiSystemPeople for identities on relay chains

* Add apiIdentity support

* add config

* Fix nits

* Get working condition for all chains!

* add enableIdentity for correct support

* Add comments to EndpointOption type

* Add some inline comments
  • Loading branch information
TarikGul authored May 21, 2024
1 parent c87bfe0 commit 478cd03
Show file tree
Hide file tree
Showing 32 changed files with 206 additions and 86 deletions.
13 changes: 13 additions & 0 deletions packages/apps-config/src/endpoints/productionRelayKusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ export const prodParasKusama: Omit<EndpointOption, 'teleport'>[] = [
export const prodParasKusamaCommon: EndpointOption[] = [
{
info: 'KusamaAssetHub',
isPeopleForIdentity: true,
paraId: 1000,
providers: {
Dwellir: 'wss://asset-hub-kusama-rpc.dwellir.com',
Expand All @@ -917,6 +918,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [
RadiumBlock: 'wss://statemine.public.curie.radiumblock.co/ws',
Stakeworld: 'wss://ksm-rpc.stakeworld.io/assethub'
},
relayName: 'kusama',
teleport: [-1],
text: 'AssetHub',
ui: {
Expand All @@ -926,6 +928,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [
},
{
info: 'kusamaBridgeHub',
isPeopleForIdentity: true,
paraId: 1002,
providers: {
Dwellir: 'wss://kusama-bridge-hub-rpc.dwellir.com',
Expand All @@ -938,6 +941,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [
RadiumBlock: 'wss://bridgehub-kusama.public.curie.radiumblock.co/ws',
Stakeworld: 'wss://ksm-rpc.stakeworld.io/bridgehub'
},
relayName: 'kusama',
teleport: [-1],
text: 'BridgeHub',
ui: {
Expand All @@ -946,13 +950,15 @@ export const prodParasKusamaCommon: EndpointOption[] = [
},
{
info: 'kusamaCoretime',
isPeopleForIdentity: true,
paraId: 1005,
providers: {
'IBP-GeoDNS1': 'wss://sys.ibp.network/coretime-kusama',
'IBP-GeoDNS2': 'wss://sys.dotters.network/coretime-kusama',
Parity: 'wss://kusama-coretime-rpc.polkadot.io',
Stakeworld: 'wss://ksm-rpc.stakeworld.io/coretime'
},
relayName: 'kusama',
teleport: [-1],
text: 'Coretime',
ui: {
Expand All @@ -962,6 +968,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [
{
homepage: 'https://encointer.org/',
info: 'encointer',
isPeopleForIdentity: true,
paraId: 1001,
providers: {
Dwellir: 'wss://encointer-kusama-rpc.dwellir.com',
Expand All @@ -971,6 +978,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [
// OnFinality: 'wss://encointer.api.onfinality.io/public-ws', // https://github.com/polkadot-js/apps/issues/9986
// Stakeworld: 'wss://ksm-rpc.stakeworld.io/encointer'
},
relayName: 'kusama',
teleport: [-1],
text: 'Encointer Network',
ui: {
Expand All @@ -980,11 +988,14 @@ export const prodParasKusamaCommon: EndpointOption[] = [
},
{
info: 'kusamaPeople',
isPeople: true,
isPeopleForIdentity: false,
paraId: 1004,
providers: {
Parity: 'wss://kusama-people-rpc.polkadot.io',
Stakeworld: 'wss://ksm-rpc.stakeworld.io/people'
},
relayName: 'kusama',
teleport: [-1],
text: 'People',
ui: {}
Expand All @@ -995,6 +1006,8 @@ export const prodRelayKusama: EndpointOption = {
dnslink: 'kusama',
genesisHash: KUSAMA_GENESIS,
info: 'kusama',
isPeopleForIdentity: true,
isRelay: true,
linked: [
...prodParasKusamaCommon,
...prodParasKusama
Expand Down
8 changes: 8 additions & 0 deletions packages/apps-config/src/endpoints/productionRelayPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ export const prodParasPolkadot: Omit<EndpointOption, 'teleport'>[] = [
export const prodParasPolkadotCommon: EndpointOption[] = [
{
info: 'PolkadotAssetHub',
isPeopleForIdentity: true,
paraId: 1000,
providers: {
Dwellir: 'wss://asset-hub-polkadot-rpc.dwellir.com',
Expand All @@ -844,6 +845,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [
RadiumBlock: 'wss://statemint.public.curie.radiumblock.co/ws',
Stakeworld: 'wss://dot-rpc.stakeworld.io/assethub'
},
relayName: 'polkadot',
teleport: [-1],
text: 'AssetHub',
ui: {
Expand All @@ -853,6 +855,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [
},
{
info: 'polkadotBridgeHub',
isPeopleForIdentity: true,
paraId: 1002,
providers: {
Dwellir: 'wss://polkadot-bridge-hub-rpc.dwellir.com',
Expand All @@ -865,6 +868,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [
RadiumBlock: 'wss://bridgehub-polkadot.public.curie.radiumblock.co/ws',
Stakeworld: 'wss://dot-rpc.stakeworld.io/bridgehub'
},
relayName: 'polkadot',
teleport: [-1],
text: 'BridgeHub',
ui: {
Expand All @@ -873,6 +877,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [
},
{
info: 'polkadotCollectives',
isPeopleForIdentity: true,
paraId: 1001,
providers: {
Dwellir: 'wss://polkadot-collectives-rpc.dwellir.com',
Expand All @@ -885,6 +890,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [
RadiumBlock: 'wss://collectives.public.curie.radiumblock.co/ws',
Stakeworld: 'wss://dot-rpc.stakeworld.io/collectives'
},
relayName: 'polkadot',
teleport: [-1],
text: 'Collectives',
ui: {
Expand All @@ -898,6 +904,8 @@ export const prodRelayPolkadot: EndpointOption = {
dnslink: 'polkadot',
genesisHash: POLKADOT_GENESIS,
info: 'polkadot',
isPeopleForIdentity: true,
isRelay: true,
linked: [
...prodParasPolkadotCommon,
...prodParasPolkadot
Expand Down
2 changes: 2 additions & 0 deletions packages/apps-config/src/endpoints/testingRelayPaseo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export const testRelayPaseo: EndpointOption = {
dnslink: 'paseo',
genesisHash: PASEO_GENESIS,
info: 'paseo',
isPeopleForIdentity: true,
isRelay: true,
linked: [
...testParasPaseoCommon,
...testParasPaseo
Expand Down
14 changes: 14 additions & 0 deletions packages/apps-config/src/endpoints/testingRelayRococo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,13 @@ export const testParasRococo: Omit<EndpointOption, 'teleport'>[] = [
export const testParasRococoCommon: EndpointOption[] = [
{
info: 'RococoAssetHub',
isPeopleForIdentity: true,
paraId: 1000,
providers: {
Dwellir: 'wss://asset-hub-rococo-rpc.dwellir.com',
Parity: 'wss://rococo-asset-hub-rpc.polkadot.io'
},
relayName: 'rococo',
teleport: [-1],
text: 'AssetHub',
ui: {
Expand All @@ -717,11 +719,13 @@ export const testParasRococoCommon: EndpointOption[] = [
},
{
info: 'rococoBridgehub',
isPeopleForIdentity: true,
paraId: 1013,
providers: {
Dwellir: 'wss://rococo-bridge-hub-rpc.dwellir.com',
Parity: 'wss://rococo-bridge-hub-rpc.polkadot.io'
},
relayName: 'rococo',
teleport: [-1],
text: 'Bridgehub',
ui: {
Expand All @@ -730,10 +734,12 @@ export const testParasRococoCommon: EndpointOption[] = [
},
{
info: 'rococoContracts',
isPeopleForIdentity: true,
paraId: 1002,
providers: {
Parity: 'wss://rococo-contracts-rpc.polkadot.io'
},
relayName: 'rococo',
teleport: [-1],
text: 'Contracts',
ui: {
Expand All @@ -743,21 +749,25 @@ export const testParasRococoCommon: EndpointOption[] = [
},
{
info: 'rococoCoretime',
isPeopleForIdentity: true,
paraId: 1005,
providers: {
Parity: 'wss://rococo-coretime-rpc.polkadot.io'
},
relayName: 'rococo',
teleport: [-1],
text: 'Coretime',
ui: {}
},
{
homepage: 'https://encointer.org/',
info: 'encointer',
isPeopleForIdentity: true,
paraId: 1003,
providers: {
'Encointer Association': 'wss://rococo.api.encointer.org'
},
relayName: 'rococo',
teleport: [-1],
text: 'Encointer Lietaer',
ui: {
Expand All @@ -767,10 +777,12 @@ export const testParasRococoCommon: EndpointOption[] = [
},
{
info: 'rococoPeople',
isPeopleForIdentity: false,
paraId: 1004,
providers: {
Parity: 'wss://rococo-people-rpc.polkadot.io'
},
relayName: 'rococo',
teleport: [-1],
text: 'People',
ui: {}
Expand All @@ -781,6 +793,8 @@ export const testRelayRococo: EndpointOption = {
dnslink: 'rococo',
genesisHash: ROCOCO_GENESIS,
info: 'rococo',
isPeopleForIdentity: true,
isRelay: true,
linked: [
...testParasRococoCommon,
...testParasRococo
Expand Down
13 changes: 13 additions & 0 deletions packages/apps-config/src/endpoints/testingRelayWestend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const testParasWestend: Omit<EndpointOption, 'teleport'>[] = [
export const testParasWestendCommon: EndpointOption[] = [
{
info: 'WestendAssetHub',
isPeopleForIdentity: true,
paraId: 1000,
providers: {
Dwellir: 'wss://asset-hub-westend-rpc.dwellir.com',
Expand All @@ -123,6 +124,7 @@ export const testParasWestendCommon: EndpointOption[] = [
Parity: 'wss://westend-asset-hub-rpc.polkadot.io'
// Stakeworld: 'wss://wnd-rpc.stakeworld.io/assethub'
},
relayName: 'westend',
teleport: [-1],
text: 'AssetHub',
ui: {
Expand All @@ -132,6 +134,7 @@ export const testParasWestendCommon: EndpointOption[] = [
},
{
info: 'westendBridgeHub',
isPeopleForIdentity: true,
paraId: 1002,
providers: {
Dwellir: 'wss://westend-bridge-hub-rpc.dwellir.com',
Expand All @@ -141,13 +144,15 @@ export const testParasWestendCommon: EndpointOption[] = [
// OnFinality: 'wss://bridgehub-westend.api.onfinality.io/public-ws', // https://github.com/polkadot-js/apps/issues/9960
Parity: 'wss://westend-bridge-hub-rpc.polkadot.io'
},
relayName: 'westend',
text: 'BridgeHub',
ui: {
logo: nodesBridgeHubSVG
}
},
{
info: 'westendCollectives',
isPeopleForIdentity: true,
paraId: 1001,
providers: {
Dwellir: 'wss://westend-collectives-rpc.dwellir.com',
Expand All @@ -156,6 +161,7 @@ export const testParasWestendCommon: EndpointOption[] = [
'IBP-GeoDNS2': 'wss://sys.dotters.network/collectives-westend',
Parity: 'wss://westend-collectives-rpc.polkadot.io'
},
relayName: 'westend',
teleport: [-1],
text: 'Collectives',
ui: {
Expand All @@ -165,24 +171,29 @@ export const testParasWestendCommon: EndpointOption[] = [
},
{
info: 'westendCoretime',
isPeopleForIdentity: true,
paraId: 1005,
providers: {
'IBP-GeoDNS1': 'wss://sys.ibp.network/coretime-westend',
'IBP-GeoDNS2': 'wss://sys.dotters.network/coretime-westend',
Parity: 'wss://westend-coretime-rpc.polkadot.io'
},
relayName: 'westend',
teleport: [-1],
text: 'Coretime',
ui: {}
},
{
info: 'westendPeople',
isPeople: true,
isPeopleForIdentity: false,
paraId: 1004,
providers: {
'IBP-GeoDNS1': 'wss://sys.ibp.network/people-westend',
'IBP-GeoDNS2': 'wss://sys.dotters.network/people-westend',
Parity: 'wss://westend-people-rpc.polkadot.io'
},
relayName: 'westend',
teleport: [-1],
text: 'People',
ui: { }
Expand All @@ -193,6 +204,8 @@ export const testRelayWestend: EndpointOption = {
dnslink: 'westend',
genesisHash: WESTEND_GENESIS,
info: 'westend',
isPeopleForIdentity: true,
isRelay: true,
linked: [
...testParasWestendCommon,
...testParasWestend
Expand Down
20 changes: 20 additions & 0 deletions packages/apps-config/src/endpoints/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,44 @@ export interface EndpointOption extends BaseOption {
isChild?: boolean;
isDevelopment?: boolean;
isDisabled?: boolean;
/**
* Declares whether the given endpoint is the People chain used to store identity information.
*/
isPeople?: boolean;
isUnreachable?: boolean;
linked?: EndpointOption[];
info?: string;
providers: Record<string, `${'wss://' | 'light://substrate-connect/'}${string}`>;
text: string;
/**
* Declares whether or not the endpoint is a relay chain.
*/
isRelay?: boolean;
/**
* Declares whether the given endpoint uses the People chain to store identity information.
*/
isPeopleForIdentity?: boolean;
/**
* Declares the relays name.
*/
relayName?: string;
}

export interface LinkOption extends BaseOption, Option {
genesisHashRelay?: HexString;
isChild?: boolean;
isDevelopment?: boolean;
isLightClient?: boolean;
isPeople?: boolean;
isRelay?: boolean;
isUnreachable?: boolean;
isSpaced?: boolean;
linked?: LinkOption[];
providers?: `${'wss://' | 'light://substrate-connect/'}${string}`[];
relayName?: string;
textBy: string;
textRelay?: React.ReactNode;
isPeopleForIdentity?: boolean;
value: string;
valueRelay?: string[];
}
6 changes: 5 additions & 1 deletion packages/apps-config/src/endpoints/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ function expandLinked (input: LinkOption[]): LinkOption[] {
}, []);
}

function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage, info, isChild, isDisabled, isUnreachable, linked, paraId, providers, teleport, text, ui }: EndpointOption, firstOnly: boolean, withSort: boolean): LinkOption[] {
function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage, info, isChild, isDisabled, isPeople, isPeopleForIdentity, isUnreachable, linked, paraId, providers, relayName, teleport, text, ui }: EndpointOption, firstOnly: boolean, withSort: boolean): LinkOption[] {
const hasProviders = Object.keys(providers).length !== 0;
const base = {
genesisHash,
homepage,
info,
isChild,
isDisabled,
isPeople,
isPeopleForIdentity,
isUnreachable: isUnreachable || !hasProviders,
paraId,
providers: Object.keys(providers).map((k) => providers[k]),
relayName,
teleport,
text,
ui
Expand Down
Loading

0 comments on commit 478cd03

Please sign in to comment.