Skip to content

Commit

Permalink
Merge pull request #298 from HathorNetwork/dev
Browse files Browse the repository at this point in the history
Release: v0.11.1
  • Loading branch information
luislhl authored Jan 10, 2024
2 parents 701b1bd + 50c1d9e commit f56997c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
4 changes: 3 additions & 1 deletion daemons_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
async def data_collector() -> None:
data_collector = DataCollector()
while True:
asyncio.create_task(data_collector.run())
# This could take longer to run than the sleep time, so we wait for it to finish
await data_collector.run()
# Wait for 1 second before running again
await asyncio.sleep(1)


Expand Down
30 changes: 18 additions & 12 deletions domain/network/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,25 @@ def from_status_dict(cls, status: dict) -> "Node":
synced_block: Optional[BlockInfo] = None
protocol_version = peer["protocol_version"]
if protocol_version in {"sync-v1", "sync-v1.1"}:
latest_timestamp = peer["plugins"]["node-sync-timestamp"][
"latest_timestamp"
]
sync_timestamp = peer["plugins"]["node-sync-timestamp"][
"synced_timestamp"
]
node_sync_timestamp_dict = peer["plugins"].get("node-sync-timestamp")
if node_sync_timestamp_dict is None:
raise ValueError(
"Expected 'node-block-timestamp' property when protocol is sync-v1"
)
latest_timestamp = node_sync_timestamp_dict.get("latest_timestamp")
sync_timestamp = node_sync_timestamp_dict.get("synced_timestamp")
elif protocol_version == "sync-v2":
peer_best_block = BlockInfo.from_status_dict(
peer["plugins"]["node-block-sync"]["peer_best_block"]
)
synced_block = BlockInfo.from_status_dict(
peer["plugins"]["node-block-sync"]["synced_block"]
)
node_block_sync_dict = peer["plugins"].get("node-block-sync")
if node_block_sync_dict is None:
raise ValueError(
"Expected 'node-block-sync' property when protocol is sync-v2"
)
peer_best_block_dict = node_block_sync_dict.get("peer_best_block")
if peer_best_block_dict:
peer_best_block = BlockInfo.from_status_dict(peer_best_block_dict)
synced_block_dict = node_block_sync_dict.get("synced_block")
if synced_block_dict:
synced_block = BlockInfo.from_status_dict(synced_block_dict)
else:
# still try to support, but don't attempt to parse the fields above
# mark version as unsupported
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hathor-explorer-service",
"version": "0.11.0",
"version": "0.11.1",
"description": "Hathor Explorer Service Serverless deps",
"dependencies": {
"@apidevtools/swagger-cli": "^4.0.4",
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 = "hathor-explorer-service"
version = "0.11.0"
version = "0.11.1"
description = ""
authors = ["Hathor Labs <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit f56997c

Please sign in to comment.