-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MVP Multi Domain Ledger API (#16760)
First draw of Multi Domain Ledger API V2 [CHANGELOG_BEGIN] introducing Ledger API V2 in a backwards compatible fashion. For change-log and migration hints please read v2/package.proto. [CHANGELOG_END]
- Loading branch information
1 parent
cfc499f
commit 9f55d67
Showing
26 changed files
with
1,486 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
ledger-api/grpc-definitions/com/daml/ledger/api/v2/command_completion_service.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
syntax = "proto3"; | ||
|
||
package com.daml.ledger.api.v2; | ||
|
||
import "com/daml/ledger/api/v1/command_completion_service.proto"; | ||
import "com/daml/ledger/api/v2/completion.proto"; | ||
import "com/daml/ledger/api/v2/participant_offset.proto"; | ||
|
||
option java_outer_classname = "CommandCompletionServiceOuterClass"; | ||
option java_package = "com.daml.ledger.api.v2"; | ||
option csharp_namespace = "Com.Daml.Ledger.Api.V2"; | ||
|
||
// Allows clients to observe the status of their submissions. | ||
// Commands may be submitted via the Command Submission Service. | ||
// The on-ledger effects of their submissions are disclosed by the Update Service. | ||
// | ||
// Commands may fail in 2 distinct manners: | ||
// | ||
// 1. Failure communicated synchronously in the gRPC error of the submission. | ||
// 2. Failure communicated asynchronously in a Completion, see ``completion.proto``. | ||
// | ||
// Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY | ||
// choose to produce a completion event for a rejection of a duplicate command. | ||
// | ||
// Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. | ||
// Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions. | ||
service CommandCompletionService { | ||
|
||
// Subscribe to command completion events. | ||
rpc CompletionStream (CompletionStreamRequest) returns (stream CompletionStreamResponse); | ||
} | ||
|
||
message CompletionStreamRequest { | ||
|
||
// Only completions of commands submitted with the same application_id will be visible in the stream. | ||
// Must be a valid ApplicationIdString (as described in ``value.proto``). | ||
// Required unless authentication is used with a user token or a custom token specifying an application-id. | ||
// In that case, the token's user-id, respectively application-id, will be used for the request's application_id. | ||
string application_id = 1; | ||
|
||
// Non-empty list of parties whose data should be included. | ||
// Only completions of commands for which at least one of the ``act_as`` parties is in the given set of parties | ||
// will be visible in the stream. | ||
// Must be a valid PartyIdString (as described in ``value.proto``). | ||
// Required | ||
repeated string parties = 2; | ||
|
||
// This field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. | ||
// Optional, if not set the ledger uses the current ledger end offset instead. | ||
ParticipantOffset begin_exclusive = 3; | ||
} | ||
|
||
message CompletionStreamResponse { | ||
|
||
// This checkpoint may be used to restart consumption. The | ||
// checkpoint belongs to the completion in this response. | ||
// Required | ||
com.daml.ledger.api.v1.Checkpoint checkpoint = 1; | ||
|
||
// Required | ||
Completion completion = 2; | ||
|
||
// The sequencing domain. | ||
// In case | ||
// - successful/failed transactions: identifies the sequencing domain of the transaction | ||
// - for successful/failed unassign commands: identifies the source domain | ||
// - for successful/failed assign commands: identifies the target domain | ||
// Required | ||
string domain_id = 3; | ||
} |
78 changes: 78 additions & 0 deletions
78
ledger-api/grpc-definitions/com/daml/ledger/api/v2/command_service.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
syntax = "proto3"; | ||
|
||
package com.daml.ledger.api.v2; | ||
|
||
import "com/daml/ledger/api/v2/commands.proto"; | ||
import "com/daml/ledger/api/v2/transaction.proto"; | ||
import "google/protobuf/empty.proto"; | ||
|
||
option java_outer_classname = "CommandServiceOuterClass"; | ||
option java_package = "com.daml.ledger.api.v2"; | ||
option csharp_namespace = "Com.Daml.Ledger.Api.V2"; | ||
|
||
// Command Service is able to correlate submitted commands with completion data, identify timeouts, and return contextual | ||
// information with each tracking result. This supports the implementation of stateless clients. | ||
// | ||
// Note that submitted commands generally produce completion events as well, even in case a command gets rejected. | ||
// For example, the participant SHOULD produce a completion event for a rejection of a duplicate command. | ||
service CommandService { | ||
|
||
// Submits a single composite command and waits for its result. | ||
// Propagates the gRPC error of failed submissions including Daml interpretation errors. | ||
rpc SubmitAndWait (SubmitAndWaitRequest) returns (google.protobuf.Empty); | ||
|
||
// Submits a single composite command, waits for its result, and returns the update id. | ||
// Propagates the gRPC error of failed submissions including Daml interpretation errors. | ||
rpc SubmitAndWaitForUpdateId (SubmitAndWaitRequest) returns (SubmitAndWaitForUpdateIdResponse); | ||
|
||
// Submits a single composite command, waits for its result, and returns the transaction. | ||
// Propagates the gRPC error of failed submissions including Daml interpretation errors. | ||
rpc SubmitAndWaitForTransaction (SubmitAndWaitRequest) returns (SubmitAndWaitForTransactionResponse); | ||
|
||
// Submits a single composite command, waits for its result, and returns the transaction tree. | ||
// Propagates the gRPC error of failed submissions including Daml interpretation errors. | ||
rpc SubmitAndWaitForTransactionTree (SubmitAndWaitRequest) returns (SubmitAndWaitForTransactionTreeResponse); | ||
} | ||
|
||
// These commands are atomic, and will become transactions. | ||
message SubmitAndWaitRequest { | ||
|
||
// The commands to be submitted. | ||
// Required | ||
Commands commands = 1; | ||
} | ||
|
||
message SubmitAndWaitForUpdateIdResponse { | ||
|
||
// The id of the transaction that resulted from the submitted command. | ||
// Must be a valid LedgerString (as described in ``value.proto``). | ||
// Required | ||
string update_id = 1; | ||
|
||
// The format of this field is described in ``ledger_offset.proto``. | ||
// Optional | ||
string completion_offset = 2; | ||
} | ||
|
||
message SubmitAndWaitForTransactionResponse { | ||
|
||
// The flat transaction that resulted from the submitted command. | ||
// Required | ||
Transaction transaction = 1; | ||
// The format of this field is described in ``ledger_offset.proto``. | ||
// Optional | ||
string completion_offset = 2; | ||
} | ||
|
||
message SubmitAndWaitForTransactionTreeResponse { | ||
|
||
// The transaction tree that resulted from the submitted command. | ||
// Required | ||
TransactionTree transaction = 1; | ||
// The format of this field is described in ``ledger_offset.proto``. | ||
// Optional | ||
string completion_offset = 2; | ||
} |
57 changes: 57 additions & 0 deletions
57
ledger-api/grpc-definitions/com/daml/ledger/api/v2/command_submission_service.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
syntax = "proto3"; | ||
|
||
package com.daml.ledger.api.v2; | ||
|
||
import "com/daml/ledger/api/v2/commands.proto"; | ||
import "com/daml/ledger/api/v2/reassignment_command.proto"; | ||
|
||
option java_outer_classname = "CommandSubmissionServiceOuterClass"; | ||
option java_package = "com.daml.ledger.api.v2"; | ||
option csharp_namespace = "Com.Daml.Ledger.Api.V2"; | ||
|
||
// Allows clients to attempt advancing the ledger's state by submitting commands. | ||
// The final states of their submissions are disclosed by the Command Completion Service. | ||
// The on-ledger effects of their submissions are disclosed by the Update Service. | ||
// | ||
// Commands may fail in 2 distinct manners: | ||
// | ||
// 1. Failure communicated synchronously in the gRPC error of the submission. | ||
// 2. Failure communicated asynchronously in a Completion, see ``completion.proto``. | ||
// | ||
// Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY | ||
// choose to produce a completion event for a rejection of a duplicate command. | ||
// | ||
// Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. | ||
// Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions. | ||
service CommandSubmissionService { | ||
|
||
// Submit a single composite command. | ||
rpc Submit (SubmitRequest) returns (SubmitResponse); | ||
|
||
// Submit a single reassignment. | ||
rpc SubmitReassignment (SubmitReassignmentRequest) returns (SubmitReassignmentResponse); | ||
} | ||
|
||
// The submitted commands will be processed atomically in a single transaction. Moreover, each ``Command`` in ``commands`` will be executed in the order specified by the request. | ||
message SubmitRequest { | ||
|
||
// The commands to be submitted in a single transaction. | ||
// Required | ||
Commands commands = 1; | ||
} | ||
|
||
message SubmitResponse { | ||
} | ||
|
||
message SubmitReassignmentRequest { | ||
|
||
// The reassignment command to be submitted. | ||
// Required | ||
ReassignmentCommand reassignment_command = 1; | ||
} | ||
|
||
message SubmitReassignmentResponse { | ||
} |
Oops, something went wrong.