Skip to content

Commit

Permalink
Use only single pool
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Sep 30, 2024
1 parent 5faedcb commit 0ba2e73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Components/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ createSPOGenesisAndFiles (NumPools numPoolNodes) (NumDReps numDelReps) maxSupply
, "--spec-alonzo", inputGenesisAlonzoFp
, "--spec-conway", inputGenesisConwayFp
, "--testnet-magic", show testnetMagic
, "--pools", show numPoolNodes
, "--pools", "1" -- show numPoolNodes
, "--total-supply", show maxSupply
, "--delegated-supply", show (maxSupply `div` 2) -- Required until https://github.com/IntersectMBO/cardano-cli/pull/874 is integrated
, "--stake-delegators", show numStakeDelegators
Expand Down
11 changes: 7 additions & 4 deletions cardano-testnet/src/Testnet/Start/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import qualified Data.Time.Clock as DTC
import Data.Word (Word64)
import GHC.Stack
import qualified GHC.Stack as GHC
import qualified System.Directory as IO
import System.FilePath ((</>))
import qualified System.Info as OS
import Text.Printf (printf)
Expand Down Expand Up @@ -239,7 +240,7 @@ cardanoTestnet
mkNodeName :: Int -> String
mkNodeName i = "pool" <> show i

poolKeys <- H.noteShow $ flip fmap [1..numPoolNodes] $ \n ->
poolKeys <- H.noteShow $ flip fmap [1..1] $ \n ->
-- TODO: use Testnet.Defaults.defaultSpoKeys here
PoolNodeKeys
{ poolNodeKeysCold =
Expand Down Expand Up @@ -308,8 +309,10 @@ cardanoTestnet
-- Byron related
forM_ (zip [1..] portNumbers) $ \(i, portNumber) -> do
let iStr = printf "%03d" (i - 1)
H.renameFile (tmpAbsPath </> "byron-gen-command" </> "delegate-keys." <> iStr <> ".key") (tmpAbsPath </> poolKeyDir i </> "byron-delegate.key")
H.renameFile (tmpAbsPath </> "byron-gen-command" </> "delegation-cert." <> iStr <> ".json") (tmpAbsPath </> poolKeyDir i </> "byron-delegation.cert")
when (i == 1) $ do
H.renameFile (tmpAbsPath </> "byron-gen-command" </> "delegate-keys." <> iStr <> ".key") (tmpAbsPath </> poolKeyDir i </> "byron-delegate.key")
H.renameFile (tmpAbsPath </> "byron-gen-command" </> "delegation-cert." <> iStr <> ".json") (tmpAbsPath </> poolKeyDir i </> "byron-delegation.cert")
H.evalIO $ IO.createDirectoryIfMissing True $ tmpAbsPath </> poolKeyDir i
H.writeFile (tmpAbsPath </> poolKeyDir i </> "port") (show portNumber)

-- Make topology files
Expand Down Expand Up @@ -393,7 +396,7 @@ cardanoTestnet

stakePoolsFp <- H.note $ tmpAbsPath </> "current-stake-pools.json"

assertExpectedSposInLedgerState stakePoolsFp nPools execConfig
assertExpectedSposInLedgerState stakePoolsFp 1 execConfig

when newEpochStateLogging $
TR.startLedgerNewEpochStateLogging runtime tempBaseAbsPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ import qualified Hedgehog as H
import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as H
import qualified Hedgehog.Extras.Test as H

wCfg :: H.WatchdogConfig
wCfg = H.WatchdogConfig { H.watchdogTimeout = 600 }

-- | Execute me with:
-- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Treasury Growth/"'@
prop_check_if_treasury_is_growing :: H.Property
prop_check_if_treasury_is_growing = integrationRetryWorkspace 0 "growing-treasury" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do
prop_check_if_treasury_is_growing = integrationRetryWorkspace 0 "growing-treasury" $ \tempAbsBasePath' -> H.runWithWatchdog_ wCfg $ do
-- Start testnet
conf@Conf{tempAbsPath=TmpAbsolutePath tempAbsPath'} <- TN.mkConf tempAbsBasePath'
let tempBaseAbsPath = makeTmpBaseAbsPath $ tempAbsPath conf
Expand Down

0 comments on commit 0ba2e73

Please sign in to comment.