marlowe-runtime-0.0.5: Runtime system for running Marlowe financial contracts on the Cardano Computation Layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Marlowe.Runtime.Indexer.Store

Synopsis

Documentation

data StoreSelector f where Source #

Constructors

Save :: StoreSelector SaveField 

data SaveField Source #

Constructors

RollbackPoint ChainPoint 
Stats ChangesStatistics 
LocalTip ChainPoint 
RemoteTip ChainPoint 
InvalidCreateTxs (Map ContractId ExtractCreationError) 
InvalidApplyInputsTxs (Map TxId ExtractMarloweTransactionError) 

store :: (MonadUnliftIO m, MonadInjectEvent r StoreSelector s m, WithLog env Message m) => Component m (StoreDependencies r m) () Source #

The store component aggregates changes into batches in one thread, and pulls batches to save in another.

aggregator :: (MonadUnliftIO m, WithLog env Message m) => Component m (STM (ChainEvent r)) (STM (Changes r)) Source #

The aggregator component pulls chain events and accumulates a batch of changes to persist.

persister :: (MonadUnliftIO m, MonadInjectEvent r StoreSelector s m, WithLog env Message m) => Component m (PersisterDependencies r m) () Source #

A component to save batches of changes to the database.

data Changes r Source #

Constructors

Changes 

Fields

Instances

Instances details
Monoid (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Semigroup (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Methods

(<>) :: Changes r -> Changes r -> Changes r Source #

sconcat :: NonEmpty (Changes r) -> Changes r Source #

stimes :: Integral b => b -> Changes r -> Changes r Source #

Generic (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Associated Types

type Rep (Changes r) :: Type -> Type Source #

Methods

from :: Changes r -> Rep (Changes r) x Source #

to :: Rep (Changes r) x -> Changes r Source #

Show r => Show (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Eq r => Eq (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Methods

(==) :: Changes r -> Changes r -> Bool Source #

(/=) :: Changes r -> Changes r -> Bool Source #

type Rep (Changes r) Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

type Rep (Changes r) = D1 ('MetaData "Changes" "Language.Marlowe.Runtime.Indexer.Store" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "Changes" 'PrefixI 'True) (((S1 ('MetaSel ('Just "rollbackTo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ChainPoint)) :*: S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [MarloweBlock])) :*: (S1 ('MetaSel ('Just "statistics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChangesStatistics) :*: S1 ('MetaSel ('Just "localTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ChainPoint)))) :*: ((S1 ('MetaSel ('Just "remoteTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ChainPoint)) :*: S1 ('MetaSel ('Just "invalidCreateTxs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map ContractId ExtractCreationError))) :*: (S1 ('MetaSel ('Just "invalidApplyInputsTxs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map TxId ExtractMarloweTransactionError)) :*: S1 ('MetaSel ('Just "events") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [r])))))

applyRollback :: ChainPoint -> Changes r -> Changes r Source #

data ChangesStatistics Source #

Instances

Instances details
ToJSON ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Monoid ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Semigroup ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Generic ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Associated Types

type Rep ChangesStatistics :: Type -> Type Source #

Show ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

Eq ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

type Rep ChangesStatistics Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Store

type Rep ChangesStatistics = D1 ('MetaData "ChangesStatistics" "Language.Marlowe.Runtime.Indexer.Store" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "ChangesStatistics" 'PrefixI 'True) ((S1 ('MetaSel ('Just "blockCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "createTxCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "applyInputsTxCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "withdrawTxCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))