Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Store = Store {
- peerMgr :: !PeerMgr
- chain :: !Chain
- block :: !BlockStore
- db :: !DatabaseReader
- cache :: !(Maybe CacheConfig)
- pub :: !(Publisher StoreEvent)
- net :: !Network
- ctx :: !Ctx
- data StoreConfig = StoreConfig {
- maxPeers :: !Int
- initPeers :: ![String]
- discover :: !Bool
- db :: !FilePath
- net :: !Network
- redis :: !(Maybe String)
- ctx :: !Ctx
- initGap :: !Word32
- gap :: !Word32
- redisMinAddrs :: !Int
- redisMaxKeys :: !Integer
- noMempool :: !Bool
- wipeMempool :: !Bool
- syncMempool :: !Bool
- peerTimeout :: !NominalDiffTime
- maxPeerLife :: !NominalDiffTime
- connect :: !(SockAddr -> WithConnection)
- stats :: !(Maybe Stats)
- redisSyncInterval :: !Int
- data StoreEvent
- withStore :: (MonadLoggerIO m, MonadUnliftIO m) => StoreConfig -> (Store -> m a) -> m a
- module Haskoin.Store.BlockStore
- module Haskoin.Store.Web
- module Haskoin.Store.Database.Reader
- module Haskoin.Store.Database.Types
- module Haskoin.Store.Data
- data CacheConfig = CacheConfig {}
- type CacheT = ReaderT (Maybe CacheConfig)
- data CacheError
- withCache :: Maybe CacheConfig -> CacheT m a -> m a
- connectRedis :: MonadIO m => String -> m Connection
- isInCache :: forall (m :: Type -> Type). MonadLoggerIO m => XPubSpec -> CacheT m Bool
- class Monad m => StoreReadBase (m :: Type -> Type) where
- getNetwork :: m Network
- getCtx :: m Ctx
- getBestBlock :: m (Maybe BlockHash)
- getBlocksAtHeight :: BlockHeight -> m [BlockHash]
- getBlock :: BlockHash -> m (Maybe BlockData)
- getTxData :: TxHash -> m (Maybe TxData)
- getSpender :: OutPoint -> m (Maybe Spender)
- getBalance :: Address -> m (Maybe Balance)
- getUnspent :: OutPoint -> m (Maybe Unspent)
- getMempool :: m [(UnixTime, TxHash)]
- class StoreReadBase m => StoreReadExtra (m :: Type -> Type) where
- getAddressesTxs :: [Address] -> Limits -> m [TxRef]
- getAddressesUnspents :: [Address] -> Limits -> m [Unspent]
- getInitialGap :: m Word32
- getMaxGap :: m Word32
- getNumTxData :: Word64 -> m [TxData]
- getBalances :: [Address] -> m [Balance]
- getAddressTxs :: Address -> Limits -> m [TxRef]
- getAddressUnspents :: Address -> Limits -> m [Unspent]
- xPubBals :: XPubSpec -> m [XPubBal]
- xPubUnspents :: XPubSpec -> [XPubBal] -> Limits -> m [XPubUnspent]
- xPubTxs :: XPubSpec -> [XPubBal] -> Limits -> m [TxRef]
- xPubTxCount :: XPubSpec -> [XPubBal] -> m Word32
- data Limits = Limits {}
- data Start
- = AtTx !TxHash
- | AtBlock !BlockHeight
- getTransaction :: StoreReadBase m => TxHash -> m (Maybe Transaction)
- getDefaultBalance :: StoreReadBase m => Address -> m Balance
- getActiveTxData :: StoreReadBase m => TxHash -> m (Maybe TxData)
- blockAtOrBefore :: (MonadIO m, StoreReadExtra m) => Chain -> UnixTime -> m (Maybe BlockData)
Documentation
Store mailboxes.
Store | |
|
data StoreConfig Source #
Configuration for a Store
.
StoreConfig | |
|
data StoreEvent Source #
Events that the store can generate.
withStore :: (MonadLoggerIO m, MonadUnliftIO m) => StoreConfig -> (Store -> m a) -> m a Source #
module Haskoin.Store.BlockStore
module Haskoin.Store.Web
module Haskoin.Store.Database.Types
module Haskoin.Store.Data
Cache
data CacheConfig Source #
Instances
data CacheError Source #
Instances
connectRedis :: MonadIO m => String -> m Connection Source #
Store Reader
class Monad m => StoreReadBase (m :: Type -> Type) where Source #
getNetwork :: m Network Source #
getBestBlock :: m (Maybe BlockHash) Source #
getBlocksAtHeight :: BlockHeight -> m [BlockHash] Source #
getBlock :: BlockHash -> m (Maybe BlockData) Source #
getTxData :: TxHash -> m (Maybe TxData) Source #
getSpender :: OutPoint -> m (Maybe Spender) Source #
getBalance :: Address -> m (Maybe Balance) Source #
getUnspent :: OutPoint -> m (Maybe Unspent) Source #
getMempool :: m [(UnixTime, TxHash)] Source #
Instances
StoreReadBase m => StoreReadBase (CacheT m) Source # | |
Defined in Haskoin.Store.Cache getNetwork :: CacheT m Network Source # getCtx :: CacheT m Ctx Source # getBestBlock :: CacheT m (Maybe BlockHash) Source # getBlocksAtHeight :: BlockHeight -> CacheT m [BlockHash] Source # getBlock :: BlockHash -> CacheT m (Maybe BlockData) Source # getTxData :: TxHash -> CacheT m (Maybe TxData) Source # getSpender :: OutPoint -> CacheT m (Maybe Spender) Source # getBalance :: Address -> CacheT m (Maybe Balance) Source # | |
MonadIO m => StoreReadBase (DatabaseReaderT m) Source # | |
Defined in Haskoin.Store.Database.Reader getNetwork :: DatabaseReaderT m Network Source # getCtx :: DatabaseReaderT m Ctx Source # getBestBlock :: DatabaseReaderT m (Maybe BlockHash) Source # getBlocksAtHeight :: BlockHeight -> DatabaseReaderT m [BlockHash] Source # getBlock :: BlockHash -> DatabaseReaderT m (Maybe BlockData) Source # getTxData :: TxHash -> DatabaseReaderT m (Maybe TxData) Source # getSpender :: OutPoint -> DatabaseReaderT m (Maybe Spender) Source # getBalance :: Address -> DatabaseReaderT m (Maybe Balance) Source # getUnspent :: OutPoint -> DatabaseReaderT m (Maybe Unspent) Source # getMempool :: DatabaseReaderT m [(UnixTime, TxHash)] Source # | |
MonadIO m => StoreReadBase (WriterT m) Source # | |
Defined in Haskoin.Store.Database.Writer getNetwork :: WriterT m Network Source # getCtx :: WriterT m Ctx Source # getBestBlock :: WriterT m (Maybe BlockHash) Source # getBlocksAtHeight :: BlockHeight -> WriterT m [BlockHash] Source # getBlock :: BlockHash -> WriterT m (Maybe BlockData) Source # getTxData :: TxHash -> WriterT m (Maybe TxData) Source # getSpender :: OutPoint -> WriterT m (Maybe Spender) Source # getBalance :: Address -> WriterT m (Maybe Balance) Source # getUnspent :: OutPoint -> WriterT m (Maybe Unspent) Source # |
class StoreReadBase m => StoreReadExtra (m :: Type -> Type) where Source #
getAddressesTxs :: [Address] -> Limits -> m [TxRef] Source #
getAddressesUnspents :: [Address] -> Limits -> m [Unspent] Source #
getInitialGap :: m Word32 Source #
getMaxGap :: m Word32 Source #
getNumTxData :: Word64 -> m [TxData] Source #
getBalances :: [Address] -> m [Balance] Source #
getAddressTxs :: Address -> Limits -> m [TxRef] Source #
getAddressUnspents :: Address -> Limits -> m [Unspent] Source #
xPubBals :: XPubSpec -> m [XPubBal] Source #
xPubUnspents :: XPubSpec -> [XPubBal] -> Limits -> m [XPubUnspent] Source #
xPubTxs :: XPubSpec -> [XPubBal] -> Limits -> m [TxRef] Source #
Instances
(MonadUnliftIO m, MonadLoggerIO m, StoreReadExtra m) => StoreReadExtra (CacheT m) Source # | |
Defined in Haskoin.Store.Cache getAddressesTxs :: [Address] -> Limits -> CacheT m [TxRef] Source # getAddressesUnspents :: [Address] -> Limits -> CacheT m [Unspent] Source # getInitialGap :: CacheT m Word32 Source # getMaxGap :: CacheT m Word32 Source # getNumTxData :: Word64 -> CacheT m [TxData] Source # getBalances :: [Address] -> CacheT m [Balance] Source # getAddressTxs :: Address -> Limits -> CacheT m [TxRef] Source # getAddressUnspents :: Address -> Limits -> CacheT m [Unspent] Source # xPubBals :: XPubSpec -> CacheT m [XPubBal] Source # xPubUnspents :: XPubSpec -> [XPubBal] -> Limits -> CacheT m [XPubUnspent] Source # xPubTxs :: XPubSpec -> [XPubBal] -> Limits -> CacheT m [TxRef] Source # xPubTxCount :: XPubSpec -> [XPubBal] -> CacheT m Word32 Source # | |
MonadUnliftIO m => StoreReadExtra (DatabaseReaderT m) Source # | |
Defined in Haskoin.Store.Database.Reader getAddressesTxs :: [Address] -> Limits -> DatabaseReaderT m [TxRef] Source # getAddressesUnspents :: [Address] -> Limits -> DatabaseReaderT m [Unspent] Source # getInitialGap :: DatabaseReaderT m Word32 Source # getMaxGap :: DatabaseReaderT m Word32 Source # getNumTxData :: Word64 -> DatabaseReaderT m [TxData] Source # getBalances :: [Address] -> DatabaseReaderT m [Balance] Source # getAddressTxs :: Address -> Limits -> DatabaseReaderT m [TxRef] Source # getAddressUnspents :: Address -> Limits -> DatabaseReaderT m [Unspent] Source # xPubBals :: XPubSpec -> DatabaseReaderT m [XPubBal] Source # xPubUnspents :: XPubSpec -> [XPubBal] -> Limits -> DatabaseReaderT m [XPubUnspent] Source # xPubTxs :: XPubSpec -> [XPubBal] -> Limits -> DatabaseReaderT m [TxRef] Source # xPubTxCount :: XPubSpec -> [XPubBal] -> DatabaseReaderT m Word32 Source # |
Useful Fuctions
getTransaction :: StoreReadBase m => TxHash -> m (Maybe Transaction) Source #
getDefaultBalance :: StoreReadBase m => Address -> m Balance Source #
getActiveTxData :: StoreReadBase m => TxHash -> m (Maybe TxData) Source #
blockAtOrBefore :: (MonadIO m, StoreReadExtra m) => Chain -> UnixTime -> m (Maybe BlockData) Source #