Skip to content

Commit

Permalink
Update worker setup to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kalabukdima committed Nov 21, 2024
1 parent 198cfad commit fbd9eb7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
8 changes: 0 additions & 8 deletions src/worker/.mainnet.env

This file was deleted.

8 changes: 0 additions & 8 deletions src/worker/.tethys.env

This file was deleted.

6 changes: 2 additions & 4 deletions src/worker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
services:
worker:
image: subsquid/p2p-worker:1.2.0
image: subsquid/p2p-worker:2.0.0
restart: unless-stopped
command: p2p
env_file:
- .${NETWORK}.env
- .env
environment:
DATA_DIR: /app/data
Expand All @@ -14,7 +12,7 @@ services:
- ${DATA_DIR:?}:/app/data
- ${KEY_PATH:?}:/app/key:ro
ports:
- "${PROMETHEUS_PORT:-9090}:8000"
- "${PROMETHEUS_PORT:-9090}:${PROMETHEUS_PORT:-9090}"
- "${LISTEN_PORT:?}:${LISTEN_PORT:?}/udp"
deploy:
resources:
Expand Down
18 changes: 14 additions & 4 deletions src/worker/setup_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ check_deps() {
fi
}


BOLD=$(tput bold)
NORMAL=$(tput sgr0)

declare -A RPC_URL
declare -A L1_RPC_URL
RPC_URL["tethys"]=https://sepolia-rollup.arbitrum.io/rpc
L1_RPC_URL["tethys"]=https://eth-sepolia.public.blastapi.io
RPC_URL["mainnet"]=https://arb1.arbitrum.io/rpc
L1_RPC_URL["mainnet"]=https://eth-mainnet.public.blastapi.io


if [ "$#" -ne 2 ]
then
echo "Usage: $0 <DATA_DIR> <KEY_PATH>"
Expand Down Expand Up @@ -77,6 +84,10 @@ KEY_PATH=${KEY_PATH}
LISTEN_PORT=${LISTEN_PORT}
PROMETHEUS_PORT=9090
NETWORK=${NETWORK}
# RPC node of the Arbitrum network
RPC_URL=${RPC_URL[${NETWORK}]}
# RPC node of the Ethereum network
L1_RPC_URL=${L1_RPC_URL[${NETWORK}]}
# The number of chunks downloaded in paralel.
# You can increase this number if you have a good internet connection.
CONCURRENT_DOWNLOADS=3
Expand All @@ -91,13 +102,12 @@ RUST_LOG=info
# You probably shouldn't change the values below
UID=$(id -u)
GID=$(id -g)
P2P_LISTEN_ADDRS=/ip4/0.0.0.0/udp/${LISTEN_PORT}/quic-v1
P2P_PUBLIC_ADDRS=${PUBLIC_ADDR:-}
EOF

echo "Config saved to '.env'"

echo "Downloading docker-compose.yaml and .${NETWORK}.env"
curl -sSf -O "https://cdn.subsquid.io/worker/docker-compose.yaml" -O "https://cdn.subsquid.io/worker/.${NETWORK}.env"
echo "Downloading docker-compose.yaml"
curl -sSf -O "https://cdn.subsquid.io/worker/docker-compose.yaml"

echo "Your peer ID is: ${BOLD}${PEER_ID}${NORMAL}. Now you can register it on chain."

0 comments on commit fbd9eb7

Please sign in to comment.