Skip to content

Commit

Permalink
prepare for v0.3.0 (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur authored Feb 8, 2024
1 parent 1824d21 commit 5e388c3
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 13 deletions.
13 changes: 7 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAIN_SERVICE_IMAGE=ghcr.io/layr-labs/eigenda/opr-node:release-0.2.3
MAIN_SERVICE_IMAGE=ghcr.io/layr-labs/eigenda/opr-node:release-0.3.0
NETWORK_NAME=eigenda-network
MAIN_SERVICE_NAME=eigenda-native-node

Expand All @@ -10,12 +10,13 @@ NODE_PRIVATE_KEY=
NODE_EXPIRATION_POLL_INTERVAL=180
NODE_CACHE_ENCODED_BLOBS=true
NODE_NUM_WORKERS=1
NODE_SRS_ORDER=524288
NODE_DISPERSAL_PORT=32005
NODE_QUORUM_ID_LIST=0
NODE_VERBOSE=true
NODE_RETRIEVAL_PORT=32004
NODE_TIMEOUT=20s
NODE_SRS_ORDER=268435456
NODE_SRS_LOAD=131072

# If you are using a reverse proxy in a shared network space, the reverse proxy should listen at $NODE_DISPERSAL_PORT
# and forward the traffic to $NODE_INTERNAL_DISPERSAL_PORT, and similarly for retrieval. The DA node will register the
Expand All @@ -27,7 +28,7 @@ NODE_INTERNAL_RETRIEVAL_PORT=${NODE_RETRIEVAL_PORT}
NODE_ECDSA_KEY_FILE=/app/operator_keys/ecdsa_key.json
NODE_BLS_KEY_FILE=/app/operator_keys/bls_key.json
NODE_G1_PATH=/app/g1.point
NODE_G2_PATH=/app/g2.point
NODE_G2_POWER_OF_2_PATH=/app/g2.point.powerOf2
NODE_CACHE_PATH=/app/cache
NODE_LOG_PATH=/app/logs/opr.log
NODE_DB_PATH=/data/operator/db
Expand All @@ -45,8 +46,8 @@ NODE_ENABLE_NODE_API=true
NODE_API_PORT=9091

# goerli smart contracts
NODE_EIGENDA_SERVICE_MANAGER=0x9FcE30E01a740660189bD8CbEaA48Abd36040010
NODE_BLS_OPERATOR_STATE_RETRIVER=0x737Dd62816a9392e84Fa21C531aF77C00816A3a3
NODE_EIGENDA_SERVICE_MANAGER=0xa3b1689Ab85409B15e07d2ED50A6EA9905074Ee5
NODE_BLS_OPERATOR_STATE_RETRIVER=0x357a99ccF04fC68Bd8d220263F9182506CBFEaF8

# Churner URL
NODE_CHURNER_URL=churner-goerli.eigenda.xyz:443
Expand Down Expand Up @@ -79,7 +80,7 @@ EIGENDA_HOME=${EIGENLAYER_HOME}/eigenda

NODE_LOG_PATH_HOST=${EIGENDA_HOME}/logs
NODE_G1_PATH_HOST=${USER_HOME}/eigenda-operator-setup/resources/g1.point
NODE_G2_PATH_HOST=${USER_HOME}/eigenda-operator-setup/resources/g2.point
NODE_G2_PATH_HOST=${USER_HOME}/eigenda-operator-setup/resources/g2.point.powerOf2
NODE_DB_PATH_HOST=${EIGENDA_HOME}/db
NODE_CACHE_PATH_HOST=${USER_HOME}/eigenda-operator-setup/resources/cache

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.env

# Ignore points so that they don't come up in git changes
resources/g1.point
resources/g2.point.powerOf2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Clone this repo and execute the following commands:
```bash
git clone https://github.com/Layr-Labs/eigenda-operator-setup.git
cd eigenda-operator-setup
chmod +x run.sh
cp .env.example .env
```
Update the `TODO` sections in the `.env` file given in the root directory of the repository with your own details.:
Expand Down Expand Up @@ -49,10 +48,11 @@ In order to limit traffic from the EigenLabs hosted Disperser, please restrict y
For users with private IP, you may need to perform port forwarding to open the dispersal ports. Refer to retrieval setup for more details.

### Opt-in into EigenDA
This command also downloads the latest SRS points (~8 GB) if they don't exist and can take upto 10 minutes to complete for the first time based on your network speed.
```bash
./run.sh opt-in
```
It will use the `NODE_HOSTNAME` from [.env](.env) as your current IP.
It will use the `NODE_HOSTNAME` from [.env](.env.example) as your current IP.

### Run EigenDA
Execute the following command to start the docker containers:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
- "${NODE_ECDSA_KEY_FILE_HOST}:/app/operator_keys/ecdsa_key.json:readonly"
- "${NODE_BLS_KEY_FILE_HOST}:/app/operator_keys/bls_key.json:readonly"
- "${NODE_G1_PATH_HOST}:/app/g1.point:readonly"
- "${NODE_G2_PATH_HOST}:/app/g2.point:readonly"
- "${NODE_G2_PATH_HOST}:/app/g2.point.powerOf2:readonly"
- "${NODE_CACHE_PATH_HOST}:/app/cache:rw"
- "${NODE_LOG_PATH_HOST}:/app/logs:rw"
- "${NODE_DB_PATH_HOST}:/data/operator/db:rw"
Expand Down
1 change: 0 additions & 1 deletion resources/g1.point

This file was deleted.

1 change: 0 additions & 1 deletion resources/g2.point

This file was deleted.

2 changes: 2 additions & 0 deletions resources/srssha256sums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c03178df1bafd883dee748205dae7725bcf58cead10f6bb1b07aeb51e5aede6f g1.point
4d5ed827f742e1270f22b4a39129bf1d25445821b15824e2eb3a709a16f64518 g2.point.powerOf2
10 changes: 8 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@
# 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() {
echo "checking and validating SRS"
./srs_setup.sh
if [ $? -ne 0 ]; then
echo "Error: SRS setup failed. Exiting."
exit 1
fi
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 \
ghcr.io/layr-labs/eigenda/opr-nodeplugin:release-0.3.0 \
--ecdsa-key-password "$NODE_ECDSA_KEY_PASSWORD" \
--bls-key-password "$NODE_BLS_KEY_PASSWORD" \
--operation opt-in \
Expand All @@ -30,7 +36,7 @@ optOut() {
--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 \
ghcr.io/layr-labs/eigenda/opr-nodeplugin:release-0.3.0 \
--ecdsa-key-password "$NODE_ECDSA_KEY_PASSWORD" \
--bls-key-password "$NODE_BLS_KEY_PASSWORD" \
--operation opt-out \
Expand Down
29 changes: 29 additions & 0 deletions srs_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
# Path: srs_setup.sh

DOWNLOADED_FILE=false
echo "Downloading srs resources"
if ! [ -f ./resources/g1.point ]; then
echo "g1.point does not exist."
echo "Downloading g1 point. This could take upto 5 minutes"
wget https://srs-mainnet.s3.amazonaws.com/kzg/g1.point --output-document=./resources/g1.point
DOWNLOADED_FILE=true
fi

if ! [ -f ./resources/g2.point.powerOf2 ]; then
echo "g2.point.powerOf2 does not exist."
echo "Downloading g2 point powerOf2. This will take few seconds"
wget https://srs-mainnet.s3.amazonaws.com/kzg/g2.point.powerOf2 --output-document=./resources/g2.point.powerOf2
DOWNLOADED_FILE=true
fi

# Any time we download the file, validate hashes
if [ "$DOWNLOADED_FILE" = true ]; then
echo "validating hashes of g1 and g2 points This could take upto 5 minutes"
if (cd resources && sha256sum -c srssha256sums.txt); then
echo "Checksums match. Verification successful."
else
echo "Error: Checksums do not match. Exiting."
exit 1
fi
fi

0 comments on commit 5e388c3

Please sign in to comment.