-
Notifications
You must be signed in to change notification settings - Fork 4
/
bridge_eth.sh
executable file
·52 lines (43 loc) · 1.31 KB
/
bridge_eth.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
SEPOLIA_ENDPOINT=""
PRIV_KEY=""
WEI_TO_DEPOSIT=""
# Parsing command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--eth-rpc-endpoint)
SEPOLIA_ENDPOINT="$2"
shift # past argument
shift # past value
;;
--private-key)
PRIV_KEY="$2"
shift # past argument
shift # past value
;;
--wei-to-deposit)
WEI_TO_DEPOSIT="$2"
shift # past argument
shift # past value
;;
*)
shift # past argument
;;
esac
done
# Check if the required arguments are set
if [ -z "$SEPOLIA_ENDPOINT" ] || [ -z "$PRIV_KEY" ] || [ -z "$WEI_TO_DEPOSIT" ]; then
echo "Missing required arguments. Usage: $0 --eth-rpc-endpoint SEPOLIA_ENDPOINT --private-key PRIV_KEY --wei-to-deposit WEI_TO_DEPOSIT"
exit 1
fi
JSON_FILE="honest-validator/l2_chain_info.json"
# Extracting the rollup, stake token, and inbox addresses using jq
INBOX_ADDR=$(jq -r '.[0].rollup."inbox"' $JSON_FILE)
docker pull ghcr.io/rauljordan/bold-utils:testnet-candidate
# Running the Docker command
docker run --network=host ghcr.io/rauljordan/bold-utils:testnet-candidate bridge-eth \
--validator-priv-keys=$PRIV_KEY \
--l1-endpoint=$SEPOLIA_ENDPOINT \
--inbox-address=$INBOX_ADDR \
--wei-to-deposit=$WEI_TO_DEPOSIT