From 1fd251bb967966f96efcd3d2e2736c028b1d5a6e Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Thu, 31 Jul 2025 11:48:14 -0400 Subject: [PATCH] Rename chainwebVersion to networkId in config Change-Id: Id0000000c00e85fe2a75668244b575b778f3736c --- src/Chainweb/Chainweb/Configuration.hs | 14 +++++++------- src/Chainweb/Pact/Backend/Compaction.hs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Chainweb/Chainweb/Configuration.hs b/src/Chainweb/Chainweb/Configuration.hs index 3d0d47ffe7..3a0e10d8d1 100644 --- a/src/Chainweb/Chainweb/Configuration.hs +++ b/src/Chainweb/Chainweb/Configuration.hs @@ -552,8 +552,8 @@ validateChainwebVersion :: ConfigValidation ChainwebVersion [] validateChainwebVersion v = do unless (isDevelopment || elem v knownVersions) $ throwError $ T.unwords - [ "Specifying version properties is only legal with chainweb-version" - , "set to recap-development or development, but version is set to" + [ "Specifying network properties is only legal with network-id" + , "set to recap-development or development, but network is set to" , sshow (_versionName v) ] where @@ -588,7 +588,7 @@ defaultChainwebConfiguration v = ChainwebConfiguration instance ToJSON ChainwebConfiguration where toJSON o = object - [ "chainwebVersion" .= _versionName (_configChainwebVersion o) + [ "networkId" .= _versionName (_configChainwebVersion o) , "cuts" .= _configCuts o , "mining" .= _configMining o , "p2p" .= _configP2p o @@ -607,7 +607,7 @@ instance FromJSON ChainwebConfiguration where instance FromJSON (ChainwebConfiguration -> ChainwebConfiguration) where parseJSON = withObject "ChainwebConfiguration" $ \o -> id - <$< setProperty configChainwebVersion "chainwebVersion" + <$< setProperty configChainwebVersion "networkId" (findKnownVersion <=< parseJSON) o <*< configCuts %.: "cuts" % o <*< configMining %.: "mining" % o @@ -652,9 +652,9 @@ parseVersion :: MParser ChainwebVersion parseVersion = constructVersion <$> optional (option (findKnownVersion =<< textReader) - % long "chainweb-version" - <> short 'v' - <> help "the chainweb version that this node is using" + % long "network-id" + <> short 'n' + <> help "the network that this node will communicate with" <> metavar (T.unpack $ "[" <> T.intercalate "," (getChainwebVersionName . _versionName <$> knownVersions) <> "]") ) diff --git a/src/Chainweb/Pact/Backend/Compaction.hs b/src/Chainweb/Pact/Backend/Compaction.hs index 57009349be..8e0f972e9a 100644 --- a/src/Chainweb/Pact/Backend/Compaction.hs +++ b/src/Chainweb/Pact/Backend/Compaction.hs @@ -179,7 +179,7 @@ getConfig = do parser :: O.Parser Config parser = Config - <$> (parseVersion <$> O.strOption (O.long "chainweb-version" <> O.value "mainnet01")) + <$> (parseVersion <$> O.strOption (O.long "network-id" <> O.value "mainnet01")) <*> O.strOption (O.long "from" <> O.help "Directory containing SQLite Pact state and RocksDB block data to compact (expected to be in $DIR/0/{sqlite,rocksDb}") <*> O.strOption (O.long "to" <> O.help "Directory where to place the compacted Pact state and block data. It will place them in $DIR/0/{sqlite,rocksDb}, respectively.") <*> O.flag SingleChain ManyChainsAtOnce (O.long "parallel" <> O.help "Turn on multi-threaded compaction. The threads are per-chain.")