Chain Synchronization Mini-Protocol

class ogmios.chainsync.FindIntersection(client: Client)

Bases: object

Ogmios method to find a point on the blockchain. The first point that is found in the provided list will be returned.

NOTE: This class is not intended to be used directly. Instead, use the Client.find_intersection method.

Parameters:

client (Client) – The client to use for the request.

execute(points: list[Point | Origin], id: Any | None = None)

Send and receive the request.

Parameters:
  • points (list[Point | Origin]) – The list of points to find.

  • id (Any) – The ID of the request.

Returns:

The intersection, tip, and ID of the response.

Return type:

(Point | Origin, Tip | Origin, Optional[Any])

receive()

Receive the response.

Returns:

The intersection, tip, and ID of the response.

Return type:

(Point | Origin, Tip | Origin, Optional[Any])

send(points: list[Point | Origin], id: Any | None = None) None

Send the request.

Parameters:
  • points (list[Point | Origin]) – The list of points to find.

  • id (Any) – The ID of the request.

class ogmios.chainsync.NextBlock(client: Client)

Bases: object

Ogmios method to request the next block in the blockchain.

Parameters:

client (Client) – The client to use for the request.

execute(id: Any | None = None)

Send and receive the request.

Parameters:

id (Any) – The ID of the request.

Returns:

The direction, tip, point or block or origin, and ID of the response.

Return type:

(Direction, Tip, Point | Origin | Block, Optional[Any])

receive()

Receive a previously requested response.

Returns:

The direction, tip, point or block or origin, and ID of the response.

Return type:

(Direction, Tip, Point | Origin | Block, Optional[Any])

send(id: Any | None = None) None

Send the request.

Parameters:
  • jsonrpc (Jsonrpc) – The JSON-RPC version to use.

  • method (Method) – The method to use.

  • id (Any) – The ID of the request.