| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Generator
Contents
Synopsis
- networkId :: NetworkId
- data Dataset = Dataset {
- fundingTransaction :: Tx
- hydraNodeKeys :: [Secret (SigningKey PaymentKey)]
- clientDatasets :: [ClientDataset]
- title :: Maybe Text
- description :: Maybe Text
- data ClientDataset = ClientDataset {
- paymentKey :: Secret (SigningKey PaymentKey)
- initialUTxO :: UTxO
- txSequence :: [Tx]
- generateConstantUTxODataset :: Secret (SigningKey PaymentKey) -> Int -> Int -> Gen Dataset
- generateGrowingUTxODataset :: Secret (SigningKey PaymentKey) -> Int -> Int -> Gen Dataset
- generateMixedUTxODataset :: Secret (SigningKey PaymentKey) -> Int -> Int -> Gen Dataset
- largestVkUTxO :: VerificationKey PaymentKey -> UTxO Era -> Maybe (TxIn, TxOut CtxUTxO)
- generateLargeUTxODataset :: Secret (SigningKey PaymentKey) -> Int -> Int -> Int -> Gen Dataset
- mkSplitTx :: NetworkId -> SigningKey PaymentKey -> Int -> Coin -> (TxIn, TxOut CtxUTxO) -> Either TxBodyError Tx
- mkMergeTx :: NetworkId -> SigningKey PaymentKey -> (TxIn, TxOut CtxUTxO) -> (TxIn, TxOut CtxUTxO) -> Either TxBodyError Tx
- generateDemoUTxODataset :: NetworkId -> SocketPath -> Secret (SigningKey PaymentKey) -> Int -> Int -> IO Dataset
- withInitialUTxO :: SigningKey PaymentKey -> Tx -> UTxO
- genClientFunds :: [SigningKey PaymentKey] -> Integer -> Int -> Gen [(VerificationKey PaymentKey, Coin)]
- generateClientDataset :: NetworkId -> Tx -> Int -> SigningKey PaymentKey -> Gen ClientDataset
Documentation
A Dataset that can be run for testing purpose. Each Dataset represents
a complete scenario where several ClientDataset are run concurrently
against one or more HydraNodes. A dataset can optionally have a title and
description which will be used to report results.
Constructors
| Dataset | |
Fields
| |
Instances
data ClientDataset Source #
Constructors
| ClientDataset | |
Fields
| |
Instances
generateConstantUTxODataset Source #
Arguments
| :: Secret (SigningKey PaymentKey) | Faucet signing key |
| -> Int | Number of clients |
| -> Int | Number of transactions |
| -> Gen Dataset |
Generate a Dataset which does not grow the per-client UTXO set over time.
This version provided faucet key owns funds on the initial funds of the
devnet (See availableInitialFunds and 'genesis-shelley.json'). Then for a
given number of clients a number of transactions are generated.
generateMixedUTxODataset Source #
Arguments
| :: Secret (SigningKey PaymentKey) | Faucet signing key |
| -> Int | Number of clients |
| -> Int | Number of transactions |
| -> Gen Dataset |
Generate a Dataset that grows the head's UTxO set for the first half of
the tx sequence and contracts it again for the second half. Phase 1 reuses
the same per-tx pattern as generateGrowingUTxODataset (1-in -> 2-out via
mkSimpleTx with reduced output value). Phase 2 issues 2-in -> 1-out
merges that consume two previously created outputs and produce a single
combined output. End-state has a single UTxO again.
largestVkUTxO :: VerificationKey PaymentKey -> UTxO Era -> Maybe (TxIn, TxOut CtxUTxO) Source #
generateLargeUTxODataset Source #
Arguments
| :: Secret (SigningKey PaymentKey) | Faucet signing key |
| -> Int | Number of clients |
| -> Int | Number of transactions |
| -> Int | Target UTxO entries per client (plateau) |
| -> Gen Dataset |
Generate a Dataset that grows each client's UTxO set to a target size
("plateau") with 1-in 10-out split transactions, then holds that size with
full-value self-transfers (1-in 1-out, no change output). While the plateau
holds, every snapshot carries the accumulator cost of the full UTxO set,
making this the reference workload for large-UTxO head performance.
The head-level UTxO size is roughly clients * target and must stay below the 4095 accumulator element limit.
Arguments
| :: NetworkId | |
| -> SigningKey PaymentKey | |
| -> Int | Number of chunk outputs |
| -> Coin | Value of each chunk output |
| -> (TxIn, TxOut CtxUTxO) | |
| -> Either TxBodyError Tx |
Build a zero-fee 1-in N-out transaction that splits off nChunks outputs
of chunkValue each and returns the remainder as change. Used by the
Plateau generator to grow a client's UTxO set inside the head.
mkMergeTx :: NetworkId -> SigningKey PaymentKey -> (TxIn, TxOut CtxUTxO) -> (TxIn, TxOut CtxUTxO) -> Either TxBodyError Tx Source #
Build a zero-fee 2-in 1-out transaction that merges two of a sender's own outputs into one. Used by the Mixed generator to contract the UTxO set.
generateDemoUTxODataset Source #
Arguments
| :: NetworkId | |
| -> SocketPath | |
| -> Secret (SigningKey PaymentKey) | Faucet signing key |
| -> Int | Number of clients. |
| -> Int | Number of transactions |
| -> IO Dataset |
Generate a Dataset from an already running network by querying available
funds of the well-known 'faucet.sk' and assuming the hydra-nodes we connect
to have fuel available. Then for a given number of clients a number of
transactions are generated.
Helpers
withInitialUTxO :: SigningKey PaymentKey -> Tx -> UTxO Source #
genClientFunds :: [SigningKey PaymentKey] -> Integer -> Int -> Gen [(VerificationKey PaymentKey, Coin)] Source #
generateClientDataset :: NetworkId -> Tx -> Int -> SigningKey PaymentKey -> Gen ClientDataset Source #