Anoma.Client (Anoma v0.34.0)

Documentation for Client.

Summary

Functions

I return the list of intents in the node I'm connected to.

I add a transaction to the mempool of the node I'm connected to.

I compose a list of transactions.

I connect to a remote node over GRPC.

Given a Client, I disconnect it and cleanup.

I return the list of intents in the node I'm connected to.

I prove a Nock program with its public and private inputs, and return the result.

I run a Nock program with its inputs, and return the result.

I prove a Nock program with its public and private inputs, and return the result.

Types

t()

@type t() :: %Anoma.Client{pid: pid() | nil}

Functions

add_intent(intent)

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

I return the list of intents in the node I'm connected to.

add_transaction(transaction, transaction_type)

@spec add_transaction(Noun.t(), atom()) :: {:ok, :added} | {:error, String.t()}

I add a transaction to the mempool of the node I'm connected to.

compose(transactions)

I compose a list of transactions.

connect(host, port, node_id)

@spec connect(String.t(), integer(), String.t()) ::
  {:ok, t()} | {:error, :node_unreachable} | {:error, :unknown_error, any()}

I connect to a remote node over GRPC.

disconnect(client)

@spec disconnect(t()) :: :ok

Given a Client, I disconnect it and cleanup.

list_intents()

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

I return the list of intents in the node I'm connected to.

prove(program, public_inputs, private_inputs)

@spec prove(Noun.t(), [Noun.t()], [Noun.t()]) ::
  {:ok, Noun.t(), [Noun.t()]} | {:error, any(), [Noun.t()]}

I prove a Nock program with its public and private inputs, and return the result.

run(program, inputs)

@spec run(Noun.t(), [Noun.t()]) ::
  {:ok, Noun.t(), [Noun.t()]} | {:error, any(), [Noun.t()]}

I run a Nock program with its inputs, and return the result.

subscribe(topic)

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

I prove a Nock program with its public and private inputs, and return the result.