From a7467a0c39f57d37f62cf79fcb372a25dc4f4355 Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Wed, 11 Dec 2024 16:23:29 -0500 Subject: [PATCH 1/5] fix: beacon depends on validator --- docker-compose.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fcc2276..59ad624 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,12 @@ services: - /var/run/docker.sock:/var/run/docker.sock entrypoint: /beacon-kit/testing/files/entrypoint.sh depends_on: - - celestia-network-bridge - - reth + celestia-network-validator: + condition: service_healthy + celestia-network-bridge: + condition: service_started + reth: + condition: service_started networks: - beacon-network From bbe49d4e9adf33f9b6e5cf6cd7a7c611e0a3fcdb Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Fri, 13 Dec 2024 16:54:50 -0500 Subject: [PATCH 2/5] wip: bridge node claims that auth token is not set --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 59ad624..b28c30a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,6 +80,12 @@ services: depends_on: celestia-network-validator: condition: service_healthy + healthcheck: + test: ["CMD", "/bin/sh", "-c", "AUTH_TOKEN=$(celestia bridge auth read --node.store=/home/celestia 2>/dev/null | tail -n 1); curl --max-time 0.5 -s -X POST -H \"Content-type: application/json\" -H \"Accept: application/json\" -H \"Authorization: Bearer $AUTH_TOKEN\" -d '{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"header.SyncWait\",\"params\":[]}' \"http://localhost:26658\"; if [ \"$?\" -eq 0 ]; then exit 0; else echo \"Catching up\"; exit 1; fi"] + interval: 5s + timeout: 5s + retries: 5 + start_period: 5s networks: - beacon-network From 391978fb0ff32f1f435f2eeb2360045fa4c76f15 Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Mon, 16 Dec 2024 18:11:35 -0500 Subject: [PATCH 3/5] fix: docker healthchecks --- docker-compose.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b28c30a..541dd3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: celestia-network-validator: condition: service_healthy celestia-network-bridge: - condition: service_started + condition: service_healthy reth: condition: service_started networks: @@ -55,10 +55,10 @@ services: - "26657:26657" entrypoint: /testapp_files/entrypoint.sh healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:26657/status"] - interval: 5s + test: ["CMD-SHELL", "/bin/sh -c 'BLOCK_HEIGHT=$(curl -sf http://localhost:26657/status | jq -r .result.sync_info.latest_block_height); if [ \"$$BLOCK_HEIGHT\" -gt 1 ]; then exit 0; else echo \"Block height too low: $$BLOCK_HEIGHT\"; exit 1; fi'"] + interval: 1s timeout: 5s - retries: 5 + retries: 20 start_period: 5s networks: - beacon-network @@ -73,7 +73,7 @@ services: - ./testing/files/celestia-bridge:/testapp_files - ./.tmp/celestia-bridge:/home/celestia entrypoint: /testapp_files/entrypoint.sh - command: celestia bridge start --p2p.network private --core.ip celestia-network-validator --rpc.addr 0.0.0.0:26658 --keyring.keyname bridge + command: celestia bridge start --p2p.network private --core.ip celestia-network-validator --rpc.addr 0.0.0.0 --rpc.port 26658 --keyring.keyname bridge --rpc.skip-auth ports: - "26658:26658" - "2121:2121" @@ -81,11 +81,11 @@ services: celestia-network-validator: condition: service_healthy healthcheck: - test: ["CMD", "/bin/sh", "-c", "AUTH_TOKEN=$(celestia bridge auth read --node.store=/home/celestia 2>/dev/null | tail -n 1); curl --max-time 0.5 -s -X POST -H \"Content-type: application/json\" -H \"Accept: application/json\" -H \"Authorization: Bearer $AUTH_TOKEN\" -d '{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"header.SyncWait\",\"params\":[]}' \"http://localhost:26658\"; if [ \"$?\" -eq 0 ]; then exit 0; else echo \"Catching up\"; exit 1; fi"] + test: ["CMD-SHELL", "AUTH_TOKEN=$(celestia bridge auth read --node.store=/home/celestia 2>/dev/null | tail -n 1); OUTPUT=$(curl -sf --max-time 0.5 -X POST -H \"Content-type: application/json\" -H \"Accept: application/json\" -H \"Authorization: Bearer $$AUTH_TOKEN\" -d '{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"header.SyncWait\",\"params\":[]}' http://0.0.0.0:26658); if [ $$? -eq 0 ]; then exit 0; else echo \"Catching up. $$OUTPUT\"; exit 1; fi "] interval: 5s timeout: 5s - retries: 5 - start_period: 5s + retries: 20 + start_period: 10s networks: - beacon-network From 6745c19605a6e2df62055d5d37263b7ed259f744 Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Mon, 16 Dec 2024 18:13:58 -0500 Subject: [PATCH 4/5] do not need to skip auth --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 541dd3f..dfdba14 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,7 +73,7 @@ services: - ./testing/files/celestia-bridge:/testapp_files - ./.tmp/celestia-bridge:/home/celestia entrypoint: /testapp_files/entrypoint.sh - command: celestia bridge start --p2p.network private --core.ip celestia-network-validator --rpc.addr 0.0.0.0 --rpc.port 26658 --keyring.keyname bridge --rpc.skip-auth + command: celestia bridge start --p2p.network private --core.ip celestia-network-validator --rpc.addr 0.0.0.0 --rpc.port 26658 --keyring.keyname bridge ports: - "26658:26658" - "2121:2121" From b078f294cf38104b4e1c0af489eb9f508682b262 Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Mon, 16 Dec 2024 18:15:50 -0500 Subject: [PATCH 5/5] configure: retries --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dfdba14..58acabc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: test: ["CMD-SHELL", "/bin/sh -c 'BLOCK_HEIGHT=$(curl -sf http://localhost:26657/status | jq -r .result.sync_info.latest_block_height); if [ \"$$BLOCK_HEIGHT\" -gt 1 ]; then exit 0; else echo \"Block height too low: $$BLOCK_HEIGHT\"; exit 1; fi'"] interval: 1s timeout: 5s - retries: 20 + retries: 10 start_period: 5s networks: - beacon-network @@ -82,10 +82,10 @@ services: condition: service_healthy healthcheck: test: ["CMD-SHELL", "AUTH_TOKEN=$(celestia bridge auth read --node.store=/home/celestia 2>/dev/null | tail -n 1); OUTPUT=$(curl -sf --max-time 0.5 -X POST -H \"Content-type: application/json\" -H \"Accept: application/json\" -H \"Authorization: Bearer $$AUTH_TOKEN\" -d '{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"header.SyncWait\",\"params\":[]}' http://0.0.0.0:26658); if [ $$? -eq 0 ]; then exit 0; else echo \"Catching up. $$OUTPUT\"; exit 1; fi "] - interval: 5s + interval: 1s timeout: 5s - retries: 20 - start_period: 10s + retries: 10 + start_period: 5s networks: - beacon-network