@@ -30,11 +30,9 @@ data Cli =
30
30
| ProjectionFor FilePath ProjectionFor
31
31
32
32
data ProjectionFor =
33
- -- Node i, base port, p2p on or off.
34
- BFT Int Int Bool
35
- | Pool Int Int Bool
36
- -- Nodes indices, base port.
37
- | Explorer Int Int
33
+ -- Node i, base port.
34
+ Core Int Int
35
+ | Relay Int Int
38
36
| ChaindbServer
39
37
| Proxy
40
38
deriving Show
@@ -218,41 +216,22 @@ cliParserProjection =
218
216
<> metavar " NODENUMBER"
219
217
<> help " Base port"
220
218
)
221
- parseEnableP2P =
222
- flag False True
223
- ( long " enable-p2p"
224
- <> help " Create a P2P topology"
225
- )
226
- parseSrcIndices =
227
- option auto
228
- ( long " nodes"
229
- <> metavar " NODES"
230
- <> help " Create a non-P2P topology with nodes [0..(NODES-1)]"
231
- )
232
219
233
220
in subparser $
234
- command " bft "
221
+ command " core "
235
222
(info
236
- (BFT <$> parseNodeNumber <*> parseBasePort <*> parseEnableP2P )
237
- ( progDesc " BFT "
223
+ (Core <$> parseNodeNumber <*> parseBasePort)
224
+ ( progDesc " Core "
238
225
<> fullDesc
239
- <> header " Generate the topology file for a BFT node "
226
+ <> header " Generate the topology file for a `coreNodes` "
240
227
)
241
228
)
242
- <> command " pool "
229
+ <> command " relay "
243
230
(info
244
- (Pool <$> parseNodeNumber <*> parseBasePort <*> parseEnableP2P )
245
- ( progDesc " Pool "
231
+ (Relay <$> parseNodeNumber <*> parseBasePort)
232
+ ( progDesc " Relay "
246
233
<> fullDesc
247
- <> header " Generate the topology file for a pool node"
248
- )
249
- )
250
- <> command " explorer"
251
- (info
252
- (Explorer <$> parseSrcIndices <*> parseBasePort)
253
- ( progDesc " Explorer"
254
- <> fullDesc
255
- <> header " Generate the topology file for an explorer node"
234
+ <> header " Generate the topology file for a `relayNodes`"
256
235
)
257
236
)
258
237
<> command " chaindb-server"
@@ -333,14 +312,7 @@ writeProjectionFor topology projectionFor = do
333
312
BSL8. putStrLn $ writeProjectionFor' topology projectionFor
334
313
335
314
writeProjectionFor' :: Topo. Topology -> ProjectionFor -> BSL8. ByteString
336
- writeProjectionFor' topology (BFT i basePort p2pEnabled) = writeProjectionForProducer topology i basePort p2pEnabled
337
- writeProjectionFor' topology (Pool i basePort p2pEnabled) = writeProjectionForProducer topology i basePort p2pEnabled
338
- writeProjectionFor' _ (Explorer srcIndices basePort) = Aeson. encode $ Projection. projectionExplorer srcIndices basePort
315
+ writeProjectionFor' topology (Core i basePort) = Aeson. encode $ Projection. projectionCoreNode topology i basePort
316
+ writeProjectionFor' topology (Relay i basePort) = Aeson. encode $ Projection. projectionRelayNode topology i basePort
339
317
writeProjectionFor' topology ChaindbServer = Aeson. encode $ Projection. projectionChainDB topology
340
318
writeProjectionFor' _ Proxy = error " Nodes of kind \" proxy\" are not supported, Nix handles this case!"
341
-
342
- writeProjectionForProducer :: Topo. Topology -> Int -> Int -> Bool -> BSL8. ByteString
343
- writeProjectionForProducer topology i basePort enableP2P =
344
- if enableP2P
345
- then Aeson. encode $ Projection. projectionP2P topology i basePort
346
- else Aeson. encode $ Projection. projection topology i basePort
0 commit comments