@@ -21,19 +21,24 @@ module Testnet.Defaults
2121 , defaultDRepSkeyFp
2222 , defaultDRepKeyPair
2323 , defaultDelegatorStakeKeyPair
24+ , defaultNodeName
25+ , defaultNodeDataDir
2426 , defaultSpoColdKeyPair
25- , defaultSPOColdVKeyFp
26- , defaultSPOColdSKeyFp
27+ , defaultSpoColdVKeyFp
28+ , defaultSpoColdSKeyFp
2729 , defaultSpoKeys
30+ , defaultSpoKeysDir
31+ , defaultSpoName
2832 , defaultShelleyGenesis
2933 , defaultGenesisFilepath
3034 , defaultYamlHardforkViaConfig
3135 , defaultMainnetTopology
36+ , defaultUtxoKeys
3237 , plutusV3Script
3338 ) where
3439
35- import Cardano.Api (CardanoEra (.. ), File (.. ), pshow , ShelleyBasedEra (.. ),
36- toCardanoEra , unsafeBoundedRational , AnyShelleyBasedEra (.. ))
40+ import Cardano.Api (AnyShelleyBasedEra (.. ), CardanoEra (.. ), File (.. ),
41+ ShelleyBasedEra (.. ), pshow , toCardanoEra , unsafeBoundedRational )
3742import qualified Cardano.Api.Shelley as Api
3843
3944import Cardano.Ledger.Alonzo.Core (PParams (.. ))
@@ -256,7 +261,7 @@ defaultYamlHardforkViaConfig sbe =
256261 , (proxyName (Proxy @ TraceTxOutbound ), False )
257262 , (proxyName (Proxy @ TraceTxSubmissionProtocol ), False )
258263 ]
259-
264+
260265defaultYamlConfig :: Aeson. KeyMap Aeson. Value
261266defaultYamlConfig =
262267 Aeson. fromList
@@ -468,37 +473,53 @@ defaultCommitteeKeyPair n =
468473 }
469474
470475-- | The relative path to SPO cold verification key in directories created by cardano-testnet
471- defaultSPOColdVKeyFp :: Int -> FilePath
472- defaultSPOColdVKeyFp n = " pools-keys " </> " pool " <> show n </> " cold.vkey"
476+ defaultSpoColdVKeyFp :: Int -> FilePath
477+ defaultSpoColdVKeyFp n = defaultSpoKeysDir n </> " cold.vkey"
473478
474479-- | The relative path to SPO cold secret key in directories created by cardano-testnet
475- defaultSPOColdSKeyFp :: Int -> FilePath
476- defaultSPOColdSKeyFp n = " pools-keys" </> " pool" <> show n </> " cold.skey"
480+ defaultSpoColdSKeyFp :: Int -> FilePath
481+ defaultSpoColdSKeyFp n = defaultSpoKeysDir n </> " cold.skey"
482+
483+ -- | The name of a SPO, used in file system operations
484+ defaultSpoName :: Int -> String
485+ defaultSpoName n = " pool" <> show n
486+
487+ -- | The name of a node (which doesn't have to be a SPO)
488+ defaultNodeName :: Int -> String
489+ defaultNodeName n = " node" <> show n
490+
491+ -- | The relative path of the node data dir, where the database is stored
492+ defaultNodeDataDir :: Int -> String
493+ defaultNodeDataDir n = " node-data" </> defaultNodeName n
494+
495+ -- | The relative path where the SPO keys for the node are stored
496+ defaultSpoKeysDir :: Int -> String
497+ defaultSpoKeysDir n = " pools-keys" </> defaultSpoName n
477498
478499-- | The relative path to SPO keys in directories created by cardano-testnet
479500defaultSpoColdKeyPair
480501 :: Int
481502 -> KeyPair SpoColdKey
482503defaultSpoColdKeyPair n =
483504 KeyPair
484- { verificationKey = File $ " pools-keys " </> " pool " <> show n </> " cold.vkey"
485- , signingKey = File $ " pools-keys " </> " pool " <> show n </> " cold.skey"
505+ { verificationKey = File $ defaultSpoKeysDir n </> " cold.vkey"
506+ , signingKey = File $ defaultSpoKeysDir n </> " cold.skey"
486507 }
487508
488509-- | The relative path to SPO key pairs in directories created by cardano-testnet
489- defaultSpoKeys :: Int -> PoolNodeKeys
510+ defaultSpoKeys :: Int -> TestnetNodeKeys
490511defaultSpoKeys n =
491- PoolNodeKeys
512+ TestnetNodeKeys
492513 { poolNodeKeysCold = defaultSpoColdKeyPair n
493514 , poolNodeKeysVrf =
494515 KeyPair
495- { verificationKey = File $ " pools-keys " </> " pool " ++ show n </> " vrf.vkey"
496- , signingKey = File $ " pools-keys " </> " pool " ++ show n </> " vrf.skey"
516+ { verificationKey = File $ defaultSpoKeysDir n </> " vrf.vkey"
517+ , signingKey = File $ defaultSpoKeysDir n </> " vrf.skey"
497518 }
498519 , poolNodeKeysStaking =
499520 KeyPair
500- { verificationKey = File $ " pools-keys " </> " pool " ++ show n </> " staking-reward.vkey"
501- , signingKey = File $ " pools-keys " </> " pool " ++ show n </> " staking-reward.skey"
521+ { verificationKey = File $ defaultSpoKeysDir n </> " staking-reward.vkey"
522+ , signingKey = File $ defaultSpoKeysDir n </> " staking-reward.skey"
502523 }
503524 }
504525
@@ -510,6 +531,14 @@ defaultDelegatorStakeKeyPair n =
510531 , signingKey = File $ " stake-delegators" </> (" delegator" <> show n) </> " staking.skey"
511532 }
512533
534+ -- | The relative path to UTXO keys
535+ defaultUtxoKeys :: Int -> KeyPair PaymentKey
536+ defaultUtxoKeys n =
537+ KeyPair
538+ { verificationKey = File $ " utxo-keys" </> " utxo" <> show n </> " utxo.vkey"
539+ , signingKey = File $ " utxo-keys" </> " utxo" <> show n </> " utxo.skey"
540+ }
541+
513542-- | Default plutus script that always succeeds
514543plutusV3Script :: Text
515544plutusV3Script =
0 commit comments