Skip to content

Commit

Permalink
Merge pull request #7 from pinax-network/feature/updated-chain-metadata
Browse files Browse the repository at this point in the history
2.0.0 RC - Chains Metadata Model Upgrade
  • Loading branch information
DominicF96 authored Aug 2, 2024
2 parents 42818d9 + fbd2572 commit a79e0da
Show file tree
Hide file tree
Showing 293 changed files with 14,638 additions and 221 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
5 changes: 3 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
npm run generate
git add data.json
bun run generate
npm run generate_v1
git add .
62 changes: 33 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
# Pinax Chains

This repository is the single-source-of-truth for the metadata of chains supported by Pinax. To make it more accessible, we've published it as a private npm package ([See below](#install_from_npm)) and created a public endpoint to fetch publicly available chains metadata ([See below](#public_endpoint)).
Welcome to the Pinax Chains repository. This is the definitive source for the metadata of chains supported by Pinax **_products_**. Note that we maintain a separate, private list for internal operations.

You can have a look at the [Chain Type](/types/chain.types.ts) and at our [list of supported, to-be-supported, or once-supported chains](/data/chains).
To enhance accessibility, we offer the metadata as an [npm package](#install_from_npm) and provide a [public API endpoint](#public_endpoint) for fetching the data.

**Note**: Some chains may be listed but won't have any service supported or may have been deprecated, see each chain's metadata to ensure the chain is truly supported.
You can view details about the [Chain Type](/types/chain.types.ts) and explore our [list of supported, to-be-supported, or deprecated chains](/types/pinax.types.ts).

## Install from npm
> **Note**: Some chains may be listed without supported services or may have been deprecated. Always check the chain's metadata to confirm its current support status.
```bash
npm install @pinax/chains
```
## What's New

## Public Endpoint
With the 2.0 release, we’ve made significant improvements to enhance developer and maintainer experience. Key updates include:

You can fetch the publicly available chains metadata from the following endpoint:

```bash
curl https://pinax.network/api/chains
```

## Contributing
- ✅ Support for EVM chains
- ✅ Reintroduced TypeScript support
- ✅ Improved management of chain indexes (priority order)
- ✅ Consolidated chain utilities and service configurations across projects
- ✅ Automated checks for missing chain icons
- ✅ Simplified data model reflecting better relationships between chains, services, and networks
- ✅ Inclusion of beta chains
- ✅ Support for `unreleased` and `beta` services
- ✅ Eliminated redundant flags and information
- ✅ Integrated chains website into metadata
- And more...

If you want to contribute to the metadata of chains, please open a PR with the changes you want to make. We'll review it and merge it if it's correct.
## Installation

### Adding a new chain
You first need to install [bun](https://bun.sh/).

Adding a new chain is as simple as adding a new file to the `data/chains` directory. The file should be named after the chain's official Pinax ID and should contain the metadata of the chain. Also make sure to run the `npm run generate:type_pinaxid` and `npm run generate:data_json` commands to update the related types and index.
### From npm

If you're unsure about the fields you need to fill, you can have a look at the [Chain Type](/types/chain.types.ts) to learn more about the fields you need to fill.
To install the package, run:

### Updating an existing chain

To update an existing chain, you can simply open a PR with the changes you want to make to the chain's metadata.
```bash
npm install @pinax/chains
```

### Adding / Validating Graph IDs
### Public Endpoint

We use the `graph_id` field to match our chains to The Graph's. You can check the available graph IDs in the [Graphs](/types/graph.types.ts) file, which is [generated automatically](/scripts/generate/graphid_type.js) by fetching supported chains from The Graph's API. You can run `npm run generate:type_graphid` to update the graph IDs.
Access the chains metadata via the public API endpoint:

### Updating the Chain Type
```bash
curl https://pinax.network/api/chains
```

If you want to add a new field to the chain type, you can simply open a PR with the changes you want to make to the chain type and make sure every chain's metadata is updated to include the new field if required.
### How to use

Removing a field from the chain type is not recommended, as it may break the metadata of the chains. If you want to remove a field, please open an issue to discuss it first.
Please see [How to use](/docs/how_to_use.md) documentation for more information.

### Removing a chain
## Contributing

If a chain is no longer supported, simply set the `deprecated_at` field as the date of the deprecation. This allows the different services to know when to stop supporting the chain, and enables us to keep track of the chains we've supported in the past for proper redirects and such.
If you wish to contribute to the chain metadata, please open a pull request (PR) with your proposed changes. We will review and merge it if accurate. Be sure to consult the [documentation](/docs) before contributing.
Binary file added bun.lockb
Binary file not shown.
3 changes: 0 additions & 3 deletions configs.ts

This file was deleted.

17 changes: 0 additions & 17 deletions data.d.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "celo",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
1 change: 1 addition & 0 deletions data/chains/amoy.json → data/chains/V1/amoy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "polygon",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
9 changes: 5 additions & 4 deletions data/chains/arbgoerli.json → data/chains/V1/arbgoerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"graph_id": "arbitrum-goerli",
"name": "Arbitrum Goerli",
"alt_names": [],
"mainnet": "arbitrum",
"mainnet": "arbone",
"standard": "erc20",
"is_detailed_blocks": false,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand All @@ -15,15 +16,15 @@
"is_testnet": true,
"supported_services": {
"firehose": {
"released_at": null,
"released_at": "2024-05-03T00:00:00.000Z",
"deprecated_at": null
},
"substreams": {
"released_at": null,
"released_at": "2024-05-03T00:00:00.000Z",
"deprecated_at": null
},
"rpc": {
"released_at": null,
"released_at": "2024-05-03T00:00:00.000Z",
"deprecated_at": null
}
}
Expand Down
1 change: 1 addition & 0 deletions data/chains/arbone.json → data/chains/V1/arbone.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "arbone",
"standard": "erc20",
"is_detailed_blocks": false,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"graph_id": "arbitrum-sepolia",
"name": "Arbitrum Sepolia",
"alt_names": [],
"mainnet": "arbone",
"mainnet": "arbitrum",
"standard": "erc20",
"is_detailed_blocks": false,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
1 change: 1 addition & 0 deletions data/chains/arweave.json → data/chains/V1/arweave.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "arweave",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.arweave.type.v1.Block",
"url": "https://buf.build/pinax/firehose-arweave/docs/main:sf.arweave.type.v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "avalanche",
"standard": "erc20",
"is_detailed_blocks": false,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
1 change: 1 addition & 0 deletions data/chains/base.json → data/chains/V1/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "base",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
1 change: 1 addition & 0 deletions data/chains/bitcoin.json → data/chains/V1/bitcoin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": ["btc"],
"mainnet": "bitcoin",
"standard": "brc20",
"is_detailed_blocks": false,
"block_type": {
"label": "sf.bitcoin.type.v1.Block",
"url": "https://buf.build/streamingfast/firehose-bitcoin/docs/main:sf.bitcoin.type.v1"
Expand Down
1 change: 1 addition & 0 deletions data/chains/bsc.json → data/chains/V1/bsc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": ["bsc", "binance"],
"mainnet": "bsc",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
1 change: 1 addition & 0 deletions data/chains/celo.json → data/chains/V1/celo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"alt_names": [],
"mainnet": "celo",
"standard": "erc20",
"is_detailed_blocks": true,
"block_type": {
"label": "sf.ethereum.type.v2.Block",
"url": "https://buf.build/streamingfast/firehose-ethereum/docs/main:sf.ethereum.type.v2"
Expand Down
Loading

0 comments on commit a79e0da

Please sign in to comment.