@@ -6,7 +6,7 @@ set -euo pipefail
66
77# Constants
88REGISTRY_COMMIT=$( cat superchain-registry-commit.txt)
9- SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
9+ SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
1010
1111repodir=$( mktemp -d)
1212workdir=$( mktemp -d)
@@ -30,7 +30,11 @@ echo "Using $workdir as workdir..."
3030# Create a simple mapping of chain id -> config name to make looking up chains by their ID easier.
3131echo " Generating index of configs..."
3232
33- echo " {}" > chains.json
33+ echo " {}" > chains.json
34+
35+ # List of chain IDs to exclude
36+ declare -A EXCLUDE_CHAIN_IDS
37+ EXCLUDE_CHAIN_IDS=([" 28882" ]=1) # Boba
3438
3539# Function to process each network directory
3640process_network_dir () {
@@ -48,15 +52,19 @@ process_network_dir() {
4852 echo " Processing $toml_file ..."
4953 # Extract chain_id from TOML file using dasel
5054 chain_id=$( dasel -f " $toml_file " -r toml " chain_id" | tr -d ' "' )
55+ chain_name=" $( basename " ${toml_file% .* } " ) "
5156
52- # Skip if chain_id is empty
53- if [ -z " $chain_id " ]; then
57+ # Skip if chain_id is empty or in the exclusion list
58+ if [[ -z " $chain_id " || -v EXCLUDE_CHAIN_IDS[" $chain_id " ] ]]; then
59+ echo " Skipping $network_name /$chain_name ($chain_id )"
60+ rm " $toml_file "
61+ rm " genesis/$network_name /$chain_name .json.zst"
5462 continue
5563 fi
5664
5765 # Create JSON object for this config
5866 config_json=$( jq -n \
59- --arg name " $( basename " ${toml_file % . * } " ) " \
67+ --arg name " $chain_name " \
6068 --arg network " $network_name " \
6169 ' {
6270 "name": $name,
@@ -65,8 +73,8 @@ process_network_dir() {
6573
6674 # Add this config to the result JSON using the chain_id as the key
6775 jq --argjson config " $config_json " \
68- --arg chain_id " $chain_id " \
69- ' . + {($chain_id): $config}' chains.json > temp.json
76+ --arg chain_id " $chain_id " \
77+ ' . + {($chain_id): $config}' chains.json > temp.json
7078 mv temp.json chains.json
7179 done
7280}
8088
8189# Archive the genesis configs as a ZIP file. ZIP is used since it can be efficiently used as a filesystem.
8290echo " Archiving configs..."
83- echo " $REGISTRY_COMMIT " > COMMIT
91+ echo " $REGISTRY_COMMIT " > COMMIT
8492# We need to normalize the lastmod dates and permissions to ensure the ZIP file is deterministic.
8593find . -exec touch -t 198001010000.00 {} +
8694chmod -R 755 ./*
@@ -93,4 +101,4 @@ echo "Cleaning up..."
93101rm -rf " $repodir "
94102rm -rf " $workdir "
95103
96- echo " Done."
104+ echo " Done."
0 commit comments