View Source Xander.Query (Xander v0.2.0)
Issues ledger queries to a Cardano node using the Node-to-Client (n2c) protocol.
This module implements the gen_statem
OTP behaviour.
Summary
Functions
Returns a child specification for the process. This determines the configuration of the OTP process when it is started by its parent.
Emits events when in the connected
state. Must transition to the
established_has_agency
state prior to sending queries to the node.
Emits events when in the disconnected
state.
Emits events when in the established_has_agency
state.
This maps to the Querying state in the Cardano Local State Query protocol.
Emits events when in the established_no_agency
state.
This maps to the StIdle state in the Cardano Local State Query protocol.
This is the state where the process waits for a query to be made.
Sends a query to the connected Cardano node.
Starts a new query process.
Functions
Returns a child specification for the process. This determines the configuration of the OTP process when it is started by its parent.
Emits events when in the connected
state. Must transition to the
established_has_agency
state prior to sending queries to the node.
Emits events when in the disconnected
state.
Emits events when in the established_has_agency
state.
This maps to the Querying state in the Cardano Local State Query protocol.
Emits events when in the established_no_agency
state.
This maps to the StIdle state in the Cardano Local State Query protocol.
This is the state where the process waits for a query to be made.
Sends a query to the connected Cardano node.
Available queries are:
:get_current_era
:get_current_block_height
:get_epoch_number
:get_current_tip
For example:
Xander.Query.run(pid, :get_epoch_number)
@spec start_link(Keyword.t()) :: GenServer.on_start()
Starts a new query process.