View Source Xogmios.StateQuery (xogmios v0.1.0)

This module interfaces with the State Query protocol.

Summary

Functions

Sends a State Query call to the server and returns a response.

Starts a new State Query process linked to the current process.

Functions

Link to this function

send_query(client \\ __MODULE__, query)

View Source
@spec send_query(pid() | atom(), atom()) :: {:ok, any()} | {:error, any()}

Sends a State Query call to the server and returns a response.

This function is synchronous and takes two arguments:

  1. (Optional) A process reference. If none given, it defaults to the linked process __MODULE__.
  2. The query to run. Support for all available queries is actively being worked on. For the time being, it only accepts the following values: :get_current_epoch,:get_era_start
Link to this function

start_link(client, opts)

View Source
@spec start_link(module(), start_options :: Keyword.t()) :: GenServer.on_start()

Starts a new State Query process linked to the current process.

This function should not be called directly, but rather via Xogmios.start_state_link/2