Skip to content

Commit

Permalink
Add startup check for execution node (#141)
Browse files Browse the repository at this point in the history
* Add startup check for execution node

Signed-off-by: cyc60 <[email protected]>

* Version bump

Signed-off-by: cyc60 <[email protected]>

---------

Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 authored Apr 11, 2023
1 parent d51f096 commit 60ad651
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions deploy/goerli/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/harbour_goerli/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_harbour_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_harbour_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/harbour_mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_harbour_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_harbour_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.2
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.9.3
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
11 changes: 11 additions & 0 deletions oracle/oracle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
get_finalized_block,
get_latest_block_number,
get_voting_parameters,
get_web3_client,
has_synced_block,
)
from oracle.oracle.distributor.controller import DistributorController
Expand Down Expand Up @@ -101,6 +102,16 @@ async def init_checks(oracle_account, session):
)
logger.info(f"Connected to ETH2 node at {parsed_uri}")

# check ETH1 connection
logger.info("Checking connection to ETH1 node...")
block_number = get_web3_client().eth.block_number
parsed_uri = "{uri.scheme}://{uri.netloc}".format(
uri=urlparse(NETWORK_CONFIG["ETH1_ENDPOINT"])
)
logger.info(
f"Connected to ETH1 node at {parsed_uri}. Current block number: {block_number}"
)


async def process_network(
interrupt_handler: InterruptHandler,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oracle"
version = "2.9.2"
version = "2.9.3"
description = "StakeWise Oracles are responsible for submitting off-chain data."
authors = ["Dmitri Tsumak <[email protected]>"]
license = "AGPL-3.0-only"
Expand Down

0 comments on commit 60ad651

Please sign in to comment.