Crate daml_grpc

Crate daml_grpc 

Source
Expand description

Daml ledger GRPC API.

This library provides a client for the Daml ledger GRPC API.

§Example

The following example demonstrates creating a DamlGrpcClient using the DamlGrpcClientBuilder, then creating a DamlSimpleExecutor using the DamlSimpleExecutorBuilder and finally creating and submitting a DamlCreateCommand to the ledger:

let client = DamlGrpcClientBuilder::uri("http://localhost:8082").connect().await?;
let executor = DamlSimpleExecutorBuilder::new(&client).act_as("Alice").build()?;
let template_id = DamlIdentifier::new("...", "Fuji.PingPong", "Ping");
let record = DamlRecord::new(vec![], None::<DamlIdentifier>);
let command = DamlCreateCommand::new(template_id, record);
let create_event = executor.execute_create(command).await?;

Note that Daml commands such as DamlCreateCommand can be automatically generated for existing Daml templates using the various functions and macros provided in the daml-codegen crate.

Note also that the daml_value macro is provided to simplify the construction of DamlRecord and DamlValue types.

Modules§

data
Daml API domain objects (i.e. values, commands, events).
nat
Nat types for specifying Daml Numeric types.
primitive_types
Daml primitive data types.
serialize
Serialize & Deserialize Daml types.
service
Daml GRPC API services (i.e. command & transaction services).

Structs§

DamlCommandFactory
Factory for creating DamlCommands to submit to a Daml ledger.
DamlGrpcClient
Daml ledger client connection.
DamlGrpcClientBuilder
Construct a DamlGrpcClient.
DamlSimpleExecutor
A simple async Daml command executor.
DamlSimpleExecutorBuilder
Construct a DamlSimpleExecutor.

Traits§

CommandExecutor
An async failable Daml command executor.
Executor
A generic failable executor.