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).
- grpc_
protobuf - Raw prost-generated Ledger API v2 protobuf bindings.
- 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§
- Daml
Command Factory - Factory for assembling
DamlCommandspayloads from a fixed set of submission parameters (workflow id, user id, act-as parties, dedup period, …) and a variable list ofDamlCommands. - Daml
Grpc Client - Daml v2 ledger client connection. A thin handle around a tonic
Channelthat hands out per-service clients on demand. Cheap to hold — service factories clone the channel rather than opening new ones. - Daml
Grpc Client Builder - Construct a
DamlGrpcClient. - Daml
Simple Executor - A simple async Daml command executor.
- Daml
Simple Executor Builder - Construct a
DamlSimpleExecutor.
Traits§
- Command
Executor - An async failable Daml command executor.