diff --git a/src/worker/.mainnet.env b/src/worker/.mainnet.env deleted file mode 100644 index 303a23d..0000000 --- a/src/worker/.mainnet.env +++ /dev/null @@ -1,8 +0,0 @@ -NETWORK=mainnet -RPC_URL=https://arb1.arbitrum.io/rpc # RPC node of the Arbitrum network -L1_RPC_URL=https://eth-mainnet.public.blastapi.io # RPC node of the Ethereum network -SCHEDULER_ID=12D3KooWS5N8ygU6fRy4EZtzdHf4QZnkCaZrwCha9eYKH3LwNvsP -LOGS_COLLECTOR_ID=12D3KooWFnRhNqgsKtsDDhsozaWuyrTvtQA2Eu4XWvSPRd4UZynd -BOOT_NODES="12D3KooW9tLMANc4Vnxp27Ypyq8m8mUv45nASahj3eSnMbGWSk1b /dns4/mainnet.subsquid.io/udp/22445/quic-v1,12D3KooWEhPC7rsHAcifstVwJ3Cj55sWn7zXWuHrtAQUCGhGYnQz /dns4/mainnet.subsquid.io/udp/22446/quic-v1,12D3KooWS5N8ygU6fRy4EZtzdHf4QZnkCaZrwCha9eYKH3LwNvsP /dns4/mainnet.subsquid.io/udp/32445/quic-v1" -SENTRY_DSN=https://f97ffef7e96eb533d4c527ce62e4cfbf@o1149243.ingest.us.sentry.io/4507056936779776 -PING_INTERVAL_SEC=55 diff --git a/src/worker/.tethys.env b/src/worker/.tethys.env deleted file mode 100644 index 49c30e3..0000000 --- a/src/worker/.tethys.env +++ /dev/null @@ -1,8 +0,0 @@ -NETWORK=tethys -RPC_URL=https://sepolia-rollup.arbitrum.io/rpc # RPC node of the Arbitrum network -L1_RPC_URL=https://eth-sepolia.public.blastapi.io # RPC node of the Ethereum network -SCHEDULER_ID=12D3KooWQER7HEpwsvqSzqzaiV36d3Bn6DZrnwEunnzS76pgZkMU -LOGS_COLLECTOR_ID=12D3KooWC3GvQVqnvPwWz23sTW8G8HVokMnox62A7mnL9wwaSujk -BOOT_NODES="12D3KooWSRvKpvNbsrGbLXGFZV7GYdcrYNh4W2nipwHHMYikzV58 /dns4/testnet.subsquid.io/udp/22445/quic-v1,12D3KooWQC9tPzj2ShLn39RFHS5SGbvbP2pEd7bJ61kSW2LwxGSB /dns4/testnet.subsquid.io/udp/22446/quic-v1" -SENTRY_DSN=https://f97ffef7e96eb533d4c527ce62e4cfbf@o1149243.ingest.us.sentry.io/4507056936779776 -PING_INTERVAL_SEC=55 diff --git a/src/worker/docker-compose.yaml b/src/worker/docker-compose.yaml index d4a69ee..75affe7 100644 --- a/src/worker/docker-compose.yaml +++ b/src/worker/docker-compose.yaml @@ -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 @@ -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: diff --git a/src/worker/setup_worker.sh b/src/worker/setup_worker.sh index 7ae4784..5086cf7 100755 --- a/src/worker/setup_worker.sh +++ b/src/worker/setup_worker.sh @@ -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 " @@ -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 @@ -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."