Documentation
¶
Index ¶
- Variables
- func SetupMempoolEntriesCache(pool *RedisPool)
- func SetupSQLite() (db *sql.DB, err error)
- type MempoolState
- type NeedsUpdate
- type RedisPool
- func (p *RedisPool) GetBlockEntries() (blocks []types.BlockEntry, err error)
- func (p *RedisPool) GetHistorical(timeframe int, by string) (hmds []types.HistoricalMempoolData, err error)
- func (p *RedisPool) GetMempool() (timestamp time.Time, feerateMapJSON string, megabyteMarkersJSON string, ...)
- func (p *RedisPool) GetMempoolEntries() (mes []types.MempoolEntry, err error)
- func (p *RedisPool) GetMempoolEntriesCache() (mesJSON string, err error)
- func (p *RedisPool) GetRecentBlocks() (blocks []types.RecentBlock, err error)
- func (p *RedisPool) GetRecentFeerateAPIEntries() (entries []types.FeeRateAPIEntry, err error)
- func (p *RedisPool) GetTransactionStats() (tss []types.TransactionStat, err error)
- func (p *RedisPool) ReadHistoricalMempoolNeedUpdate() (nu NeedsUpdate, err error)
- func (p *RedisPool) SetMempoolEntriesCache(mesJSON string) (err error)
- func (p *RedisPool) WriteCurrentMempoolData(feerateMap map[int]int, mempoolSizeInByte int, megabyteMarkers []int) error
- func (p *RedisPool) WriteCurrentTransactionStats(segwitCount int, rbfCount int, txCount int) error
- func (p *RedisPool) WriteFeerateAPIEntry(entry types.FeeRateAPIEntry) error
- func (p *RedisPool) WriteHistoricalMempoolData(countInBuckets []int, feeInBuckets []float64, sizeInBuckets []int, ...) error
- func (p *RedisPool) WriteMempoolEntries(me types.MempoolEntry) error
- func (p *RedisPool) WriteNewBlockData(height int, numTx int, sizeWithWitness int, weight int) error
- func (p *RedisPool) WriteNewBlockEntry(height int, shortTXIDs []string) error
Constants ¶
This section is empty.
Variables ¶
var SQLiteDB *sql.DB
SQLiteDB holds a connection to a SQLite database
Functions ¶
func SetupMempoolEntriesCache ¶
func SetupMempoolEntriesCache(pool *RedisPool)
SetupMempoolEntriesCache sets up a periodic GetMempoolEntries() fetch job
func SetupSQLite ¶
SetupSQLite sets up the SQLite Database used for persistently saving mempool entries
Types ¶
type MempoolState ¶
type NeedsUpdate ¶
type NeedsUpdate struct { Update2h bool Update12h bool Update48h bool Update7d bool Update30d bool Update180d bool }
NeedsUpdate holds information about the timeframes that need an update
type RedisPool ¶
RedisPool holds a pool of redis connections
func SetupRedis ¶
SetupRedis sets up a new Redis Pool
func (*RedisPool) GetBlockEntries ¶
func (p *RedisPool) GetBlockEntries() (blocks []types.BlockEntry, err error)
GetBlockEntries returns the 20 most recent blocks with short TXIDs.
func (*RedisPool) GetHistorical ¶
func (*RedisPool) GetMempool ¶
func (p *RedisPool) GetMempool() (timestamp time.Time, feerateMapJSON string, megabyteMarkersJSON string, mempoolSize int, err error)
GetMempool gets the current mempool from the database
func (*RedisPool) GetMempoolEntries ¶
func (p *RedisPool) GetMempoolEntries() (mes []types.MempoolEntry, err error)
GetMempoolEntries gets the last x mempool Entries from the database
func (*RedisPool) GetMempoolEntriesCache ¶
GetMempoolEntriesCache GET the cached response of a recent GetMempoolEntries() call
func (*RedisPool) GetRecentBlocks ¶
func (p *RedisPool) GetRecentBlocks() (blocks []types.RecentBlock, err error)
GetRecentBlocks returns the 10 most recent blocks.
func (*RedisPool) GetRecentFeerateAPIEntries ¶
func (p *RedisPool) GetRecentFeerateAPIEntries() (entries []types.FeeRateAPIEntry, err error)
GetRecentFeerateAPIEntries returns the recent feeRate API entries from Redis
func (*RedisPool) GetTransactionStats ¶
func (p *RedisPool) GetTransactionStats() (tss []types.TransactionStat, err error)
GetTransactionStats gets the Transaction Stats data from the database
func (*RedisPool) ReadHistoricalMempoolNeedUpdate ¶
func (p *RedisPool) ReadHistoricalMempoolNeedUpdate() (nu NeedsUpdate, err error)
ReadHistoricalMempoolNeedUpdate checks which time frame is due (needs an update)
func (*RedisPool) SetMempoolEntriesCache ¶
SetMempoolEntriesCache SETs the response of a recent GetMempoolEntries() as a cache
func (*RedisPool) WriteCurrentMempoolData ¶
func (p *RedisPool) WriteCurrentMempoolData(feerateMap map[int]int, mempoolSizeInByte int, megabyteMarkers []int) error
WriteCurrentMempoolData writes the current mempool data into the database
func (*RedisPool) WriteCurrentTransactionStats ¶
WriteCurrentTransactionStats writes the current transaction stats into the database
func (*RedisPool) WriteFeerateAPIEntry ¶
func (p *RedisPool) WriteFeerateAPIEntry(entry types.FeeRateAPIEntry) error
WriteFeerateAPIEntry writes a new feerate API entry into the database
func (*RedisPool) WriteHistoricalMempoolData ¶
func (p *RedisPool) WriteHistoricalMempoolData(countInBuckets []int, feeInBuckets []float64, sizeInBuckets []int, timeframe int) error
WriteHistoricalMempoolData writes the histoical mempool data into the database
func (*RedisPool) WriteMempoolEntries ¶
func (p *RedisPool) WriteMempoolEntries(me types.MempoolEntry) error
WriteMempoolEntries writes a txid and it's feerate to the database
func (*RedisPool) WriteNewBlockData ¶
WriteNewBlockData writes data for a new block into the database