Documentation
¶
Index ¶
- Constants
- func DisableLog()
- func InitWiredDB(dbInfo *DBInfo, statusC chan uint32, cl *dcrrpcclient.Client, ...) (wiredDB, error)
- func NewWiredDB(db *sql.DB, statusC chan uint32, cl *dcrrpcclient.Client, p *chaincfg.Params) wiredDB
- func UseLogger(logger btclog.Logger)
- type BlockSummaryDatabaser
- type DB
- func (db *DB) GetBlockSummaryHeight() int64
- func (db *DB) GetStakeInfoHeight() int64
- func (db *DB) RetrieveBlockSummary(ind int64) (*apitypes.BlockDataBasic, error)
- func (db *DB) RetrieveLatestBlockSummary() (*apitypes.BlockDataBasic, error)
- func (db *DB) RetrieveLatestStakeInfoExtended() (*apitypes.StakeInfoExtended, error)
- func (db *DB) RetrievePoolInfo(ind int64) (*apitypes.TicketPoolInfo, error)
- func (db *DB) RetrievePoolInfoRange(ind0, ind1 int64) ([]apitypes.TicketPoolInfo, error)
- func (db *DB) RetrievePoolValAndSizeRange(ind0, ind1 int64) ([]float64, []float64, error)
- func (db *DB) RetrieveSDiff(ind int64) (float64, error)
- func (db *DB) RetrieveSDiffRange(ind0, ind1 int64) ([]float64, error)
- func (db *DB) RetrieveStakeInfoExtended(ind int64) (*apitypes.StakeInfoExtended, error)
- func (db *DB) StoreBlockSummary(bd *apitypes.BlockDataBasic) error
- func (db *DB) StoreStakeInfoExtended(si *apitypes.StakeInfoExtended) error
- type DBDataSaver
- type DBInfo
- type StakeInfoDatabaser
Constants ¶
const ( // TableNameSummaries is name of the table used to store block summary data TableNameSummaries = "dcrdata_block_summary" // TableNameStakeInfo is name of the table used to store extended stake info TableNameStakeInfo = "dcrdata_stakeinfo_extended" )
const (
// DefaultStakeDbName is the default database name
DefaultStakeDbName = "ffldb_stake"
)
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func InitWiredDB ¶
func NewWiredDB ¶
Types ¶
type BlockSummaryDatabaser ¶
type BlockSummaryDatabaser interface { StoreStakeInfoExtended(bd *apitypes.StakeInfoExtended) error RetrieveStakeInfoExtended(ind int64) (*apitypes.StakeInfoExtended, error) }
BlockSummaryDatabaser is the interface for a block data saving database
type DB ¶
DB is a wrapper around sql.DB that adds methods for storing and retrieving chain data. Use InitDB to get a new instance. This may be unexported in the future.
func InitDB ¶
InitDB creates a new DB instance from a DBInfo containing the name of the file used to back the underlying sql database.
func NewDB ¶
NewDB creates a new DB instance with pre-generated sql statements from an existing sql.DB. Use InitDB to create a new DB without having a sql.DB. TODO: if this db exists, figure out best heights
func (*DB) GetBlockSummaryHeight ¶ added in v0.1.2
func (*DB) GetStakeInfoHeight ¶ added in v0.1.2
func (*DB) RetrieveBlockSummary ¶
func (db *DB) RetrieveBlockSummary(ind int64) (*apitypes.BlockDataBasic, error)
func (*DB) RetrieveLatestBlockSummary ¶
func (db *DB) RetrieveLatestBlockSummary() (*apitypes.BlockDataBasic, error)
func (*DB) RetrieveLatestStakeInfoExtended ¶
func (db *DB) RetrieveLatestStakeInfoExtended() (*apitypes.StakeInfoExtended, error)
func (*DB) RetrievePoolInfo ¶ added in v0.1.2
func (db *DB) RetrievePoolInfo(ind int64) (*apitypes.TicketPoolInfo, error)
func (*DB) RetrievePoolInfoRange ¶ added in v0.1.2
func (db *DB) RetrievePoolInfoRange(ind0, ind1 int64) ([]apitypes.TicketPoolInfo, error)
func (*DB) RetrievePoolValAndSizeRange ¶ added in v0.1.2
func (*DB) RetrieveSDiffRange ¶ added in v0.1.2
func (*DB) RetrieveStakeInfoExtended ¶
func (db *DB) RetrieveStakeInfoExtended(ind int64) (*apitypes.StakeInfoExtended, error)
func (*DB) StoreBlockSummary ¶
func (db *DB) StoreBlockSummary(bd *apitypes.BlockDataBasic) error
func (*DB) StoreStakeInfoExtended ¶
func (db *DB) StoreStakeInfoExtended(si *apitypes.StakeInfoExtended) error
type DBDataSaver ¶ added in v0.1.2
type DBDataSaver struct { *DB // contains filtered or unexported fields }
type StakeInfoDatabaser ¶
type StakeInfoDatabaser interface { StoreBlockSummary(bd *apitypes.BlockDataBasic) error RetrieveBlockSummary(ind int64) (*apitypes.BlockDataBasic, error) }
StakeInfoDatabaser is the interface for an extended stake info saving database