diff --git a/.github/workflows/config-check.yaml b/.github/workflows/config-check.yaml new file mode 100644 index 00000000..4b8ebca1 --- /dev/null +++ b/.github/workflows/config-check.yaml @@ -0,0 +1,21 @@ +name: Config format check + +on: + pull_request: + paths: + - 'chains/**/*.json' + - 'scripts/check-config-format.sh' + - '.github/workflows/config-check.yaml' + +jobs: + config-format: + name: Check config JSON format + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check changed config files + run: scripts/check-config-format.sh "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9170537f..ba12b1a2 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -25,6 +25,15 @@ jobs: with: submodules: recursive + - name: Update explorer to latest + run: | + git submodule sync --recursive explorer + git submodule update --init --remote --checkout explorer + git -C explorer rev-parse --short HEAD + + - name: Patch explorer CSP + run: scripts/patch-explorer-csp.sh + - name: Setup Pages uses: actions/configure-pages@v5 @@ -40,7 +49,7 @@ jobs: - name: Install dependencies working-directory: explorer - run: yarn install --frozen-lockfile + run: yarn install - name: Build working-directory: explorer diff --git a/.github/workflows/pr-review.yaml b/.github/workflows/pr-review.yaml index e083c762..7b9454ab 100644 --- a/.github/workflows/pr-review.yaml +++ b/.github/workflows/pr-review.yaml @@ -3,13 +3,6 @@ name: Pull Request Review on: pull_request: branches: [ main ] - paths: - - 'chains/**' - - 'explorer' - - 'logos/**' - - '.github/workflows/**' - - '.gitmodules' - - 'README.md' permissions: contents: read @@ -35,6 +28,15 @@ jobs: with: submodules: recursive + - name: Update explorer to latest + run: | + git submodule sync --recursive explorer + git submodule update --init --remote --checkout explorer + git -C explorer rev-parse --short HEAD + + - name: Patch explorer CSP + run: scripts/patch-explorer-csp.sh + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -47,7 +49,7 @@ jobs: - name: Install dependencies working-directory: explorer - run: yarn install --frozen-lockfile + run: yarn install - name: Build working-directory: explorer diff --git a/.gitmodules b/.gitmodules index 1f61bfab..a3c495b1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "explorer"] path = explorer url = https://github.com/ping-pub/explorer.git + branch = master diff --git a/README.md b/README.md index 78ac1c74..a7148b97 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,9 @@ Your donation will help us make better products. Thanks in advance. **We accept all blockchains which have 10+ independent validators.** -- Submit configs for mainnet, go to https://github.com/ping-pub/ping.pub/tree/main/chains/mainnet +- Submit configs for mainnet, go to https://github.com/ping-pub/mainnet/tree/main/chains/mainnet -- Submit configs for testnet, go to https://github.com/ping-pub/ping.pub/tree/main/chains/testnet +- Submit configs for testnet, go to https://github.com/ping-pub/testnet/tree/main/chains/testnet # Example of Config diff --git a/chains/mainnet/cheqd.json b/chains/mainnet/cheqd.json index 4b7ecdb4..8d64f4ce 100644 --- a/chains/mainnet/cheqd.json +++ b/chains/mainnet/cheqd.json @@ -14,12 +14,8 @@ "address": "https://cheqd-rest.publicnode.com" }, { - "provider": "vNodes[V] Ser[V]ices", - "address": "https://api.cheqd.srvs.vnodesv.net" - }, - { - "provider": "BadgerBite", - "address": "https://cheqd-api.badgerbite.io" + "provider": "vNodes[V] [WW] Ser[V]ices", + "address": "https://cheqd-srvs.vnodesv.net/api" } ], "rpc": [ @@ -40,12 +36,8 @@ "address": "https://cheqd-rpc.publicnode.com:443" }, { - "provider": "vNodes[V] Ser[V]ices", - "address": "https://rpc.cheqd.srvs.vnodesv.net:443" - }, - { - "provider": "BadgerBite", - "address": "https://cheqd-archive.badgerbite.io" + "provider": "vNodes[V] [WW] Ser[V]ices", + "address": "https://cheqd-srvs.vnodesv.net/rpc" } ], "snapshot_provider": "", diff --git a/chains/mainnet/elys.json b/chains/mainnet/elys.json index 2a5b5f49..77816a1d 100644 --- a/chains/mainnet/elys.json +++ b/chains/mainnet/elys.json @@ -27,7 +27,7 @@ }, { "provider": "vNodes[V]", - "address": "https://elys.srvs.vnodesv.net/rest" + "address": "https://elys-api.vnodesv.net" } ], "rpc": [ @@ -57,7 +57,7 @@ }, { "provider": "vNodes[V]", - "address": "https://elys.srvs.vnodesv.net/rpc" + "address": "https://elys-rpc.vnodesv.net" } ], "coin_type": "118", diff --git a/chains/mainnet/fetchai.json b/chains/mainnet/fetchai.json index 0f871017..559d8c6a 100644 --- a/chains/mainnet/fetchai.json +++ b/chains/mainnet/fetchai.json @@ -8,6 +8,10 @@ { "provider": "Allnodes", "address": "https://fetch-rest.publicnode.com" + }, + { + "provider": "BadgerBite", + "address": "https://fetch-api.badgerbite.io" } ], "rpc": [ @@ -18,6 +22,10 @@ { "provider": "Allnodes", "address": "https://fetch-rpc.publicnode.com:443" + }, + { + "provider": "BadgerBite", + "address": "https://fetch-archive.badgerbite.io" } ], "snapshot_provider": "", diff --git a/chains/mainnet/safrochain.json b/chains/mainnet/safrochain.json new file mode 100644 index 00000000..0576533d --- /dev/null +++ b/chains/mainnet/safrochain.json @@ -0,0 +1,39 @@ +{ + "chain_name": "safrochain", + "api": [ + { + "provider": "Safrochain Foundation", + "address": "https://api1.safrochain.network" + }, + { + "provider": "Safrochain Foundation", + "address": "https://api2.safrochain.network" + } + ], + "rpc": [ + { + "provider": "Safrochain Foundation", + "address": "https://rpc1.safrochain.network" + }, + { + "provider": "Safrochain Foundation", + "address": "https://rpc2.safrochain.network" + } + ], + "snapshot_provider": "", + "sdk_version": "0.50", + "coin_type": "118", + "min_tx_fee": "5000", + "addr_prefix": "addr_safro", + "logo": "/logos/safrochain.png", + "theme_color": "#1D4ED8", + "assets": [ + { + "base": "usaf", + "symbol": "SAF", + "exponent": "6", + "coingecko_id": "", + "logo": "/logos/safrochain.png" + } + ] +} diff --git a/chains/mainnet/xion.json b/chains/mainnet/verona.json similarity index 96% rename from chains/mainnet/xion.json rename to chains/mainnet/verona.json index f2d61505..a9bc77cf 100644 --- a/chains/mainnet/xion.json +++ b/chains/mainnet/verona.json @@ -1,5 +1,5 @@ { - "chain_name": "xion", + "chain_name": "verona", "coingecko": "XION", "network_type": "mainnet", "rpc": [ @@ -35,14 +35,14 @@ "coin_type": "118", "min_tx_fee": "100", "addr_prefix": "xion", - "logo": "./logos/xion.png", + "logo": "./logos/verona.png", "assets": [ { "base": "uxion", - "symbol": "XION", + "symbol": "VERONA", "exponent": "6", "coingecko_id": "xion-2", - "logo": "./logos/xion.png" + "logo": "./logos/verona.png" }, { "base": "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", diff --git a/chains/testnet/terra.json b/chains/testnet/terra.json index 9abaeabc..27579481 100644 --- a/chains/testnet/terra.json +++ b/chains/testnet/terra.json @@ -1,12 +1,20 @@ { "chain_name": "terra", "api": [ + { + "provider": "Nodeshub", + "address": "https://terra.test.api.nodeshub.online" + }, { "provider": "Polkachu", "address": "https://terra-testnet-api.polkachu.com" } ], "rpc": [ + { + "provider": "Nodeshub", + "address": "https://terra.test.rpc.nodeshub.online:443" + }, { "provider": "Polkachu", "address": "https://terra-testnet-rpc.polkachu.com:443" diff --git a/chains/testnet/xion.json b/chains/testnet/verona.json similarity index 92% rename from chains/testnet/xion.json rename to chains/testnet/verona.json index 5d54bea2..e9b1dd24 100644 --- a/chains/testnet/xion.json +++ b/chains/testnet/verona.json @@ -1,5 +1,5 @@ { - "chain_name": "xion", + "chain_name": "verona", "coingecko": "XION", "network_type": "testnet", "rpc": [ @@ -35,14 +35,14 @@ "coin_type": "118", "min_tx_fee": "100", "addr_prefix": "xion", - "logo": "/logos/xion.png", + "logo": "/logos/verona.png", "assets": [ { "base": "uxion", - "symbol": "XION", + "symbol": "VERONA", "exponent": "6", "coingecko_id": "xion-2", - "logo": "/logos/xion.png" + "logo": "/logos/verona.png" }, { "base": "ibc/13B2C536BB057AC79D5616B8EA1B9540EC1F2170718CAFF6F0083C966FFFED0B", diff --git a/explorer b/explorer index df2c4be9..1cc3b7ee 160000 --- a/explorer +++ b/explorer @@ -1 +1 @@ -Subproject commit df2c4be94211ea3c804c229636f5d2258bbdb9f0 +Subproject commit 1cc3b7ee7208c336908fa7944a2f08021c5eaa93 diff --git a/logos/safrochain.png b/logos/safrochain.png new file mode 100644 index 00000000..ba40d30e Binary files /dev/null and b/logos/safrochain.png differ diff --git a/logos/safrochain.svg b/logos/safrochain.svg new file mode 100644 index 00000000..4d04f32c --- /dev/null +++ b/logos/safrochain.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logos/verona.png b/logos/verona.png new file mode 100644 index 00000000..07d149ae Binary files /dev/null and b/logos/verona.png differ diff --git a/logos/xion.png b/logos/xion.png deleted file mode 100644 index 8c6e01f7..00000000 Binary files a/logos/xion.png and /dev/null differ diff --git a/scripts/check-config-format.sh b/scripts/check-config-format.sh new file mode 100755 index 00000000..85353c77 --- /dev/null +++ b/scripts/check-config-format.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -euo pipefail + +base_ref="${1:-}" +head_ref="${2:-HEAD}" + +if ! command -v jq >/dev/null 2>&1; then + echo "jq is required to validate config JSON files." >&2 + exit 1 +fi + +list_config_files() { + if [[ -n "$base_ref" ]]; then + git diff --name-only --diff-filter=ACMR "$base_ref" "$head_ref" -- 'chains/**' + else + find chains -type f -name '*.json' | sort + fi +} + +failed=0 +checked=0 + +while IFS= read -r file; do + [[ "$file" == chains/*.json ]] || continue + [[ -f "$file" ]] || continue + + checked=$((checked + 1)) + if ! jq empty "$file"; then + echo "Invalid JSON config: $file" >&2 + failed=1 + fi +done < <(list_config_files) + +if [[ "$checked" -eq 0 ]]; then + echo "No changed chain config JSON files to check." +else + echo "Checked $checked chain config JSON file(s)." +fi + +exit "$failed" diff --git a/scripts/patch-explorer-csp.sh b/scripts/patch-explorer-csp.sh new file mode 100755 index 00000000..69d5c033 --- /dev/null +++ b/scripts/patch-explorer-csp.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail + +index_file="${1:-explorer/index.html}" + +if [[ ! -f "$index_file" ]]; then + echo "Explorer index file not found: $index_file" >&2 + exit 1 +fi + +add_csp_source() { + local directive="$1" + local source="$2" + + if grep -F "$source" "$index_file" >/dev/null; then + return + fi + + if ! grep -F "$directive" "$index_file" >/dev/null; then + echo "CSP directive not found in $index_file: $directive" >&2 + exit 1 + fi + + perl -0pi -e "s#($directive[^;]*);#\$1 $source;#" "$index_file" +} + +add_csp_source "script-src" "https://v1.slise.xyz" +add_csp_source "frame-src" "https://*.slise.xyz"