Safe Haskell | None |
---|---|
Language | Haskell2010 |
Queries from local clients to the node.
Synopsis
- data QueryInMode mode result where
- QueryCurrentEra ∷ ConsensusModeIsMultiEra mode → QueryInMode mode AnyBccEra
- QueryInEra ∷ EraInMode era mode → QueryInEra era result → QueryInMode mode (Either EraMismatch result)
- QueryEraHistory ∷ ConsensusModeIsMultiEra mode → QueryInMode mode (EraHistory mode)
- QuerySystemStart ∷ QueryInMode mode SystemStart
- data QueryInEra era result where
- QueryColeUpdateState ∷ QueryInEra ColeEra ColeUpdateState
- QueryInSophieBasedEra ∷ SophieBasedEra era → QueryInSophieBasedEra era result → QueryInEra era result
- data QueryInSophieBasedEra era result where
- QueryChainPoint ∷ QueryInSophieBasedEra era ChainPoint
- QueryEpoch ∷ QueryInSophieBasedEra era EpochNo
- QueryGenesisParameters ∷ QueryInSophieBasedEra era GenesisParameters
- QueryProtocolParameters ∷ QueryInSophieBasedEra era ProtocolParameters
- QueryProtocolParametersUpdate ∷ QueryInSophieBasedEra era (Map (Hash GenesisKey) ProtocolParametersUpdate)
- QueryStakeDistribution ∷ QueryInSophieBasedEra era (Map (Hash StakePoolKey) Rational)
- QueryUTxO ∷ QueryUTxOFilter → QueryInSophieBasedEra era (UTxO era)
- QueryStakeAddresses ∷ Set StakeCredential → NetworkId → QueryInSophieBasedEra era (Map StakeAddress Entropic, Map StakeAddress PoolId)
- QueryStakePools ∷ QueryInSophieBasedEra era (Set PoolId)
- QueryStakePoolParameters ∷ Set PoolId → QueryInSophieBasedEra era (Map PoolId StakePoolParameters)
- QueryDebugLedgerState ∷ QueryInSophieBasedEra era (SerialisedDebugLedgerState era)
- QueryProtocolState ∷ QueryInSophieBasedEra era (ProtocolState era)
- data QueryUTxOFilter
- newtype UTxO era = UTxO (Map TxIn (TxOut era))
- data UTxOInAnyEra where
- UTxOInAnyEra ∷ BccEra era → UTxO era → UTxOInAnyEra
- toConsensusQuery ∷ ∀ mode block result. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Some (Query block)
- fromConsensusQueryResult ∷ ∀ mode block result result'. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Query block result' → result' → result
- newtype SerialisedDebugLedgerState era = SerialisedDebugLedgerState (Serialised (NewEpochState (SophieLedgerEra era)))
- newtype ProtocolState era = ProtocolState (Serialised (ChainDepState (Crypto (SophieLedgerEra era))))
- data DebugLedgerState era where
- DebugLedgerState ∷ SophieLedgerEra era ~ ledgerera ⇒ NewEpochState ledgerera → DebugLedgerState era
- data EraHistory mode where
- EraHistory ∷ ConsensusBlockForMode mode ~ HardForkBlock xs ⇒ ConsensusMode mode → Interpreter xs → EraHistory mode
- newtype SystemStart = SystemStart {}
- newtype SlotsInEpoch = SlotsInEpoch Word64
- newtype SlotsToEpochEnd = SlotsToEpochEnd Word64
- slotToEpoch ∷ SlotNo → EraHistory mode → Either PastHorizonException (EpochNo, SlotsInEpoch, SlotsToEpochEnd)
- data family LedgerState blk
- getProgress ∷ SlotNo → EraHistory mode → Either PastHorizonException (RelativeTime, SlotLength)
- toLedgerUTxO ∷ SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UTxO era → UTxO ledgerera
- fromLedgerUTxO ∷ SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UTxO ledgerera → UTxO era
Queries
data QueryInMode mode result where Source #
QueryCurrentEra ∷ ConsensusModeIsMultiEra mode → QueryInMode mode AnyBccEra | |
QueryInEra ∷ EraInMode era mode → QueryInEra era result → QueryInMode mode (Either EraMismatch result) | |
QueryEraHistory ∷ ConsensusModeIsMultiEra mode → QueryInMode mode (EraHistory mode) | |
QuerySystemStart ∷ QueryInMode mode SystemStart |
Instances
Show (QueryInMode mode result) Source # | |
Defined in Bcc.Api.Query |
data QueryInEra era result where Source #
QueryColeUpdateState ∷ QueryInEra ColeEra ColeUpdateState | |
QueryInSophieBasedEra ∷ SophieBasedEra era → QueryInSophieBasedEra era result → QueryInEra era result |
Instances
Show (QueryInEra era result) Source # | |
Defined in Bcc.Api.Query |
data QueryInSophieBasedEra era result where Source #
Instances
Show (QueryInSophieBasedEra era result) Source # | |
Defined in Bcc.Api.Query |
data QueryUTxOFilter Source #
Getting the whole UTxO is obviously not efficient since the result can be huge. Filtering by address is also not efficient because it requires a linear search.
The QueryUTxOFilterByTxIn
is efficient since it fits with the structure of
the UTxO (which is indexed by TxIn
).
QueryUTxOWhole | O(n) time and space for utxo size n |
QueryUTxOByAddress (Set AddressAny) | O(n) time, O(m) space for utxo size n, and address set size m |
QueryUTxOByTxIn (Set TxIn) | O(m log n) time, O(m) space for utxo size n, and address set size m |
Instances
Eq QueryUTxOFilter Source # | |
Defined in Bcc.Api.Query | |
Show QueryUTxOFilter Source # | |
Defined in Bcc.Api.Query |
data UTxOInAnyEra where Source #
UTxOInAnyEra ∷ BccEra era → UTxO era → UTxOInAnyEra |
Instances
Show UTxOInAnyEra Source # | |
Defined in Bcc.Api.Query |
Internal conversion functions
toConsensusQuery ∷ ∀ mode block result. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Some (Query block) Source #
fromConsensusQueryResult ∷ ∀ mode block result result'. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Query block result' → result' → result Source #
Wrapper types used in queries
newtype SerialisedDebugLedgerState era Source #
SerialisedDebugLedgerState (Serialised (NewEpochState (SophieLedgerEra era))) |
newtype ProtocolState era Source #
ProtocolState (Serialised (ChainDepState (Crypto (SophieLedgerEra era)))) |
data DebugLedgerState era where Source #
DebugLedgerState ∷ SophieLedgerEra era ~ ledgerera ⇒ NewEpochState ledgerera → DebugLedgerState era |
Instances
(IsSophieBasedEra era, SophieLedgerEra era ~ ledgerera, SophieBasedEra ledgerera, ToJSON (PParams ledgerera), ToJSON (PParamsDelta ledgerera), ToJSON (TxOut ledgerera)) ⇒ ToJSON (DebugLedgerState era) Source # | |
Defined in Bcc.Api.Query toJSON ∷ DebugLedgerState era → Value # toEncoding ∷ DebugLedgerState era → Encoding # toJSONList ∷ [DebugLedgerState era] → Value # toEncodingList ∷ [DebugLedgerState era] → Encoding # | |
(Typeable era, TransLedgerState FromCBOR (SophieLedgerEra era)) ⇒ FromCBOR (DebugLedgerState era) Source # | |
Defined in Bcc.Api.Query fromCBOR ∷ Decoder s (DebugLedgerState era) # label ∷ Proxy (DebugLedgerState era) → Text # |
data EraHistory mode where Source #
EraHistory ∷ ConsensusBlockForMode mode ~ HardForkBlock xs ⇒ ConsensusMode mode → Interpreter xs → EraHistory mode |
newtype SystemStart #
Instances
newtype SlotsInEpoch Source #
newtype SlotsToEpochEnd Source #
slotToEpoch ∷ SlotNo → EraHistory mode → Either PastHorizonException (EpochNo, SlotsInEpoch, SlotsToEpochEnd) Source #
data family LedgerState blk #
Instances
Isomorphic LedgerState | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Embed.Unary project ∷ NoHardForks blk ⇒ LedgerState (HardForkBlock '[blk]) → LedgerState blk inject ∷ NoHardForks blk ⇒ LedgerState blk → LedgerState (HardForkBlock '[blk]) | |
CanHardFork xs ⇒ Eq (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Basics (==) ∷ LedgerState (HardForkBlock xs) → LedgerState (HardForkBlock xs) → Bool Source # (/=) ∷ LedgerState (HardForkBlock xs) → LedgerState (HardForkBlock xs) → Bool Source # | |
CanHardFork xs ⇒ Show (LedgerState (HardForkBlock xs)) | |
CanHardFork xs ⇒ NoThunks (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Basics noThunks ∷ Context → LedgerState (HardForkBlock xs) → IO (Maybe ThunkInfo) wNoThunks ∷ Context → LedgerState (HardForkBlock xs) → IO (Maybe ThunkInfo) showTypeOf ∷ Proxy (LedgerState (HardForkBlock xs)) → String | |
Isomorphic (Ticked :.: LedgerState) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Embed.Unary project ∷ NoHardForks blk ⇒ (Ticked :.: LedgerState) (HardForkBlock '[blk]) → (Ticked :.: LedgerState) blk inject ∷ NoHardForks blk ⇒ (Ticked :.: LedgerState) blk → (Ticked :.: LedgerState) (HardForkBlock '[blk]) | |
data LedgerState ColeBlock | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger data LedgerState ColeBlock = ColeLedgerState {
| |
type TranslationError era (LedgerState :.: SophieBlock) | |
Defined in Shardagnostic.Consensus.Sophie.SophieHFC | |
type Rep (LedgerState ColeBlock) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger type Rep (LedgerState ColeBlock) = D1 ('MetaData "LedgerState" "Shardagnostic.Consensus.Cole.Ledger.Ledger" "shardagnostic-consensus-cole-0.1.0.0-57763277a1dd4886d3500cfbed814a9e504ca4cde3b422e2c25ec9b5f4284c42" 'False) (C1 ('MetaCons "ColeLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "coleLedgerTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin BlockNo)) :*: (S1 ('MetaSel ('Just "coleLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "coleLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ColeTransition)))) | |
type Rep (LedgerState (SophieBlock era)) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger type Rep (LedgerState (SophieBlock era)) = D1 ('MetaData "LedgerState" "Shardagnostic.Consensus.Sophie.Ledger.Ledger" "shardagnostic-consensus-sophie-0.1.0.0-78dae6cdce618e392ec705722a54aafcdfaf8e601dcc8aefa7ad8f77cf55bc12" 'False) (C1 ('MetaCons "SophieLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "sophieLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (SophieTip era))) :*: (S1 ('MetaSel ('Just "sophieLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)) :*: S1 ('MetaSel ('Just "sophieLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SophieTransition)))) | |
type Rep (Ticked (LedgerState ColeBlock)) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger type Rep (Ticked (LedgerState ColeBlock)) = D1 ('MetaData "Ticked" "Shardagnostic.Consensus.Cole.Ledger.Ledger" "shardagnostic-consensus-cole-0.1.0.0-57763277a1dd4886d3500cfbed814a9e504ca4cde3b422e2c25ec9b5f4284c42" 'False) (C1 ('MetaCons "TickedColeLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedColeLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedColeLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ColeTransition))) | |
type Rep (Ticked (LedgerState (HardForkBlock xs))) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Ledger type Rep (Ticked (LedgerState (HardForkBlock xs))) = D1 ('MetaData "Ticked" "Shardagnostic.Consensus.HardFork.Combinator.Ledger" "shardagnostic-consensus-0.1.0.0-2aa8c817087060cd06754d8c0d3120b1c34fe53aa604e25131dc3c88e2ebf8ad" 'False) (C1 ('MetaCons "TickedHardForkLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedHardForkLedgerStateTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TransitionInfo) :*: S1 ('MetaSel ('Just "tickedHardForkLedgerStatePerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HardForkState (Ticked :.: LedgerState) xs)))) | |
type Rep (Ticked (LedgerState (SophieBlock era))) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger type Rep (Ticked (LedgerState (SophieBlock era))) = D1 ('MetaData "Ticked" "Shardagnostic.Consensus.Sophie.Ledger.Ledger" "shardagnostic-consensus-sophie-0.1.0.0-78dae6cdce618e392ec705722a54aafcdfaf8e601dcc8aefa7ad8f77cf55bc12" 'False) (C1 ('MetaCons "TickedSophieLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "untickedSophieLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (SophieTip era))) :*: (S1 ('MetaSel ('Just "tickedSophieLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SophieTransition) :*: S1 ('MetaSel ('Just "tickedSophieLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era))))) | |
type HeaderHash (LedgerState blk) | |
Defined in Shardagnostic.Consensus.Ledger.Basics type HeaderHash (LedgerState blk) = HeaderHash blk | |
type AuxLedgerEvent (LedgerState ColeBlock) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger | |
type AuxLedgerEvent (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Ledger type AuxLedgerEvent (LedgerState (HardForkBlock xs)) = OneEraLedgerEvent xs | |
type AuxLedgerEvent (LedgerState (SophieBlock era)) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger type AuxLedgerEvent (LedgerState (SophieBlock era)) = SophieLedgerEvent era | |
type LedgerErr (LedgerState ColeBlock) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger type LedgerErr (LedgerState ColeBlock) = ChainValidationError | |
type LedgerErr (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Ledger type LedgerErr (LedgerState (HardForkBlock xs)) = HardForkLedgerError xs | |
type LedgerErr (LedgerState (SophieBlock era)) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger type LedgerErr (LedgerState (SophieBlock era)) = SophieLedgerError era | |
type LedgerCfg (LedgerState ColeBlock) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger type LedgerCfg (LedgerState ColeBlock) = Config | |
type LedgerCfg (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Basics type LedgerCfg (LedgerState (HardForkBlock xs)) = HardForkLedgerConfig xs | |
type LedgerCfg (LedgerState (SophieBlock era)) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger type LedgerCfg (LedgerState (SophieBlock era)) = SophieLedgerConfig era | |
newtype LedgerState (HardForkBlock xs) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Basics newtype LedgerState (HardForkBlock xs) = HardForkLedgerState {
| |
data LedgerState (SophieBlock era) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger data LedgerState (SophieBlock era) = SophieLedgerState {
| |
data Ticked (LedgerState ColeBlock) | |
Defined in Shardagnostic.Consensus.Cole.Ledger.Ledger data Ticked (LedgerState ColeBlock) = TickedColeLedgerState {
| |
data Ticked (LedgerState (HardForkBlock xs)) | |
Defined in Shardagnostic.Consensus.HardFork.Combinator.Ledger data Ticked (LedgerState (HardForkBlock xs)) = TickedHardForkLedgerState {
| |
data Ticked (LedgerState (SophieBlock era)) | |
Defined in Shardagnostic.Consensus.Sophie.Ledger.Ledger data Ticked (LedgerState (SophieBlock era)) = TickedSophieLedgerState {
|
getProgress ∷ SlotNo → EraHistory mode → Either PastHorizonException (RelativeTime, SlotLength) Source #
Internal conversion functions
toLedgerUTxO ∷ SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UTxO era → UTxO ledgerera Source #
fromLedgerUTxO ∷ SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UTxO ledgerera → UTxO era Source #