-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·71 lines (62 loc) · 2.42 KB
/
run.sh
File metadata and controls
executable file
·71 lines (62 loc) · 2.42 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# usage example 1:
# env ES_NODE_STORAGE_MINER=<miner> ES_NODE_SIGNER_PRIVATE_KEY=<private_key> ./run.sh
# usage example 2 (overriding rpc urls):
# env ES_NODE_STORAGE_MINER=<miner> ES_NODE_SIGNER_PRIVATE_KEY=<private_key> ./run.sh --l1.rpc <el_rpc> --l1.beacon <cl_rpc>
# usage example 3 (overriding zk options, make sure to use the same configuration when running both init.sh and run.sh):
# env ES_NODE_STORAGE_MINER=<miner> ES_NODE_SIGNER_PRIVATE_KEY=<private_key> ./run.sh --miner.zk-prover-impl 2 --miner.zk-prover-mode 1
# The following is the default zkey file path downloaded by `init.sh`, which is compatible with zk mode 2.
# You can override the zkey file by using the `--miner.zkey` flag. Just ensure that the provided zkey file is compatible with the zkey mode.
zkey_file="./build/bin/snark_lib/zkey/blob_poseidon2.zkey"
executable="./build/bin/es-node"
echo "========== build info =================="
$executable --version
echo "========================================"
data_dir="./es-data"
# Parse --datadir from CLI (support --datadir <dir> and --datadir=<dir>)
forward_args=()
while [[ $# -gt 0 ]]; do
case "$1" in
--datadir)
data_dir="$2"
shift 2
;;
--datadir=*)
data_dir="${1#*=}"
shift
;;
*)
forward_args+=("$1")
shift
;;
esac
done
file_flags=""
for file in ${data_dir}/shard-[0-9]*.dat; do
if [ -f "$file" ]; then
file_flags+=" --storage.files $file"
fi
done
if [ -z "$file_flags" ]; then
cat <<EOF
No shard data files found in "$data_dir".
- Run ./init.sh to prepare shard files and dependencies.
- Or pass your data directory: ./run.sh --datadir <dir>
- Expected file pattern: ${data_dir}/shard-<index>.dat
EOF
exit 1
fi
start_flags=" --datadir $data_dir \
$file_flags \
--storage.l1contract 0xAb3d380A268d088BA21Eb313c1C23F3BEC5cfe93 \
--l1.rpc http://65.108.230.142:8545 \
--l1.beacon http://65.108.230.142:3500 \
--miner.enabled \
--miner.zkey $zkey_file \
--download.thread 32 \
--state.upload.url http://metrics.ethstorage.io:8080 \
--p2p.listen.udp 30305 \
--p2p.sync.concurrency 32 \
--p2p.bootnodes enr:-Lq4QD3MMwVIPhlMy2m6ArsSIfqBmhpk83j5M5a5n9OswlrKFniuZAblPyBRdTKaZaLJNOk8liD8jEmEZKiZQa8k0sSGAZjz0_ohimV0aHN0b3JhZ2Xdgg0FgNjXlKs9OAomjQiLoh6zE8HCPzvsXP6TwYCCaWSCdjSCaXCEF1hGrolzZWNwMjU2azGhAx_7n1-PG2kRC7W3rG8-r4tt1xQKDoNf_ybIcWhNaSddg3RjcIIkB4N1ZHCCdmE \
"
exec $executable $start_flags "${forward_args[@]}"