mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
parent
5f4beecccd
commit
da67ee7066
@ -4,12 +4,12 @@
|
||||
package com.daml.ledger.client
|
||||
|
||||
import java.io.Closeable
|
||||
|
||||
import com.daml.grpc.adapter.ExecutionSequencerFactory
|
||||
import com.daml.ledger.api.auth.client.LedgerCallCredentials.authenticatingStub
|
||||
import com.daml.ledger.api.domain.LedgerId
|
||||
import com.daml.ledger.api.v1.active_contracts_service.ActiveContractsServiceGrpc
|
||||
import com.daml.ledger.api.v1.admin.package_management_service.PackageManagementServiceGrpc
|
||||
import com.daml.ledger.api.v1.admin.participant_pruning_service.ParticipantPruningServiceGrpc
|
||||
import com.daml.ledger.api.v1.admin.party_management_service.PartyManagementServiceGrpc
|
||||
import com.daml.ledger.api.v1.admin.user_management_service.UserManagementServiceGrpc
|
||||
import com.daml.ledger.api.v1.command_completion_service.CommandCompletionServiceGrpc
|
||||
@ -26,6 +26,7 @@ import com.daml.ledger.client.configuration.{
|
||||
import com.daml.ledger.client.services.acs.ActiveContractSetClient
|
||||
import com.daml.ledger.client.services.admin.{
|
||||
PackageManagementClient,
|
||||
ParticipantPruningManagementClient,
|
||||
PartyManagementClient,
|
||||
UserManagementClient,
|
||||
}
|
||||
@ -93,6 +94,11 @@ final class LedgerClient private (
|
||||
LedgerClient.stub(UserManagementServiceGrpc.stub(channel), config.token)
|
||||
)
|
||||
|
||||
val participantPruningManagementClient: ParticipantPruningManagementClient =
|
||||
new ParticipantPruningManagementClient(
|
||||
LedgerClient.stub(ParticipantPruningServiceGrpc.stub(channel), config.token)
|
||||
)
|
||||
|
||||
override def close(): Unit = GrpcChannel.close(channel)
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package com.daml.ledger.client.services.admin
|
||||
|
||||
import com.daml.ledger.api.v1.admin.participant_pruning_service.ParticipantPruningServiceGrpc.ParticipantPruningServiceStub
|
||||
import com.daml.ledger.api.v1.admin.participant_pruning_service.{PruneRequest, PruneResponse}
|
||||
import com.daml.ledger.client.LedgerClient
|
||||
|
||||
import scala.concurrent.Future
|
||||
|
||||
object ParticipantPruningManagementClient {
|
||||
|
||||
private def pruneRequest(pruneUpTo: String) = PruneRequest(pruneUpTo = pruneUpTo)
|
||||
|
||||
}
|
||||
|
||||
final class ParticipantPruningManagementClient(service: ParticipantPruningServiceStub) {
|
||||
|
||||
def prune(pruneUpTo: String, token: Option[String] = None): Future[PruneResponse] =
|
||||
LedgerClient
|
||||
.stub(service, token)
|
||||
.prune(ParticipantPruningManagementClient.pruneRequest(pruneUpTo))
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user