Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a library interface for initiating a local testnet
Synopsis
- cardanoTestnet :: CardanoTestnetOptions -> Conf -> UTCTime -> ShelleyGenesis StandardCrypto -> AlonzoGenesis -> ConwayGenesis StandardCrypto -> Integration TestnetRuntime
- cardanoTestnetDefault :: CardanoTestnetOptions -> Conf -> Integration TestnetRuntime
- data CardanoTestnetOptions = CardanoTestnetOptions {}
- data TestnetNodeOptions = SpoTestnetNodeOptions (Maybe NodeConfigurationYaml) [String]
- cardanoDefaultTestnetOptions :: CardanoTestnetOptions
- cardanoDefaultTestnetNodeOptions :: [TestnetNodeOptions]
- newtype Conf = Conf {}
- newtype TmpAbsolutePath = TmpAbsolutePath {}
- newtype NodeConfigurationYaml = NodeConfigurationYaml {}
- mkConf :: (HasCallStack, MonadTest m) => FilePath -> m Conf
- makeLogDir :: TmpAbsolutePath -> FilePath
- makeSocketDir :: TmpAbsolutePath -> FilePath
- makeTmpBaseAbsPath :: TmpAbsolutePath -> FilePath
- procChairman :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [String] -> m CreateProcess
- integration :: HasCallStack => Integration () -> Property
- waitUntilEpoch :: (MonadCatch m, MonadIO m, MonadTest m, HasCallStack) => FilePath -> Int -> ExecConfig -> EpochNo -> m EpochNo
- data NodeRuntime = NodeRuntime {}
- allNodes :: TestnetRuntime -> [NodeRuntime]
Testnets
Start a testnet
:: CardanoTestnetOptions | The options to use. Must be consistent with the genesis files. |
-> Conf | |
-> UTCTime | The starting time. Must be the same as the one in the shelley genesis. |
-> ShelleyGenesis StandardCrypto | The shelley genesis to use, for example |
-> AlonzoGenesis | The alonzo genesis to use, for example |
-> ConwayGenesis StandardCrypto | The conway genesis to use, for example |
-> Integration TestnetRuntime |
Setup a number of credentials and pools, like this:
├── byron │ └── genesis.json ├── byron-gen-command │ └── genesis-keys.00{0,1,2}.key ├── byron.genesis.spec.json ├── configuration.yaml ├── current-stake-pools.json ├── delegate-keys │ ├── delegate{1,2,3} │ │ ├── kes.{skey,vkey} │ │ ├── key.{skey,vkey} │ │ ├── opcert.{cert,counter} │ │ └── vrf.{skey,vkey} │ └── README.md ├── drep-keys │ └── drep{1,2,3} │ └── drep.{skey,vkey} ├── genesis.{alonzo,conway}.spec.json ├── genesis-keys │ ├── genesis{1,2,3} │ │ └── key.{skey,vkey} │ └── README.md ├── logs │ └── pool3 │ └── {stderr,stdout}.log ├── module ├── pools-keys │ ├── pool{1,2,3} │ │ ├── byron-delegate.key │ │ ├── byron-delegation.cert │ │ ├── cold.{skey,vkey} │ │ ├── kes.{skey,vkey} │ │ ├── opcert.{cert,counter} │ │ ├── staking-reward.{skey,vkey} │ │ ├── topology.json │ │ └── vrf.{skey,vkey} │ └── README.md ├── shelley │ └── genesis.{alonzo,conway,shelley}.json ├── socket │ └── pool{1,2,3} │ └── sock ├── stake-delegators │ └── delegator{1,2,3} │ ├── payment.{skey,vkey} │ └── staking.{skey,vkey} └─── utxo-keys ├── README.md └── utxo{1,2,3} └── utxo.{addr,skey,vkey}
cardanoTestnetDefault :: CardanoTestnetOptions -> Conf -> Integration TestnetRuntime Source #
Like cardanoTestnet
, but using defaults for all configuration files.
See cardanoTestnet
for additional documentation.
Testnet options
data CardanoTestnetOptions Source #
CardanoTestnetOptions | |
|
Instances
Show CardanoTestnetOptions Source # | |
Defined in Testnet.Start.Types | |
Eq CardanoTestnetOptions Source # | |
Defined in Testnet.Start.Types |
data TestnetNodeOptions Source #
Specify a BFT node (Pre-Babbage era only) or an SPO (Shelley era onwards only)
SpoTestnetNodeOptions (Maybe NodeConfigurationYaml) [String] | These arguments will be appended to the default set of CLI options when starting the node. |
Instances
Show TestnetNodeOptions Source # | |
Defined in Testnet.Start.Types | |
Eq TestnetNodeOptions Source # | |
Defined in Testnet.Start.Types (==) :: TestnetNodeOptions -> TestnetNodeOptions -> Bool Source # (/=) :: TestnetNodeOptions -> TestnetNodeOptions -> Bool Source # |
Configuration
newtype TmpAbsolutePath Source #
Instances
IsString TmpAbsolutePath Source # | |
Defined in Testnet.Filepath fromString :: String -> TmpAbsolutePath Source # | |
Show TmpAbsolutePath Source # | |
Defined in Testnet.Filepath | |
Eq TmpAbsolutePath Source # | |
Defined in Testnet.Filepath (==) :: TmpAbsolutePath -> TmpAbsolutePath -> Bool Source # (/=) :: TmpAbsolutePath -> TmpAbsolutePath -> Bool Source # |
newtype NodeConfigurationYaml Source #
Instances
Show NodeConfigurationYaml Source # | |
Defined in Testnet.Start.Types | |
Eq NodeConfigurationYaml Source # | |
Defined in Testnet.Start.Types |
mkConf :: (HasCallStack, MonadTest m) => FilePath -> m Conf Source #
Create a Conf
from a temporary absolute path. Logs the argument in the test.
makeLogDir :: TmpAbsolutePath -> FilePath Source #
Processes
:: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) | |
=> [String] | Arguments to the CLI command |
-> m CreateProcess | Captured stdout |
Create a CreateProcess
describing how to start the cardano-node-chairman process
and an argument list.
Utils
integration :: HasCallStack => Integration () -> Property Source #
:: (MonadCatch m, MonadIO m, MonadTest m, HasCallStack) | |
=> FilePath | Output file |
-> Int | Testnet magic |
-> ExecConfig | |
-> EpochNo | Desired epoch |
-> m EpochNo |
Submit the desired epoch to wait to.
Runtime
data NodeRuntime Source #
allNodes :: TestnetRuntime -> [NodeRuntime] Source #