View Source Xogmios.StateQuery (xogmios v0.8.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
Sends a State Query call to the server and returns a response.
This function is synchronous and takes two arguments:
- (Optional) A process reference. If none given, it defaults to the linked process
__MODULE__
. - The name of the query to run.
- (Optional) Parameters to the query.
Support for all Ledger-state and Network queries.
For Ledger-state queries, only the name of the query is needed. For example, the following function call
StateQuery.send_query(pid, "epoch")
is the same as calling
StateQuery.send_query(pid, "queryLedgerState/epoch")
For Network queries, the prefix "queryNetwork/" is needed. For example:
StateQuery.send_query(pid, "queryNetwork/blockHeight")
Optional parameters are passed as the third argument:
query_name = "utxo"
query_params = %{addresses: [address_1, address_2]}
StateQuery.send_query(pid, query_name, query_params)
@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