Anoma.Client.Examples.EClient (Anoma v0.29.0)

I contain functions to test the public interface of the client.

I start a new client and if necessary a node, and then connect to that node.

I test the public GRPC interface of the client to ensure it works as expected.

Summary

Types

t()

I am the state of a TCP listener.

Functions

I add an intent to the client.

I create an instance of the client and connect it to the given node.

I create an example stub to a given clients GRPC endpoint.

I create a new node in the system, and ensure that that is the only node that is running by killing all other nodes.

I kill the existing client.

I list the intents over grpc on the client.

I list all nullifiers.

I list all unrevealed commits.

I list all unspent resources.

I run a Juvix program that squares its inputs without an argument.

I run a jammed nock program using the client.

I run a plaintext nock program using the client.

I run a Juvix program that squares its inputs.

I run a Juvix program that squares its inputs without an argument.

I create the setup necessary to run each example below without arguments.

Types

@type t() :: %Anoma.Client.Examples.EClient{
  channel: any() | nil,
  client: Anoma.Client.t() | nil,
  node: Anoma.Node.Examples.ENode.t() | nil,
  supervisor: pid() | nil
}

I am the state of a TCP listener.

My fields contain information to listen for TCP connection with a remote node.

Fields

  • :channel - The channel for making grpc requests.
  • :supervisor - the pid of the supervision tree.
  • :node - The node to which the client is connected.
  • :client - The client that is connected to the node.
  • :channel - The channel for making grpc requests.

Functions

Link to this function

add_intent(conn \\ setup())

I add an intent to the client.

Link to this function

create_example_client(enode \\ create_single_example_node())

@spec create_example_client(Anoma.Node.Examples.ENode.t() | nil) :: t()

I create an instance of the client and connect it to the given node.

If there is already a client started, I kill it and start a new one.

Link to this function

create_example_connection(eclient \\ create_example_client())

@spec create_example_connection(t()) :: Anoma.Client.Examples.EClient.EConnection.t()

I create an example stub to a given clients GRPC endpoint.

Link to this function

create_single_example_node()

@spec create_single_example_node() :: Anoma.Node.Examples.ENode.t()

I create a new node in the system, and ensure that that is the only node that is running by killing all other nodes.

Link to this function

jammed_input(value \\ <<>>)

@spec jammed_input(any()) :: Anoma.Protobuf.Nock.Input.t()
Link to this function

jammed_program_example()

@spec jammed_program_example() :: binary()
Link to this function

jammed_program_juvix_squared()

@spec jammed_program_juvix_squared() :: binary()
Link to this function

jammed_program_minisquare()

@spec jammed_program_minisquare() :: binary()
Link to this function

jammed_program_tracing()

@spec jammed_program_tracing() :: binary()
Link to this function

kill_existing_client()

@spec kill_existing_client() :: :ok

I kill the existing client.

Link to this function

list_intents(conn \\ setup())

I list the intents over grpc on the client.

Link to this function

list_nullifiers(conn \\ setup())

I list all nullifiers.

Link to this function

list_unrevealed_commits(conn \\ setup())

I list all unrevealed commits.

Link to this function

list_unspent_resources(conn \\ setup())

I list all unspent resources.

Link to this function

noun_program_example()

@spec noun_program_example() :: Noun.t()
Link to this function

noun_program_juvix_squared()

@spec noun_program_juvix_squared() :: Noun.t()
Link to this function

noun_program_minisquare()

@spec noun_program_minisquare() :: Noun.t()
Link to this function

noun_program_tracing()

@spec noun_program_tracing() :: Noun.t()
Link to this function

prove_juvix_factorial_no_arguments(conn \\ setup())

@spec prove_juvix_factorial_no_arguments(
  Anoma.Client.Examples.EClient.EConnection.t()
) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I run a Juvix program that squares its inputs without an argument.

I expect the result to be 0.

Link to this function

prove_something_jammed(conn \\ setup())

@spec prove_something_jammed(Anoma.Client.Examples.EClient.EConnection.t()) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I run a jammed nock program using the client.

Link to this function

prove_something_text(conn \\ setup())

@spec prove_something_text(Anoma.Client.Examples.EClient.EConnection.t()) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I run a plaintext nock program using the client.

Link to this function

run_juvix_factorial(conn \\ setup())

@spec run_juvix_factorial(Anoma.Client.Examples.EClient.EConnection.t()) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I run a Juvix program that squares its inputs.

Link to this function

run_juvix_factorial_no_arguments(conn \\ setup())

@spec run_juvix_factorial_no_arguments(Anoma.Client.Examples.EClient.EConnection.t()) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I run a Juvix program that squares its inputs without an argument.

I expect the result to be 0.

Link to this function

run_juvix_with_hints(conn \\ setup())

@spec run_juvix_with_hints(Anoma.Client.Examples.EClient.EConnection.t()) ::
  Anoma.Protobuf.Nock.Prove.Response.t()

I create the setup necessary to run each example below without arguments.

Link to this function

text_input(value \\ "")

@spec text_input(any()) :: Anoma.Protobuf.Nock.Input.t()
Link to this function

text_program_example()

@spec text_program_example() :: binary()
Link to this function

text_program_minisquare()

@spec text_program_minisquare() :: binary()
Link to this function

text_program_tracing()

@spec text_program_tracing() :: String.t()