tx-generator-2.11: A transaction workload generator for Cardano clusters
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Benchmarking.Script.Types

Description

Action is likely the most impactful type exported, as it represents the individual steps to be executed by the transaction generator at the system level; however, Generator is much more of what one thinks of transactions themselves being. The Generator has to do with combining streams of the transactions one typically might think of doing with a wallet, where the Action level largely sees those transactions as interchangeable, and focuses more on the variety of things one might do with the connexion.

Synopsis

Documentation

data Action where Source #

Action represents the individual actions to be executed by the tx-generator. It gets translated to ActionM using Env as the state, IOManager as the reader, and IO as the monad, and further wrapped in an ExceptT with an Error as the exception.

Constructors

SetNetworkId :: !NetworkId -> Action

SetNetworkId only entails changing a state variable in an Env.

SetSocketPath :: !FilePath -> Action

SetSocketPath likewise only entails a state variable change.

InitWallet :: !String -> Action

InitWallet just uses the name in a state variable and creates a fresh MVar with an empty FundQueue in it.

StartProtocol :: !FilePath -> !(Maybe FilePath) -> Action

StartProtocol sets state variables for protocol and genesis, but via mkNodeConfig and mkConsensusProtocol. The first unravels to reading wide a variety of config files in makeNodeConfiguration and The second unravels to reading genesis content in helper functions spread across eras.

Delay :: !Double -> Action

Delay translates to threadDelay via delay.

ReadSigningKey :: !String -> !(SigningKeyFile In) -> Action

ReadSigningKey translates to a readFileTextEnvelopeAnyOf from Cardano.Api.SerialiseTextEnvelope on the signing key file and then drops it into a state variable via setEnvKeys.

DefineSigningKey :: !String -> !(SigningKey PaymentKey) -> Action

DefineSigningKey is just a insert on the state variable.

AddFund :: !AnyCardanoEra -> !String -> !TxIn -> !Lovelace -> !String -> Action

AddFund is mostly a wrapper around walletRefInsertFund which in turn is just modifyMVar around insert.

WaitBenchmark :: !String -> Action

WaitBenchmark signifies a waitCatch on the AsyncBenchmarkControl associated with the ID and also folds tracers into the completion.

Submit :: !AnyCardanoEra -> !SubmitMode -> !TxGenTxParams -> !Generator -> Action

Submit mostly wraps benchmarkTxStream which in turn wraps walletBenchmark which in turn wraps txSubmissionClient and functions local to that like requestTxs.

CancelBenchmark :: !String -> Action

CancelBenchmark wraps a callback from the AsyncBenchmarkControl type, which is a shutdown action.

Reserved :: [String] -> Action

Reserved just emits an error and is a placeholder that helps with testing and quick fixes.

WaitForEra :: !AnyCardanoEra -> Action 
SetProtocolParameters :: ProtocolParametersSource -> Action

SetProtocolParameters has one option to read from a file and another to pass directly and just sets a state variable for the protoParams field of Env.

LogMsg :: !Text -> Action

LogMsg logs its message calling traceDebug i.e. via the tracer.

Instances

Instances details
FromJSON Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Methods

toJSON :: Action -> Value #

toEncoding :: Action -> Encoding #

toJSONList :: [Action] -> Value #

toEncodingList :: [Action] -> Encoding #

omitField :: Action -> Bool #

Generic Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep Action :: Type -> Type Source #

