Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
NetworkLayer
m block =
NetworkLayer
{
- chainSync :: Tracer IO ChainFollowLog -> ChainFollower m ChainPoint BlockHeader ( NonEmpty block) -> m ()
- lightSync :: Maybe ( ChainFollower m ChainPoint BlockHeader (LightBlocks m Block ) -> m ())
- currentNodeTip :: m BlockHeader
- currentNodeEra :: m AnyCardanoEra
- currentProtocolParameters :: m ProtocolParameters
- currentSlottingParameters :: m SlottingParameters
- watchNodeTip :: ( BlockHeader -> m ()) -> m ()
- postTx :: SealedTx -> ExceptT ErrPostTx m ()
- stakeDistribution :: Coin -> m StakePoolsSummary
- getCachedRewardAccountBalance :: RewardAccount -> m Coin
- fetchRewardAccountBalances :: Set RewardAccount -> m ( Map RewardAccount Coin )
- timeInterpreter :: TimeInterpreter ( ExceptT PastHorizonException m)
- syncProgress :: SlotNo -> m SyncProgress
- newtype ErrPostTx = ErrPostTxValidationError Text
-
data
ChainFollower
m point tip blocks =
ChainFollower
{
- checkpointPolicy :: Integer -> CheckpointPolicy
- readChainPoints :: m [point]
- rollForward :: blocks -> tip -> m ()
- rollBackward :: point -> m point
- mapChainFollower :: Functor m => (point1 -> point2) -> (point2 -> point1) -> (tip2 -> tip1) -> (blocks2 -> blocks1) -> ChainFollower m point1 tip1 blocks1 -> ChainFollower m point2 tip2 blocks2
- data ChainFollowLog
-
data
ChainSyncLog
block point
- = MsgChainFindIntersect [point]
- | MsgChainRollForward ( NonEmpty block) point
- | MsgChainRollBackward point Int
- | MsgChainTip point
- | MsgLocalTip point
- | MsgTipDistance Natural
- mapChainSyncLog :: (b1 -> b2) -> (p1 -> p2) -> ChainSyncLog b1 p1 -> ChainSyncLog b2 p2
- withFollowStatsMonitoring :: Tracer IO ChainFollowLog -> ( SlotNo -> IO SyncProgress ) -> ( Tracer IO ( ChainSyncLog BlockHeader ChainPoint ) -> IO ()) -> IO ()
-
data
FollowStats
f =
FollowStats
{
- blocksApplied :: !(f Int )
- rollbacks :: !(f Int )
- localTip :: !(f ChainPoint )
- time :: !(f UTCTime )
- prog :: !(f SyncProgress )
- data Rearview a = Rearview { }
- emptyStats :: UTCTime -> FollowStats Rearview
- updateStats :: ChainSyncLog block ChainPoint -> FollowStats Rearview -> FollowStats Rearview
Interface
data NetworkLayer m block Source #
Interface for network capabilities.
NetworkLayer | |
|
Instances
Functor m => Functor ( NetworkLayer m) Source # | |
Defined in Cardano.Wallet.Network fmap :: (a -> b) -> NetworkLayer m a -> NetworkLayer m b Source # (<$) :: a -> NetworkLayer m b -> NetworkLayer m a Source # |
Errors
Error while trying to send a transaction
Instances
Eq ErrPostTx Source # | |
Show ErrPostTx Source # | |
Generic ErrPostTx Source # | |
ToText ErrPostTx Source # | |
IsServerError ErrPostTx Source # | |
Defined in Cardano.Wallet.Api.Server toServerError :: ErrPostTx -> ServerError Source # |
|
type Rep ErrPostTx Source # | |
Defined in Cardano.Wallet.Network
type
Rep
ErrPostTx
=
D1
('
MetaData
"ErrPostTx" "Cardano.Wallet.Network" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"ErrPostTxValidationError" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Text
)))
|
Chain following
data ChainFollower m point tip blocks Source #
A collection of callbacks to use with the
chainSync
function.
ChainFollower | |
|
:: Functor m | |
=> (point1 -> point2) |
Covariant |
-> (point2 -> point1) |
Contravariant |
-> (tip2 -> tip1) |
Contravariant |
-> (blocks2 -> blocks1) |
Contravariant |
-> ChainFollower m point1 tip1 blocks1 | |
-> ChainFollower m point2 tip2 blocks2 |
data ChainFollowLog Source #
Higher level log of a chain follower. Includes computed statistics about synchronization progress.
MsgChainSync ( ChainSyncLog BlockHeader ChainPoint ) | |
MsgFollowStats ( FollowStats Rearview ) | |
MsgStartFollowing |
Instances
data ChainSyncLog block point Source #
Low-level logs of the ChainSync mini-protocol
MsgChainFindIntersect [point] | |
MsgChainRollForward ( NonEmpty block) point | |
MsgChainRollBackward point Int | |
MsgChainTip point | |
MsgLocalTip point | |
MsgTipDistance Natural |
Instances
mapChainSyncLog :: (b1 -> b2) -> (p1 -> p2) -> ChainSyncLog b1 p1 -> ChainSyncLog b2 p2 Source #
withFollowStatsMonitoring :: Tracer IO ChainFollowLog -> ( SlotNo -> IO SyncProgress ) -> ( Tracer IO ( ChainSyncLog BlockHeader ChainPoint ) -> IO ()) -> IO () Source #
Monitors health and statistics by inspecting the messages
submitted to a
ChainSyncLog
tracer.
Statistics are computed in regular time intervals.
In order to do that, the monitor runs in separate thread.
The results are submitted to the outer
ChainFollowLog
tracer.
Logging (for testing)
data FollowStats f Source #
Statistics of interest from the follow-function.
The
f
allows us to use
Rearview
to keep track of both current and
previously logged stats, and perform operations over it in a nice way.
FollowStats | |
|
Instances
A
Rearview
consists of a past value and a present value.
Useful for keeping track of past logs.
The idea is to
1. Reconstruct a model of the
current
state
using a
Trace
2. Sometimes log the difference between the
current
state and the most
recently logged one.
Instances
emptyStats :: UTCTime -> FollowStats Rearview Source #
updateStats :: ChainSyncLog block ChainPoint -> FollowStats Rearview -> FollowStats Rearview Source #
Update the current statistics based on a new log message.