-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetenv.sh
More file actions
26 lines (20 loc) · 939 Bytes
/
setenv.sh
File metadata and controls
26 lines (20 loc) · 939 Bytes
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
26
#! /bin/bash
if [ ! -e .exec-once ]; then
touch .exec-once
chains=(arbitrum avalanche bsc celo ethereum optimism polygon)
for ch in ${chains[@]}; do
cp ./chain/$ch/.env.sample ./chain/$ch/.env
done
fi
keys=(AwsAccessKeyId AwsSecretAccessKey KmsKeyId ValidatorName AbcValidatorCheckpointsyncerBucket AbcValidatorRegion AbcValidatorCheckpointsyncerRegion AbcBaseValidatorRegion)
rm -f ./chain/$chain/.env
for key in ${keys[@]}; do
echo -n $key | sed -r -e 's/([a-zA-Z])([A-Z])/\1_\l\2/g' -e 's/\b([A-Z])/\l\1/g' | sed 's/.\+/\U\0/' >> ./chain/$chain/.env &
wait
echo -n = >> ./chain/$chain/.env &
aws cloudformation describe-stacks \
--stack-name "abacus-$chain" | jq -r ".Stacks[] | .Outputs[] | select(.OutputKey == \"$key\") | .OutputValue " >> ./chain/$chain/.env
done
echo ABC_BASE_OUTBOX_CONNECTION_URL= >> ./chain/$chain/.env &
echo ABC_BASE_METRICS= >> ./chain/$chain/.env
echo "abacus-validator/chain/$chain/.env is created"