Ogmios Client

class ogmios.client.Client(host: str = 'localhost', port: int = 1337, secure: bool = False, http_only: bool = False, rpc_version: Jsonrpc = Jsonrpc.field_2_0)

Bases: object

Ogmios connection client

A subset of Ogmios functions require the use of WebSockets. Therefore a WebSocket connection is preferred over HTTP. If http_only is set to True, functions that require WebSockets will not be available.

If secure is set to False, ws / http will be used rather than wss / https

Parameters:
  • host (str) – The host of the Ogmios server

  • port (int) – The port of the Ogmios server

  • secure (bool) – Use secure connection

  • http_only (bool) – Use HTTP connection

  • compact (bool) – Use compact connection

  • rpc_version (Jsonrpc) – The JSON-RPC version to use

receive() dict

Receive a response from the Ogmios server

Returns:

Request response

send(request: str) None

Send a request to the Ogmios server

Parameters:

request (str) – The request to send