ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LedgerDB.V2.Backend

Description

Common interface for LedgerDB V2 backends

Synopsis

Backend API

class NoThunks (Resources m backend) ⇒ Backend (m ∷ Type → Type) backend blk where Source #

Operations needed to open and operate a LedgerDB V2

Associated Types

data Args (m ∷ Type → Type) backend Source #

The Arguments that will be used initially to create the Resources.

data Resources (m ∷ Type → Type) backend Source #

The Resources that will be stored in the LedgerDB environment and given to the handle operations.

data Trace backend Source #

A trace dependent on the particular backend.

Methods

mkResources ∷ Proxy blk → Tracer m LedgerDBV2Trace → Args m backend → SomeHasFS m → WithTempRegistry fState m (Resources m backend) Source #

Transform Args into Resources, with some context made up of LedgerDbArgs.

releaseResources ∷ Proxy blk → Resources m backend → m () Source #

Release the acquired resources.

createAndPopulateStateRefFromGenesis ∷ Tracer m LedgerDBV2Trace → Resources m backend → ExtLedgerState blk ValuesMK → m (StateRef m ExtLedgerState blk) Source #

Create a new handle from the given Genesis state.

openStateRefFromSnapshot ∷ Tracer m LedgerDBV2Trace → CodecConfig blk → SomeHasFS m → Resources m backend → DiskSnapshot → ExceptT (SnapshotFailure blk) m (StateRef m ExtLedgerState blk, RealPoint blk) Source #

Create a new handle from a snapshot.

snapshotManager ∷ Proxy blk → Resources m backend → CodecConfig blk → Tracer m (TraceSnapshotEvent blk) → SomeHasFS m → SnapshotManager m blk (StateRef m ExtLedgerState blk) Source #

Instantiate the SnapshotManager for this backend.

Existentials

data SomeBackendTrace where Source #

Constructors

SomeBackendTrace ∷ ∀ backend. (Show (Trace backend), Typeable backend) ⇒ Trace backend → SomeBackendTrace 

data SomeBackendArgs (m ∷ Type → Type) blk where Source #

Constructors

SomeBackendArgs ∷ ∀ (m ∷ Type → Type) backend blk. Backend m backend blk ⇒ Args m backend → SomeBackendArgs m blk 

data SomeResources (m ∷ Type → Type) blk where Source #

Constructors

SomeResources ∷ ∀ (m ∷ Type → Type) backend blk. Backend m backend blk ⇒ Resources m backend → SomeResources m blk 

Instances

Instances details
NoThunks (SomeResources m blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.Backend

Tracing