-
Notifications
You must be signed in to change notification settings - Fork 5
/
prepare_blockchains.sh
executable file
·25 lines (21 loc) · 1.14 KB
/
prepare_blockchains.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env sh
# Delete all .pb.go and interfaces for each blockchain, re-generate it from .proto
set -e
PROTO_FILES=$(find blockchain/ -name '*.proto')
for PROTO in $PROTO_FILES; do
protoc --go_out=. --go_opt=paths=source_relative $PROTO
echo "Regenerated from proto: $PROTO"
done
BLOCKCHAIN_NAMES_RAW=$(find blockchain/ -maxdepth 1 -type d | cut -f2 -d '/')
for BLOCKCHAIN in $BLOCKCHAIN_NAMES_RAW; do
if [ "$BLOCKCHAIN" != "" ] && [ "$BLOCKCHAIN" != "common" ]; then
if [ "$BLOCKCHAIN" != "ethereum" ] && [ "$BLOCKCHAIN" != "polygon" ] && [ "$BLOCKCHAIN" != "mantle" ] && [ "$BLOCKCHAIN" != "mantle_sepolia" ] && [ "$BLOCKCHAIN" != "sepolia" ] && [ "$BLOCKCHAIN" != "imx_zkevm" ] && [ "$BLOCKCHAIN" != "imx_zkevm_sepolia" ] && [ "$BLOCKCHAIN" != "b3" ] && [ "$BLOCKCHAIN" != "b3_sepolia" ] && [ "$BLOCKCHAIN" != "ronin" ] && [ "$BLOCKCHAIN" != "ronin_saigon" ]; then
./seer blockchain generate -n $BLOCKCHAIN --side-chain
echo "Generated interface for side-chain blockchain $BLOCKCHAIN"
else
./seer blockchain generate -n $BLOCKCHAIN
echo "Generated interface for blockchain $BLOCKCHAIN"
fi
fi
done
go fmt ./...