Skip to content

Refactor online nodes.#238

Draft
facuMH wants to merge 3 commits into
mainfrom
facundo/refactor_online_nodes
Draft

Refactor online nodes.#238
facuMH wants to merge 3 commits into
mainfrom
facundo/refactor_online_nodes

Conversation

@facuMH

@facuMH facuMH commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This PR adds health checks to verify that nodes are actively producing blocks after being added to the network, ensuring the network is in a healthy state before proceeding.

Changes

  • New: OperaNode.CheckBlockProducing(ctx):
    • Streams the container logs and waits until at least 2 "New block" lines with strictly increasing block indices are observed.
    • Respects context cancellation/deadline for timeout control.
    • Returns an error if the log stream ends prematurely or the timeout expires before the condition is met.
  • New: LocalNetwork.WaitForBlockProduction(ctx):
    • Runs CheckBlockProducing on all nodes in the network in parallel.
    • Returns joined errors for any nodes that failed to produce blocks within the deadline.

Modified

  • LocalNetwork.createNode:
    • After addNodeIntoNetwork (peering), the flow now:
      • Calls CheckBlockProducing on the newly added node (30s timeout)
      • Calls WaitForBlockProduction to confirm all nodes in the network are producing blocks
      • Only then fires AfterNodeCreation listeners

This should help ensures that by the time a node is considered "ready", both the new node and the existing network are actively producing blocks — not just that docker container is running.

@facuMH facuMH self-assigned this Jun 25, 2026
@facuMH
facuMH force-pushed the facundo/refactor_online_nodes branch from 13171ad to e98c0fc Compare June 25, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant