Skip to content

Commit a09a2e3

Browse files
authored
Merge pull request #6284 from IntersectMBO/coot/peer-sharing-fix
PeerSharing option
2 parents b11617e + 01c7c22 commit a09a2e3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

cardano-node/src/Cardano/Node/Configuration/POM.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,7 @@ makeNodeConfiguration pnc = do
806806
let ncPeerSharing =
807807
case pncPeerSharing pnc of
808808
Last Nothing ->
809-
if not startAsNonProducingNode
810-
|| hasProtocolFile protocolFiles
809+
if hasProtocolFile protocolFiles
811810
then PeerSharingDisabled
812811
else PeerSharingEnabled
813812
Last (Just peerSharing) -> peerSharing

cardano-node/src/Cardano/Node/Parsers.hs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ nodeRunParser = do
6767
shelleyVRFFile <- optional parseVrfKeyFilePath
6868
shelleyCertFile <- optional parseOperationalCertFilePath
6969
shelleyBulkCredsFile <- optional parseBulkCredsFilePath
70-
startAsNonProducingNode <- Last <$> parseStartAsNonProducingNode
70+
startAsNonProducingNode <- (\depr new -> Last depr <> Last new)
71+
<$> parseStartAsNonProducingNodeDeprecated
72+
<*> parseStartAsNonProducingNode
7173

7274
-- Node Address
7375
nIPv4Address <- lastOption parseHostIPv4Addr
@@ -394,19 +396,31 @@ parseVrfKeyFilePath =
394396
<> completer (bashCompleter "file")
395397
)
396398

399+
parseStartAsNonProducingNodeDeprecated :: Parser (Maybe Bool)
400+
parseStartAsNonProducingNodeDeprecated =
401+
flag Nothing (Just True) $ mconcat
402+
[ long "non-producing-node"
403+
, help $ mconcat
404+
[ "DEPRECATED, use --start-as-non-producing-node instead. "
405+
, "This option will be removed in one of the future versions of cardano-node."
406+
]
407+
, hidden
408+
]
409+
397410
-- | A parser which returns `Nothing` or `Just True`; the default value is set
398411
-- in `defaultPartialNodeConfiguration`. This allows to set this option either
399412
-- in the configuration file or as command line flag.
400413
parseStartAsNonProducingNode :: Parser (Maybe Bool)
401414
parseStartAsNonProducingNode =
402415
flag Nothing (Just True) $ mconcat
403-
[ long "non-producing-node"
416+
[ long "start-as-non-producing-node"
404417
, help $ mconcat
405418
[ "Start the node as a non block producing node even if "
406419
, "credentials are specified."
407420
]
408421
]
409422

423+
410424
-- | Produce just the brief help header for a given CLI option parser,
411425
-- without the options.
412426
parserHelpHeader :: String -> Opt.Parser a -> OptI.Doc

0 commit comments

Comments
 (0)