Skip to content

Commit

Permalink
Define internal v2 dispersal/retrieval ports for nginx reverse proxy (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork authored Feb 20, 2025
1 parent fd72a47 commit 496530f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
3 changes: 3 additions & 0 deletions holesky/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ NODE_SRS_LOAD=8388608
# $NODE_DISPERSAL_PORT port on the chain and listen for the reverse proxy at $NODE_INTERNAL_DISPERSAL_PORT.
NODE_INTERNAL_DISPERSAL_PORT=${NODE_DISPERSAL_PORT}
NODE_INTERNAL_RETRIEVAL_PORT=${NODE_RETRIEVAL_PORT}
NODE_INTERNAL_V2_DISPERSAL_PORT=${NODE_V2_DISPERSAL_PORT}
NODE_INTERNAL_V2_RETRIEVAL_PORT=${NODE_V2_RETRIEVAL_PORT}


# Reachability Check
NODE_REACHABILITY_POLL_INTERVAL=60
Expand Down
12 changes: 6 additions & 6 deletions holesky/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"\;"${N
# This will output password with single quote. Not sure why this happens.
optIn() {
echo "You are about to opt-in to quorum: $1 with socket registration: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand All @@ -47,9 +47,9 @@ optIn() {

optOut() {
echo "You are about to opt-out from quorum: $1 with socket registration: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand Down Expand Up @@ -85,9 +85,9 @@ listQuorums() {
updateSocket() {
# we have to pass a dummy quorum-id-list as it is required by the plugin
echo "You are about to update your socket to: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand Down
2 changes: 2 additions & 0 deletions mainnet/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ NODE_SRS_LOAD=8388608
# $NODE_DISPERSAL_PORT port on the chain and listen for the reverse proxy at $NODE_INTERNAL_DISPERSAL_PORT.
NODE_INTERNAL_DISPERSAL_PORT=${NODE_DISPERSAL_PORT}
NODE_INTERNAL_RETRIEVAL_PORT=${NODE_RETRIEVAL_PORT}
NODE_INTERNAL_V2_DISPERSAL_PORT=${NODE_V2_DISPERSAL_PORT}
NODE_INTERNAL_V2_RETRIEVAL_PORT=${NODE_V2_RETRIEVAL_PORT}

# Reachability Check
NODE_REACHABILITY_POLL_INTERVAL=60
Expand Down
14 changes: 7 additions & 7 deletions mainnet/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

. ./.env

socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"\;"${NODE_V2_DISPERSAL_PORT}"\;"${NODE_V2_RETRIEVAL_PORT}"
socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"

node_plugin_image="ghcr.io/layr-labs/eigenda/opr-nodeplugin:0.8.6"

Expand All @@ -14,9 +14,9 @@ node_plugin_image="ghcr.io/layr-labs/eigenda/opr-nodeplugin:0.8.6"
# This will output password with single quote. Not sure why this happens.
optIn() {
echo "You are about to opt-in to quorum: $1 with socket registration: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand All @@ -36,9 +36,9 @@ optIn() {

optOut() {
echo "You are about to opt-out from quorum: $1 with socket registration: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand Down Expand Up @@ -73,9 +73,9 @@ listQuorums() {

updateSocket() {
echo "You are about to update your socket registration to: $socket"
echo "Confirm? [y/N] "
echo "Confirm? [Y/n] "
read -r answer
if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
if [ "$answer" = "n" ] || [ "$answer" = "N" ]; then
echo "Operation cancelled"
exit 1
fi
Expand Down
17 changes: 17 additions & 0 deletions resources/rate-limit-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ server {
}
}

server {
listen ${NODE_V2_RETRIEVAL_PORT};

client_max_body_size 1M;

http2 on;

location / {
limit_req zone=ip burst=${BURST_LIMIT} nodelay;
limit_req_status 429;

grpc_set_header X-Real-IP $remote_addr;

grpc_pass grpc://${NODE_HOST}:${NODE_INTERNAL_V2_RETRIEVAL_PORT};
}
}

server {
listen ${NODE_API_PORT};

Expand Down

0 comments on commit 496530f

Please sign in to comment.