Skip to content

Commit 1fd251b

Browse files
committed
Rename chainwebVersion to networkId in config
Change-Id: Id0000000c00e85fe2a75668244b575b778f3736c
1 parent dad106a commit 1fd251b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Chainweb/Chainweb/Configuration.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ validateChainwebVersion :: ConfigValidation ChainwebVersion []
552552
validateChainwebVersion v = do
553553
unless (isDevelopment || elem v knownVersions) $
554554
throwError $ T.unwords
555-
[ "Specifying version properties is only legal with chainweb-version"
556-
, "set to recap-development or development, but version is set to"
555+
[ "Specifying network properties is only legal with network-id"
556+
, "set to recap-development or development, but network is set to"
557557
, sshow (_versionName v)
558558
]
559559
where
@@ -588,7 +588,7 @@ defaultChainwebConfiguration v = ChainwebConfiguration
588588

589589
instance ToJSON ChainwebConfiguration where
590590
toJSON o = object
591-
[ "chainwebVersion" .= _versionName (_configChainwebVersion o)
591+
[ "networkId" .= _versionName (_configChainwebVersion o)
592592
, "cuts" .= _configCuts o
593593
, "mining" .= _configMining o
594594
, "p2p" .= _configP2p o
@@ -607,7 +607,7 @@ instance FromJSON ChainwebConfiguration where
607607

608608
instance FromJSON (ChainwebConfiguration -> ChainwebConfiguration) where
609609
parseJSON = withObject "ChainwebConfiguration" $ \o -> id
610-
<$< setProperty configChainwebVersion "chainwebVersion"
610+
<$< setProperty configChainwebVersion "networkId"
611611
(findKnownVersion <=< parseJSON) o
612612
<*< configCuts %.: "cuts" % o
613613
<*< configMining %.: "mining" % o
@@ -652,9 +652,9 @@ parseVersion :: MParser ChainwebVersion
652652
parseVersion = constructVersion
653653
<$> optional
654654
(option (findKnownVersion =<< textReader)
655-
% long "chainweb-version"
656-
<> short 'v'
657-
<> help "the chainweb version that this node is using"
655+
% long "network-id"
656+
<> short 'n'
657+
<> help "the network that this node will communicate with"
658658
<> metavar (T.unpack $
659659
"[" <> T.intercalate "," (getChainwebVersionName . _versionName <$> knownVersions) <> "]")
660660
)

src/Chainweb/Pact/Backend/Compaction.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ getConfig = do
179179

180180
parser :: O.Parser Config
181181
parser = Config
182-
<$> (parseVersion <$> O.strOption (O.long "chainweb-version" <> O.value "mainnet01"))
182+
<$> (parseVersion <$> O.strOption (O.long "network-id" <> O.value "mainnet01"))
183183
<*> 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}")
184184
<*> 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.")
185185
<*> O.flag SingleChain ManyChainsAtOnce (O.long "parallel" <> O.help "Turn on multi-threaded compaction. The threads are per-chain.")

0 commit comments

Comments
 (0)