Skip to content
Open
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
Rename chainwebVersion to networkId in config
Change-Id: Id0000000c00e85fe2a75668244b575b778f3736c
  • Loading branch information
edmundnoble committed Aug 7, 2025
commit 1fd251bb967966f96efcd3d2e2736c028b1d5a6e
14 changes: 7 additions & 7 deletions src/Chainweb/Chainweb/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) <> "]")
)
Expand Down
2 changes: 1 addition & 1 deletion src/Chainweb/Pact/Backend/Compaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
Loading