@@ -6,7 +6,7 @@ set -euo pipefail
6
6
7
7
# Constants
8
8
REGISTRY_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)
10
10
11
11
repodir=$( mktemp -d)
12
12
workdir=$( mktemp -d)
@@ -30,7 +30,11 @@ echo "Using $workdir as workdir..."
30
30
# Create a simple mapping of chain id -> config name to make looking up chains by their ID easier.
31
31
echo " Generating index of configs..."
32
32
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
34
38
35
39
# Function to process each network directory
36
40
process_network_dir () {
@@ -48,15 +52,19 @@ process_network_dir() {
48
52
echo " Processing $toml_file ..."
49
53
# Extract chain_id from TOML file using dasel
50
54
chain_id=$( dasel -f " $toml_file " -r toml " chain_id" | tr -d ' "' )
55
+ chain_name=" $( basename " ${toml_file% .* } " ) "
51
56
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"
54
62
continue
55
63
fi
56
64
57
65
# Create JSON object for this config
58
66
config_json=$( jq -n \
59
- --arg name " $( basename " ${toml_file % . * } " ) " \
67
+ --arg name " $chain_name " \
60
68
--arg network " $network_name " \
61
69
' {
62
70
"name": $name,
@@ -65,8 +73,8 @@ process_network_dir() {
65
73
66
74
# Add this config to the result JSON using the chain_id as the key
67
75
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
70
78
mv temp.json chains.json
71
79
done
72
80
}
80
88
81
89
# Archive the genesis configs as a ZIP file. ZIP is used since it can be efficiently used as a filesystem.
82
90
echo " Archiving configs..."
83
- echo " $REGISTRY_COMMIT " > COMMIT
91
+ echo " $REGISTRY_COMMIT " > COMMIT
84
92
# We need to normalize the lastmod dates and permissions to ensure the ZIP file is deterministic.
85
93
find . -exec touch -t 198001010000.00 {} +
86
94
chmod -R 755 ./*
@@ -93,4 +101,4 @@ echo "Cleaning up..."
93
101
rm -rf " $repodir "
94
102
rm -rf " $workdir "
95
103
96
- echo " Done."
104
+ echo " Done."
0 commit comments