Skip to content

Commit

Permalink
Add Light client support for Shiden and Astar (#8262)
Browse files Browse the repository at this point in the history
* Add Light client support for Shiden and Astar

* Polkadot example
  • Loading branch information
gluneau authored Oct 21, 2022
1 parent 1f41e9e commit 248876a
Show file tree
Hide file tree
Showing 8 changed files with 7,765 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/apps-config/src/endpoints/productionRelayKusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ export const prodParasKusama: EndpointOption[] = [
Blast: 'wss://shiden.public.blastapi.io',
Dwellir: 'wss://shiden-rpc.dwellir.com',
OnFinality: 'wss://shiden.api.onfinality.io/public-ws',
Pinknode: 'wss://public-rpc.pinknode.io/shiden'
Pinknode: 'wss://public-rpc.pinknode.io/shiden',
// NOTE: Keep this as the last entry, nothing after it
'light client': 'light://substrate-connect/kusama/shiden' // NOTE: Keep last
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const prodParasPolkadot: EndpointOption[] = [
Dwellir: 'wss://astar-rpc.dwellir.com',
OnFinality: 'wss://astar.api.onfinality.io/public-ws',
Pinknode: 'wss://public-rpc.pinknode.io/astar',
'Automata 1RPC': 'wss://1rpc.io/astr'
'Automata 1RPC': 'wss://1rpc.io/astr',
// NOTE: Keep this as the last entry, nothing after it
'light client': 'light://substrate-connect/polkadot/astar' // NOTE: Keep last
}
},
{
Expand Down
3 changes: 2 additions & 1 deletion packages/react-api/src/light/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import { ScProvider } from '@polkadot/api';

import { specs as kusama } from './kusama';
import { specs as polkadot } from './polkadot';

export const lightSpecs: Record<string, Record<string, string>> =
Object
.entries({ kusama })
.entries({ kusama, polkadot })
.reduce((all: Record<string, Record<string, string>>, [r, v]) => {
all[r] = v.reduce((specs: Record<string, string>, k) => {
specs[k] = `./light/${r}/${k}.json`;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-api/src/light/kusama/gm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "GM Parachain",
"name": "GM",
"id": "its_a_lifestyle",
"chainType": "Live",
"bootNodes": [
Expand Down
1 change: 1 addition & 0 deletions packages/react-api/src/light/kusama/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
// e.g. light://substrate-connect/kusama/gm
export const specs: string[] = [
'gm',
'shiden',
'tinkernet'
];
7,647 changes: 7,647 additions & 0 deletions packages/react-api/src/light/kusama/shiden.json

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions packages/react-api/src/light/polkadot/astar.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions packages/react-api/src/light/polkadot/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2017-2022 @polkadot/react-api authors & contributors
// SPDX-License-Identifier: Apache-2.0

// Add your imported spec here in alphabetical order.
// The key here reflects the URL of the light client endpoint.
// e.g. light://substrate-connect/polkadot/astar
export const specs: string[] = [
'astar'
];

0 comments on commit 248876a

Please sign in to comment.