Show Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep Action Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep Action = D1 ('MetaData "Action" "Cardano.Benchmarking.Script.Types" "tx-generator-2.11-inplace" 'False) (((C1 ('MetaCons "SetNetworkId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NetworkId)) :+: (C1 ('MetaCons "SetSocketPath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath)) :+: C1 ('MetaCons "InitWallet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))) :+: ((C1 ('MetaCons "StartProtocol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe FilePath))) :+: C1 ('MetaCons "Delay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) :+: (C1 ('MetaCons "ReadSigningKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SigningKeyFile 'In))) :+: C1 ('MetaCons "DefineSigningKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SigningKey PaymentKey)))))) :+: (((C1 ('MetaCons "AddFund" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AnyCardanoEra) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxIn) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Lovelace) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))) :+: C1 ('MetaCons "WaitBenchmark" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))) :+: (C1 ('MetaCons "Submit" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AnyCardanoEra) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SubmitMode)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxGenTxParams) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Generator))) :+: C1 ('MetaCons "CancelBenchmark" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))) :+: ((C1 ('MetaCons "Reserved" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])) :+: C1 ('MetaCons "WaitForEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AnyCardanoEra))) :+: (C1 ('MetaCons "SetProtocolParameters" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProtocolParametersSource)) :+: C1 ('MetaCons "LogMsg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))))))

data Generator where Source #

Generator is interpreted by evalGenerator as a series of transactions, albeit in the form of precursors to UTxO's.

Constructors

SecureGenesis :: !String -> !String -> !String -> Generator

SecureGenesis gets funds from a genesis via genesisSecureInitialFundForKey. This is where streams of transactions start.

Split :: !String -> !PayMode -> !PayMode -> [Lovelace] -> Generator

Split makes payments with change depending on the pay mode. The splitting is from potentially sending the change to a different place.

SplitN :: !String -> !PayMode -> !Int -> Generator

SplitN divides the funds by N and divides them up into that many transactions in a finite sequence. The handling starts from a case in evalGenerator and has some complexity to it.

NtoM :: !String -> !PayMode -> !NumberOfInputsPerTx -> !NumberOfOutputsPerTx -> !(Maybe Int) -> Maybe String -> Generator 
Sequence :: [Generator] -> Generator

Sequence represents sequentially issuing a series in the form of a list of transaction series represented by Generator itself, but the nesting is done by first translating to ActionM, then a difficult-to-understand part follows in the form of for around each gList and is hard to interpret.

Cycle :: !Generator -> Generator

Cycle infinitely repeats the series of transactions in its argument, through evalGenerator as per cycle.

Take :: !Int -> !Generator -> Generator

Take is easily interpreted via take.

RoundRobin :: [Generator] -> Generator

RoundRobin wants interleaves but just errors out unimplemented.

OneOf :: [(Generator, Double)] -> Generator 

Instances

Instances details
FromJSON Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Generic Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep Generator :: Type -> Type Source #

Show Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep Generator Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep Generator = D1 ('MetaData "Generator" "Cardano.Benchmarking.Script.Types" "tx-generator-2.11-inplace" 'False) (((C1 ('MetaCons "SecureGenesis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))) :+: C1 ('MetaCons "Split" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PayMode)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PayMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Lovelace])))) :+: (C1 ('MetaCons "SplitN" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PayMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :+: C1 ('MetaCons "NtoM" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PayMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NumberOfInputsPerTx))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NumberOfOutputsPerTx) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))))))) :+: ((C1 ('MetaCons "Sequence" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Generator])) :+: C1 ('MetaCons "Cycle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Generator))) :+: (C1 ('MetaCons "Take" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Generator)) :+: (C1 ('MetaCons "RoundRobin" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Generator])) :+: C1 ('MetaCons "OneOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Generator, Double)]))))))

data PayMode where Source #

Constructors

PayToAddr :: !String -> !String -> PayMode 
PayToScript :: !ScriptSpec -> !String -> PayMode 

Instances

Instances details
FromJSON PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Methods

toJSON :: PayMode -> Value #

toEncoding :: PayMode -> Encoding #

toJSONList :: [PayMode] -> Value #

toEncodingList :: [PayMode] -> Encoding #

omitField :: PayMode -> Bool #

Generic PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep PayMode :: Type -> Type Source #

Show PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep PayMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

data ProtocolParametersSource where Source #

Instances

Instances details
FromJSON ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Generic ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep ProtocolParametersSource :: Type -> Type Source #

Show ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep ProtocolParametersSource Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep ProtocolParametersSource = D1 ('MetaData "ProtocolParametersSource" "Cardano.Benchmarking.Script.Types" "tx-generator-2.11-inplace" 'False) (C1 ('MetaCons "QueryLocalNode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UseLocalProtocolFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath)))

data ScriptBudget where Source #

Instances

Instances details
FromJSON ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Generic ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep ScriptBudget :: Type -> Type Source #

Show ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep ScriptBudget Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

data ScriptSpec Source #

Instances

Instances details
FromJSON ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Generic ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep ScriptSpec :: Type -> Type Source #

Show ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep ScriptSpec Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep ScriptSpec = D1 ('MetaData "ScriptSpec" "Cardano.Benchmarking.Script.Types" "tx-generator-2.11-inplace" 'False) (C1 ('MetaCons "ScriptSpec" 'PrefixI 'True) (S1 ('MetaSel ('Just "scriptSpecFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Either String FilePath)) :*: (S1 ('MetaSel ('Just "scriptSpecBudget") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptBudget) :*: S1 ('MetaSel ('Just "scriptSpecPlutusType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxGenPlutusType))))

data SubmitMode where Source #

Instances

Instances details
FromJSON SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

ToJSON SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Aeson

Generic SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Associated Types

type Rep SubmitMode :: Type -> Type Source #

Show SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

Eq SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

type Rep SubmitMode Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Types

newtype TxList era Source #

Constructors

TxList [Tx era] 

Orphan instances