hydra-cluster
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cluster.Faucet

Synopsis

Documentation

data FaucetLog Source #

Instances

Instances details
ToJSON FaucetLog Source # 
Instance details

Defined in Hydra.Cluster.Faucet

Methods

toJSON :: FaucetLog -> Value

toEncoding :: FaucetLog -> Encoding

toJSONList :: [FaucetLog] -> Value

toEncodingList :: [FaucetLog] -> Encoding

omitField :: FaucetLog -> Bool

Generic FaucetLog Source # 
Instance details

Defined in Hydra.Cluster.Faucet

Associated Types

type Rep FaucetLog :: Type -> Type Source #

Show FaucetLog Source # 
Instance details

Defined in Hydra.Cluster.Faucet

Eq FaucetLog Source # 
Instance details

Defined in Hydra.Cluster.Faucet

type Rep FaucetLog Source # 
Instance details

Defined in Hydra.Cluster.Faucet

type Rep FaucetLog = D1 ('MetaData "FaucetLog" "Hydra.Cluster.Faucet" "hydra-cluster-2.4.1-KTTTdFwQ72KxrBTu4GCNh" 'False) (C1 ('MetaCons "TraceResourceExhaustedHandled" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "ReturnedFunds" 'PrefixI 'True) (S1 ('MetaSel ('Just "returnAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin)) :+: C1 ('MetaCons "SubmitTxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

delayBF :: MonadDelay m => ChainBackendOptions -> m () Source #

seedFromFaucet Source #

Arguments

:: ChainBackendOptions 
-> VerificationKey PaymentKey

Recipient of the funds

-> Value

Value to get from faucet

-> Tracer IO FaucetLog 
-> IO UTxO 

seedFromFaucetWithMinting Source #

Arguments

:: ChainBackendOptions 
-> VerificationKey PaymentKey

Recipient of the funds

-> Value

Value to get from faucet

-> Tracer IO FaucetLog 
-> Maybe PlutusScript 
-> IO UTxO 

Create a specially marked "seed" UTXO containing requested Value by redeeming funds available to the well-known faucet.

seedManyFromFaucet Source #

Arguments

:: ChainBackendOptions 
-> [(VerificationKey PaymentKey, Value)]

Recipients of the funds and the value each is to receive.

-> Tracer IO FaucetLog 
-> IO [UTxO]

The seeded UTxO of each recipient, in the order given.

Like seedFromFaucet but pays every recipient from a single faucet transaction. A scenario needing more than one funded key then waits for one confirmation instead of one per key, which is a block time each on a public network.

seedManyFromFaucetWithMinting Source #

Arguments

:: ChainBackendOptions 
-> [(VerificationKey PaymentKey, Value)]

Recipients of the funds and the value each is to receive.

-> Tracer IO FaucetLog 
-> Maybe PlutusScript 
-> IO [UTxO]

The seeded UTxO of each recipient, in the order given.

findFaucetUTxO :: NetworkId -> ChainBackendOptions -> Coin -> IO UTxO Source #

seedFromFaucetBlockfrost Source #

Arguments

:: VerificationKey PaymentKey

Recipient of the funds

-> Coin

Amount to get from faucet

-> BlockfrostClientT IO UTxO 

findUTxO :: MonadIO m => UTxO Era -> Lovelace -> m (UTxO Era) Source #

Select entries covering the given amount, largest first, and sweep up to sweepLimit of the smallest remaining entries into the selection. Both parts keep the faucet usable across runs: outputs smaller than a requested amount (e.g. what returnFundsToFaucet pays back) would otherwise never be spent again, while the change output alone shrinks with every seeding.

sweepLimit :: Int Source #

Cap on the extra entries findUTxO sweeps into a transaction, bounding its size. Consolidation only has to outpace the one or two outputs a scenario returns to the faucet per run.

seedFromFaucet_ Source #

Arguments

:: ChainBackendOptions 
-> VerificationKey PaymentKey

Recipient of the funds

-> Coin

Amount to get from faucet

-> Tracer IO FaucetLog 
-> IO () 

Like seedFromFaucet, but without returning the seeded UTxO.

returnFundsToFaucet :: Tracer IO FaucetLog -> ChainBackendOptions -> Actor -> IO () Source #

Return the remaining funds to the faucet

returnFundsToFaucet' :: Tracer IO FaucetLog -> ChainBackendOptions -> Secret (SigningKey PaymentKey) -> IO Coin Source #

createOutputAtAddress :: NetworkId -> ChainBackendOptions -> AddressInEra -> TxOutDatum CtxTx -> Value -> IO (TxIn, TxOut CtxUTxO) Source #

retryOnExceptions :: (MonadCatch m, MonadDelay m) => Tracer m FaucetLog -> ChainBackendOptions -> m a -> m a Source #

Try to submit tx and retry when some caught exception/s take place.

publishHydraScriptsAs :: ChainBackendOptions -> Actor -> IO [TxId] Source #

Publish current Hydra scripts as scripts outputs for later referencing them.

The key of the given Actor is used to pay for fees in required transactions, it is expected to have sufficient funds.

publishOrReuseHydraScripts :: ChainBackendOptions -> Actor -> FilePath -> IO [TxId] Source #

Like publishHydraScriptsAs, but caches the resulting TxIds to a file in the given directory. On subsequent calls, the cached TxIds are validated against the chain (using queryScriptRegistry) and reused if still valid. This avoids re-publishing identical scripts on every test run, saving funds and time especially on public testnets.