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
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
add_intent(conn \\ setup())
@spec add_intent(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Client.Examples.EClient.EConnection.t()
I add an intent to the client.
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.
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.
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.
jammed_input(value \\ <<>>)
@spec jammed_input(any()) :: Anoma.Protobuf.Nock.Input.t()
jammed_program_example()
@spec jammed_program_example() :: binary()
jammed_program_juvix_squared()
@spec jammed_program_juvix_squared() :: binary()
jammed_program_minisquare()
@spec jammed_program_minisquare() :: binary()
jammed_program_tracing()
@spec jammed_program_tracing() :: binary()
kill_existing_client()
@spec kill_existing_client() :: :ok
I kill the existing client.
list_intents(conn \\ setup())
@spec list_intents(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Client.Examples.EClient.EConnection.t()
I list the intents over grpc on the client.
list_nullifiers(conn \\ setup())
@spec list_nullifiers(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Client.Examples.EClient.EConnection.t()
I list all nullifiers.
list_unrevealed_commits(conn \\ setup())
@spec list_unrevealed_commits(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Client.Examples.EClient.EConnection.t()
I list all unrevealed commits.
list_unspent_resources(conn \\ setup())
@spec list_unspent_resources(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Client.Examples.EClient.EConnection.t()
I list all unspent resources.
noun_program_example()
@spec noun_program_example() :: Noun.t()
noun_program_juvix_squared()
@spec noun_program_juvix_squared() :: Noun.t()
noun_program_minisquare()
@spec noun_program_minisquare() :: Noun.t()
noun_program_tracing()
@spec noun_program_tracing() :: Noun.t()
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.
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.
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.
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.
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.
run_juvix_with_hints(conn \\ setup())
@spec run_juvix_with_hints(Anoma.Client.Examples.EClient.EConnection.t()) :: Anoma.Protobuf.Nock.Prove.Response.t()
setup()
@spec setup() :: Anoma.Client.Examples.EClient.EConnection.t()
I create the setup necessary to run each example below without arguments.
text_input(value \\ "")
@spec text_input(any()) :: Anoma.Protobuf.Nock.Input.t()
text_program_example()
@spec text_program_example() :: binary()
text_program_minisquare()
@spec text_program_minisquare() :: binary()
text_program_tracing()
@spec text_program_tracing() :: String.t()