-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
339 additions
and
7,290 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Chaindata Publish | ||
|
||
on: | ||
# runs on each commit pushed to the `main` branch | ||
push: | ||
branches: [main] | ||
# runs at `0 minutes past the hour, every 6 hours`, starting at midnight UTC | ||
schedule: | ||
- cron: '0 0/6 * * *' | ||
# can be run manually from the `Actions` tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
# only run 1 job per branch/pr/etc at a time | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
publish: | ||
name: 'Build & publish chaindata to GitHub Pages' | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
- name: Install dependencies | ||
run: bun install --frozen-lockfile | ||
- name: Build chaindata | ||
run: bun run build | ||
- name: Upload pages artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
.DS_Store | ||
*.pem | ||
.DS_Store | ||
dist | ||
node_modules | ||
|
||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
yarn-error.log* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
<img src="assets/talisman.svg" alt="Talisman" width="15%" align="right" /> | ||
|
||
[![api-link](https://img.shields.io/website?label=graphql%20api&logo=graphql&logoColor=white&style=flat-square&up_message=online&down_message=offline&url=https%3A%2F%2Fsquid.subsquid.io%2Fchaindata%2Fv%2Fv4%2Fgraphql)](https://squid.subsquid.io/chaindata/v/v4/graphql) | ||
[![api-link](https://img.shields.io/website?label=api&logo=github&logoColor=white&style=flat-square&up_message=online&down_message=offline&url=https%3A%2F%2Ftalismansociety.github.io%2Fchaindata)](https://talismansociety.github.io/chaindata) | ||
[![discord-link](https://img.shields.io/discord/858891448271634473?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/talisman) | ||
|
||
A **community controlled** repository of [relay](https://wiki.polkadot.network/docs/learn-architecture#relay-chain) and [parachain](https://wiki.polkadot.network/docs/learn-architecture#parachain-and-parathread-slots) information in the [Polkadot ecosystem](https://polkadot.network/). | ||
|
@@ -11,27 +11,54 @@ The goals of this repo are: | |
|
||
1. Provide a community-managed index of Polkadot parachains and their connection information (rpcs, chainspecs) | ||
1. Provide a source of chain and token assets across the ecosystem | ||
1. Enable developers to retrieve this information via an API suitable to their project (graphql, rest [**soon™**](https://github.com/TalismanSociety/chaindata/issues/35), npm [**soon™**](https://github.com/TalismanSociety/chaindata/issues/35)) | ||
1. Enable developers to retrieve this information via an API suitable to their project (json/rest, npm [**soon™**](https://github.com/TalismanSociety/chaindata/issues/35)) | ||
1. Move towards a decentralised model | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
At this time, this repo is used to configure an API which scrapes information from each chain and exposes it via graphql. | ||
The API can be interacted with via this URL: https://squid.subsquid.io/chaindata/v/v4/graphql | ||
The files in this repo, `chaindata.json`, `testnets-chaindata.json` and `evm-networks.json` are used to configure a GitHub workflow which scrapes information from each chain and publishes it as a collection of JSON files on GitHub Pages. | ||
|
||
The published files can be browsed at this URL: https://talismansociety.github.io/chaindata | ||
|
||
As an example, you could use this query to get the name, [genesisHash](## 'the hash of the first block on the chain') and [address type prefix](https://wiki.polkadot.network/docs/learn-account-advanced#address-format) for each chain: | ||
As an example, you could make this request to get the names, [genesisHashes](## 'the hash of the first block on the chain') and [address type prefixes](https://wiki.polkadot.network/docs/learn-account-advanced#address-format) for all chains: | ||
|
||
```graphql | ||
query { | ||
chains { | ||
genesisHash | ||
prefix | ||
name | ||
} | ||
} | ||
```ts | ||
const chains = await( | ||
await fetch(`https://talismansociety.github.io/chaindata/chains.json`) | ||
).json() | ||
``` | ||
|
||
For an example of a more advanced use-case, you can check out the [Talisman wallet](https://github.com/TalismanSociety/talisman/blob/898310b3761a7313ffaa5f2f747736dcb24fd455/packages/chaindata-provider-extension/src/graphql.ts) source code. | ||
For an example of a more advanced use-case, you can check out the [Talisman wallet](https://github.com/TalismanSociety/talisman) source code. | ||
The wallet uses chaindata to populate a database of chains and tokens which is used for features like account balance subscriptions and sending funds. | ||
|
||
## Contributing | ||
|
||
To make a contribution, please fork this repo and make your changes in your fork, then open a PR to merge your changes back into this repo. | ||
|
||
### To add chain or token logos: | ||
|
||
#### Substrate chain logos | ||
|
||
1. Identify the chain `id` from `chaindata.json` or `testnets-chaindata.json` | ||
1. Add your logo (in `svg` format) to `assets/chains/${id}.svg` | ||
|
||
#### EVM chain logos | ||
|
||
1. Identify the chain `id` from https://chainlist.org | ||
**Use the base-10 id** (e.g. `1`, or `137`), **not** the base-16 id (e.g. `0x1`, or `0x89`) | ||
1. Add your logo (in `svg` format) to `assets/chains/${id}.svg` | ||
|
||
#### Token logos | ||
|
||
1. Identify the token symbol (e.g. `KSM`) | ||
1. Add your logo (in `svg` format) to `assets/tokens/${symbol}.svg` | ||
|
||
### To build the github pages endpoint locally: | ||
|
||
1. Install [bun](bun.sh) | ||
1. Clone the repo via | ||
`git clone [email protected]:TalismanSociety/chaindata.git` | ||
1. Install the deps via | ||
`bun install` | ||
1. Run the build via | ||
`bun run build` |
Oops, something went wrong.