Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-testnet: remove possibility to programmatically pass a custom node configuration file (it was unused) #6118

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \
cTestnetOptions = def
{ cardanoNodeEra = asbe
, cardanoNodes =
[ SpoNodeOptions Nothing []
, SpoNodeOptions Nothing []
, SpoNodeOptions Nothing []
[ SpoNodeOptions []
, SpoNodeOptions []
, SpoNodeOptions []
]
}
eraString = eraToString sbe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose
fastTestnetOptions = def
{ cardanoNodeEra = AnyShelleyBasedEra sbe
, cardanoNodes =
[ SpoNodeOptions Nothing []
, SpoNodeOptions Nothing []
, SpoNodeOptions Nothing []
[ SpoNodeOptions []
, SpoNodeOptions []
, SpoNodeOptions []
]
}
shelleyOptions = def { genesisEpochLength = 100 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ hprop_shutdownOnSlotSynced = integrationRetryWorkspace 2 "shutdown-on-slot-synce
slotLen = 0.01
let fastTestnetOptions = def
{ cardanoNodes =
[ SpoNodeOptions Nothing ["--shutdown-on-slot-synced", show maxSlot]
[ SpoNodeOptions ["--shutdown-on-slot-synced", show maxSlot]
]
}
shelleyOptions = def
Expand Down
Loading