Skip to content

Commit

Permalink
cardano-testnet: remove possibility to programmatically pass a custom…
Browse files Browse the repository at this point in the history
… node configuration file (it was unused)

This will be done differently in
#6103
  • Loading branch information
smelc committed Feb 18, 2025
1 parent c2179ff commit 0459379
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cardano-testnet/src/Parsers/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pNumSpoNodes =
<> OA.showDefault
<> OA.value 1)
where
defaultSpoOptions = SpoNodeOptions Nothing []
defaultSpoOptions = SpoNodeOptions []

pGenesisOptions :: Parser GenesisOptions
pGenesisOptions =
Expand Down
8 changes: 0 additions & 8 deletions cardano-testnet/src/Testnet/Start/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import Data.Bifunctor (first)
import qualified Data.ByteString.Lazy as LBS
import Data.Either
import Data.Functor
import Data.Maybe
import Data.MonoTraversable (Element, MonoFunctor, omap)
import qualified Data.Text as Text
import Data.Time (diffUTCTime)
Expand Down Expand Up @@ -219,13 +218,6 @@ cardanoTestnet

H.note_ OS.os

when (all (isJust . testnetNodeCfgFile) cardanoNodes) $
-- TODO: We need a very simple non-obscure way of generating the files necessary
-- to run a testnet. "create-staked" is not a good way to do this especially because it
-- makes assumptions about where things should go and where genesis template files should be.
-- See all of the ad hoc file creation/renaming/dir creation etc below.
H.failMessage GHC.callStack "Specifying node configuration files per node not supported yet."

-- Write specification files. Those are the same as the genesis files
-- used for launching the nodes, but omitting the content regarding stake, utxos, etc.
-- They are used by benchmarking: as templates to CLI commands,
Expand Down
20 changes: 7 additions & 13 deletions cardano-testnet/src/Testnet/Start/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module Testnet.Start.Types
, eraToString

, TestnetNodeOptions(..)
, testnetNodeCfgFile
, testnetNodeExtraCliArgs
, isSpoNodeOptions
, isRelayNodeOptions
Expand Down Expand Up @@ -128,8 +127,8 @@ instance Default GenesisOptions where

-- | Specify a SPO (Shelley era onwards only) or a Relay node
data TestnetNodeOptions
= SpoNodeOptions (Maybe NodeConfigurationYaml) [String]
| RelayNodeOptions (Maybe NodeConfigurationYaml) [String]
= SpoNodeOptions [String]
| RelayNodeOptions [String]
-- ^ These arguments will be appended to the default set of CLI options when
-- starting the node.
deriving (Eq, Show)
Expand All @@ -142,13 +141,8 @@ data UserNodeConfig =

-- | Get extra CLI arguments passed to the node executable
testnetNodeExtraCliArgs :: TestnetNodeOptions -> [String]
testnetNodeExtraCliArgs (SpoNodeOptions _ args) = args
testnetNodeExtraCliArgs (RelayNodeOptions _ args) = args

-- | Get node-specific configuration file path
testnetNodeCfgFile :: TestnetNodeOptions -> Maybe NodeConfigurationYaml
testnetNodeCfgFile (SpoNodeOptions mFp _) = mFp
testnetNodeCfgFile (RelayNodeOptions mFp _) = mFp
testnetNodeExtraCliArgs (SpoNodeOptions args) = args
testnetNodeExtraCliArgs (RelayNodeOptions args) = args

isSpoNodeOptions :: TestnetNodeOptions -> Bool
isSpoNodeOptions SpoNodeOptions{} = True
Expand All @@ -160,9 +154,9 @@ isRelayNodeOptions RelayNodeOptions{} = True

cardanoDefaultTestnetNodeOptions :: [TestnetNodeOptions]
cardanoDefaultTestnetNodeOptions =
[ SpoNodeOptions Nothing []
, RelayNodeOptions Nothing []
, RelayNodeOptions Nothing []
[ SpoNodeOptions []
, RelayNodeOptions []
, RelayNodeOptions []
]

data NodeLoggingFormat = NodeLoggingFormatAsJson | NodeLoggingFormatAsText deriving (Eq, Show)
Expand Down

0 comments on commit 0459379

Please sign in to comment.