Skip to content

Commit

Permalink
fix: Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan <[email protected]>
  • Loading branch information
ryan-s-roberts committed Jul 25, 2022
1 parent 107fafc commit c1948fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import com.blockchaintp.daml.address.Identifier
import com.blockchaintp.daml.address.LedgerAddress
import com.blockchaintp.daml.participant.ParticipantBuilder
import com.daml.ledger.api.v1.admin.config_management_service.TimeModel
import com.daml.ledger.configuration.{Configuration, LedgerTimeModel}
import com.daml.ledger.configuration.Configuration
import com.daml.ledger.configuration.LedgerTimeModel
import com.daml.ledger.participant.state.kvutils.api.KeyValueLedger
import com.daml.ledger.participant.state.kvutils.api.KeyValueParticipantState
import com.daml.ledger.participant.state.kvutils.app.Config
Expand Down Expand Up @@ -60,24 +61,6 @@ abstract class BuilderLedgerFactory[
}

override def initialLedgerConfig(config: Config[ExtraConfig]): InitialLedgerConfiguration =
InitialLedgerConfiguration(
configuration = Configuration(
generation = 1,
timeModel = TimeModel(
LedgerTimeModel(
avgTransactionLatency = Duration.ofSeconds(1L),
minSkew = Duration.ofSeconds(40L),
maxSkew = Duration.ofSeconds(80L)
).get,
maxDeduplicationTime = Duration.ofDays(1)
),
initialConfigurationSubmitDelay = Duration.ofSeconds(5),
configurationLoadTimeout = Duration.ofSeconds(10)
delayBeforeSubmitting = Duration.ofSeconds(5)
)
)

def initialLedgerConfig(config: Config[ExtraConfig]): InitialLedgerConfiguration =
InitialLedgerConfiguration(
configuration = Configuration(
generation = 1,
Expand Down
25 changes: 3 additions & 22 deletions postgres/src/main/scala/com/blockchaintp/daml/postgres/Main.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Blockchain Technology Partners
* Copyright 2021-2022 Blockchain Technology Partners
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -24,21 +24,20 @@ import com.daml.jwt.RSA256Verifier
import com.daml.ledger.api.auth.AuthService
import com.daml.ledger.api.auth.AuthServiceJWT
import com.daml.ledger.api.auth.AuthServiceWildcard
import com.daml.ledger.api.v1.ledger_configuration_service.LedgerConfiguration
import com.daml.ledger.participant.state.kvutils.api.CommitMetadata
import com.daml.ledger.participant.state.kvutils.app.Config
import com.daml.ledger.participant.state.kvutils.app.ParticipantConfig
import com.daml.ledger.participant.state.kvutils.app.Runner
import com.daml.ledger.resources.ResourceContext
import com.daml.ledger.validator.DefaultStateKeySerializationStrategy
import com.daml.platform.configuration.CommandConfiguration
import com.daml.platform.configuration.LedgerConfiguration
import com.daml.resources.ProgramResource
import scopt.OptionParser

import scala.jdk.CollectionConverters._
import java.nio.file.Paths
import scala.concurrent.duration.DurationInt
import scala.concurrent.duration.FiniteDuration
import java.time.Duration
import scala.jdk.FunctionConverters.enrichAsJavaFunction
import scala.util.Try

Expand Down Expand Up @@ -113,26 +112,8 @@ class LedgerFactory(
}
}

override def ledgerConfig(config: Config[ExtraConfig]): LedgerConfiguration =
LedgerConfiguration.defaultLocalLedger

override val defaultExtraConfig: ExtraConfig = ExtraConfig.default

override def commandConfig(
participantConfig: ParticipantConfig,
config: Config[ExtraConfig]
): CommandConfiguration = {
val DefaultTrackerRetentionPeriod: FiniteDuration = 5.minutes

CommandConfiguration(
inputBufferSize = 512,
maxParallelSubmissions = 1,
maxCommandsInFlight = 256,
limitMaxCommandsInFlight = true,
retentionPeriod = DefaultTrackerRetentionPeriod
)
}

private def validatePath(path: String, message: String) = {
val valid = Try(Paths.get(path).toFile.canRead).getOrElse(false)
if (valid) Right(()) else Left(message)
Expand Down

0 comments on commit c1948fd

Please sign in to comment.