Skip to content

Commit f147a2c

Browse files
committed
upd testnet integration
1 parent 9b89537 commit f147a2c

6 files changed

Lines changed: 14 additions & 7 deletions

File tree

cardano-testnet/src/Cardano/Testnet.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Cardano.Testnet (
1111

1212
-- ** Testnet options
1313
CardanoTestnetOptions(..),
14+
RpcSupport(..),
1415
NodeOption(..),
1516
cardanoDefaultTestnetNodeOptions,
1617
getDefaultAlonzoGenesis,

cardano-testnet/src/Parsers/Cardano.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pCardanoTestnetCliOptions = CardanoTestnetOptions
8383
<> OA.help "Directory where to store files, sockets, and so on. It is created if it doesn't exist. If unset, a temporary directory is used."
8484
<> OA.metavar "DIRECTORY"
8585
)))
86-
<*> OA.switch
86+
<*> OA.flag RpcDisabled RpcEnabled
8787
( OA.long "enable-grpc"
8888
<> OA.help "[EXPERIMENTAL] Enable gRPC endpoint on all of testnet nodes. The listening socket file will be the same directory as node's N2C socket."
8989
<> OA.showDefault

cardano-testnet/src/Testnet/Start/Cardano.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ cardanoTestnet
347347
]
348348
<> spoNodeCliArgs
349349
<> extraCliArgs nodeOptions
350-
<> ["--grpc-enable" | cardanoEnableRpc]
350+
<> ["--grpc-enable" | RpcEnabled <- [cardanoEnableRpc]]
351351
pure $ eRuntime <&> \rt -> rt{poolKeys=mKeys}
352352

353353
let (failedNodes, testnetNodes') = partitionEithers (NEL.toList eTestnetNodes)

cardano-testnet/src/Testnet/Start/Types.hs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Testnet.Start.Types
1616
, NumPools(..)
1717
, NumRelays(..)
1818
, TxGeneratorSupport(..)
19+
, RpcSupport(..)
1920
, cardanoNumPools
2021
, cardanoNumRelays
2122

@@ -175,6 +176,11 @@ data TxGeneratorSupport
175176
| GenerateTemplateConfigForTxGenerator
176177
deriving (Eq, Show)
177178

179+
data RpcSupport
180+
= RpcDisabled
181+
| RpcEnabled
182+
deriving (Eq, Show)
183+
178184
-- | Options which, contrary to 'GenesisOptions' are not implemented
179185
-- by tuning the genesis files.
180186
data CardanoTestnetOptions = CardanoTestnetOptions
@@ -188,8 +194,8 @@ data CardanoTestnetOptions = CardanoTestnetOptions
188194
, cardanoEnableNewEpochStateLogging :: Bool -- ^ if epoch state logging is enabled
189195
, cardanoEnableTxGenerator :: TxGeneratorSupport -- ^ Options regarding support for the tx-generator on the testnet (config generation, execution, etc.)
190196
, cardanoOutputDir :: UserProvidedEnv -- ^ The output directory where to store files, sockets, and so on. If unset, a temporary directory is used.
191-
, cardanoEnableRpc :: Bool
192-
-- ^ True to enable gRPC endpoints in all testnet nodes
197+
, cardanoEnableRpc :: RpcSupport
198+
-- ^ Whether to enable gRPC endpoints in all testnet nodes
193199
} deriving (Eq, Show)
194200

195201
-- | Path to the configuration file of the node, specified by the user
@@ -226,7 +232,7 @@ instance Default CardanoTestnetOptions where
226232
, cardanoEnableNewEpochStateLogging = True
227233
, cardanoEnableTxGenerator = NoTxGeneratorSupport
228234
, cardanoOutputDir = def
229-
, cardanoEnableRpc = False
235+
, cardanoEnableRpc = RpcDisabled
230236
}
231237

232238
-- | Options that are implemented by writing fields in the Shelley genesis file.

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Query.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ hprop_rpc_query_pparams = integrationRetryWorkspace 2 "rpc-query-pparams" $ \tem
5454
let ceo = ConwayEraOnwardsConway
5555
sbe = convert ceo
5656
eraName = eraToString sbe
57-
options = def{cardanoNodeEra = AnyShelleyBasedEra sbe, cardanoEnableRpc = True}
57+
options = def{cardanoNodeEra = AnyShelleyBasedEra sbe, cardanoEnableRpc = RpcEnabled}
5858

5959
TestnetRuntime
6060
{ testnetMagic

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Transaction.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ hprop_rpc_transaction = integrationRetryWorkspace 2 "rpc-tx" $ \tempAbsBasePath'
5050
let (ceo, eraProxy) =
5151
(conwayBasedEra, asType) :: era ~ ConwayEra => (ConwayEraOnwards era, AsType era)
5252
sbe = convert ceo
53-
options = def{cardanoNodeEra = AnyShelleyBasedEra sbe, cardanoEnableRpc = True}
53+
options = def{cardanoNodeEra = AnyShelleyBasedEra sbe, cardanoEnableRpc = RpcEnabled}
5454
addrInEra = AsAddressInEra eraProxy
5555

5656
TestnetRuntime

0 commit comments

Comments
 (0)