Anoma.Client.Node.RPC (Anoma v0.34.0)

I contain functions that make requests to the GRPC endpoint of a node.

Summary

Functions

I make a call to a GRPC endpoint to retrieve a list of intents from a remote node.

I make a call to a GRPC endpoint to add a read-only transaction to the mempool of the node.

I make a call to a GRPC endpoint to add a transaction to the mempool of the node.

I advertise to a remote node about my existence, and how it can reach me.

I make a call to a GRPC endpoint to retrieve a list of intents from a remote node.

I subscribe to all events for a given topic on the remote node.

Functions

add_intent(channel, node_id, intent)

@spec add_intent(any(), String.t(), binary()) ::
  {:ok, :added} | {:error, :add_intent_failed, String.t()}

I make a call to a GRPC endpoint to retrieve a list of intents from a remote node.

add_read_only_transaction(channel, node_id, transaction)

@spec add_read_only_transaction(any(), String.t(), binary()) ::
  {:ok, Noun.t()}
  | {:error, :add_read_only_transaction_failed, String.t()}
  | {:error, :absent}

I make a call to a GRPC endpoint to add a read-only transaction to the mempool of the node.

The result of this call is either an error, or a jammed noun.

add_transaction(channel, node_id, transaction, transaction_type, wrap)

@spec add_transaction(any(), String.t(), binary(), atom(), boolean()) ::
  {:ok, :added} | {:error, :add_transaction_failed, String.t()}

I make a call to a GRPC endpoint to add a transaction to the mempool of the node.

advertise(channel, node_id, client_id, grpc_port, grpc_host)

@spec advertise(GRPC.Channel.t(), any(), any(), any(), any()) ::
  {:error, :failed_to_fetch_intents} | {:ok, any()}

I advertise to a remote node about my existence, and how it can reach me.

list_intents(channel, node_id)

@spec list_intents(any(), String.t()) ::
  {:ok, [binary()]} | {:error, :failed_to_fetch_intents}

I make a call to a GRPC endpoint to retrieve a list of intents from a remote node.

subscribe(channel, node_id, client_id, topic)

@spec subscribe(any(), String.t(), String.t(), String.t()) ::
  {:ok, :subscribed} | {:error, :subscribe_failed, any()}

I subscribe to all events for a given topic on the remote node.