database

package
v0.0.0-...-be1bc29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Pool is a pool of redis connections
	Pool *redis.Pool
	// SQLiteDB is a open SQLite database
	SQLiteDB *sql.DB
)

Functions

func SetupRedis

func SetupRedis() (err error)

SetupRedis sets up a new Redis Pool

func SetupSQLite

func SetupSQLite() (db *sql.DB, err error)

SetupSQLite sets up the SQLite Database used for persitently saving mempool entries

func WriteCurrentMempoolData

func WriteCurrentMempoolData(feerateMap map[int]int, mempoolSizeInByte int, megabyteMarkers []int) error

WriteCurrentMempoolData writes the current mempool data into the database

func WriteCurrentTransactionStats

func WriteCurrentTransactionStats(segwitCount int, rbfCount int, txCount int) error

WriteCurrentTransactionStats writes the current transaction stats into the database

func WriteFeerateAPIEntry

func WriteFeerateAPIEntry(entry types.FeeRateAPIEntry) error

WriteFeerateAPIEntry writes a new feerate API entry into the database

func WriteHistoricalMempoolData

func WriteHistoricalMempoolData(countInBuckets []int, feeInBuckets []float64, sizeInBuckets []int, timeframe int) error

WriteHistoricalMempoolData writes the histoical mempool data into the database

func WriteMempoolEntries

func WriteMempoolEntries(me types.MempoolEntry) error

WriteMempoolEntries writes a txid and it's feerate to the database

func WriteNewBlockData

func WriteNewBlockData(height int, numTx int, sizeWithWitness int, weight int) error

WriteNewBlockData writes data for a new block into the database

func WriteNewBlockEntry

func WriteNewBlockEntry(height int, shortTXIDs []string) error

WriteNewBlockEntry writes a BlockEntry into the Redis database.

Types

type NeedsUpdate

type NeedsUpdate struct {
	Update2h   bool
	Update12h  bool
	Update48h  bool
	Update7d   bool
	Update30d  bool
	Update180d bool
}

func ReadHistoricalMempoolNeedUpdate

func ReadHistoricalMempoolNeedUpdate() (nu NeedsUpdate, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL