forked from Layr-Labs/eigenda-operator-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·46 lines (42 loc) · 1.62 KB
/
run.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
#!/bin/sh
# Path: run.sh
. ./.env
# In both opt-in and opt-out, We have to explicitly set the password again here because
# when docker run loads the `.env` file, it keeps the quotes around the password
# which causes the password to be incorrect.
# To test that try running `docker run --rm --env-file .env busybox /bin/sh -c 'echo $NODE_ECDSA_KEY_PASSWORD'`
# This will output password with single quote. Not sure why this happens.
optIn() {
socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"
echo "using socket: $socket"
docker run --env-file .env \
--rm \
--volume "${NODE_ECDSA_KEY_FILE_HOST}":/app/operator_keys/ecdsa_key.json \
--volume "${NODE_BLS_KEY_FILE_HOST}":/app/operator_keys/bls_key.json \
--volume "${NODE_LOG_PATH_HOST}":/app/logs:rw \
ghcr.io/layr-labs/eigenda/opr-nodeplugin:release-0.2.3 \
--ecdsa-key-password "$NODE_ECDSA_KEY_PASSWORD" \
--bls-key-password "$NODE_BLS_KEY_PASSWORD" \
--operation opt-in \
--socket "$socket"
}
optOut() {
socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"
docker run --env-file .env \
--rm \
--volume "${NODE_ECDSA_KEY_FILE_HOST}":/app/operator_keys/ecdsa_key.json \
--volume "${NODE_BLS_KEY_FILE_HOST}":/app/operator_keys/bls_key.json \
--volume "${NODE_LOG_PATH_HOST}":/app/logs:rw \
ghcr.io/layr-labs/eigenda/opr-nodeplugin:release-0.2.3 \
--ecdsa-key-password "$NODE_ECDSA_KEY_PASSWORD" \
--bls-key-password "$NODE_BLS_KEY_PASSWORD" \
--operation opt-out \
--socket "$socket"
}
if [ "$1" = "opt-in" ]; then
optIn
elif [ "$1" = "opt-out" ]; then
optOut
else
echo "Invalid command"
fi