database

package
v0.0.0-...-f41d3e3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChainindexBlockChunkMap = []byte("CHAININDEX-BLOCK-CHUNK-MAP")
View Source
var ChainindexBlockChunks = []byte("CHAININDEX-BLOCK-CHUNKS")
View Source
var ChainindexHeightToHashMap = []byte("CHAININDEX-BLOCK-HEIGHT-TO-HASH")
View Source
var ChainindexTxToHashMap = []byte("CHAININDEX-TX-TO-BLOCK")
View Source
var ChainstateBlocks = []byte("CHAINSTATE-BLOCKS")
View Source
var ChainstateMTxs = []byte("CHAINSTATE-MTXS")
View Source
var ChainstateTxs = []byte("CHAINSTATE-TXS")
View Source
var SyncInfo = []byte("SYNC-INFO")

Functions

This section is empty.

Types

type ChainindexDB

type ChainindexDB struct {
	Config ChainindexDBConfig
	// contains filtered or unexported fields
}

func (*ChainindexDB) AddBlock

func (odb *ChainindexDB) AddBlock(block *ci_pb.BcBlock) (bool, error)

func (*ChainindexDB) AddBlockRange

func (odb *ChainindexDB) AddBlockRange(brange *ci_pb.BcBlocks) (int, error)

func (*ChainindexDB) AddMarkedTransaction

func (odb *ChainindexDB) AddMarkedTransaction(mtx *ci_pb.MarkedTransaction)

func (*ChainindexDB) AddTransaction

func (odb *ChainindexDB) AddTransaction(tx *ci_pb.Transaction)

func (*ChainindexDB) Close

func (odb *ChainindexDB) Close()

func (*ChainindexDB) FlushToDisk

func (odb *ChainindexDB) FlushToDisk()

func (*ChainindexDB) FullLocalValidation

func (odb *ChainindexDB) FullLocalValidation()

func (*ChainindexDB) GetBlockByHash

func (odb *ChainindexDB) GetBlockByHash(blockHash []byte) (*ci_pb.BcBlock, error)

func (*ChainindexDB) GetBlockByHeight

func (odb *ChainindexDB) GetBlockByHeight(blockHeight uint64) (*ci_pb.BcBlock, error)

func (*ChainindexDB) GetBlockByTx

func (odb *ChainindexDB) GetBlockByTx(txHash []byte) (*ci_pb.BcBlock, error)

func (*ChainindexDB) GetSyncStartingBlock

func (odb *ChainindexDB) GetSyncStartingBlock() *ci_pb.BcBlock

func (*ChainindexDB) HighestBlock

func (odb *ChainindexDB) HighestBlock() *ci_pb.BcBlock

func (*ChainindexDB) HighestBlockHeight

func (odb *ChainindexDB) HighestBlockHeight() uint64

func (*ChainindexDB) HighestSerializedBlock

func (odb *ChainindexDB) HighestSerializedBlock() ci_pb.BcBlock

func (*ChainindexDB) IsInitialBlockDownload

func (odb *ChainindexDB) IsInitialBlockDownload() bool

func (*ChainindexDB) IsMultiplexPeers

func (odb *ChainindexDB) IsMultiplexPeers() bool

func (*ChainindexDB) Open

func (odb *ChainindexDB) Open(filepath string, dropChainstate bool, pruneDatabaseTo uint64) error

func (*ChainindexDB) Run

func (odb *ChainindexDB) Run()

func (*ChainindexDB) SerializedHeight

func (odb *ChainindexDB) SerializedHeight() uint64

func (*ChainindexDB) SetInitialBlockDownload

func (odb *ChainindexDB) SetInitialBlockDownload()

func (*ChainindexDB) SetMultiplexPeers

func (odb *ChainindexDB) SetMultiplexPeers()

func (*ChainindexDB) UnSetInitialBlockDownload

func (odb *ChainindexDB) UnSetInitialBlockDownload()

func (*ChainindexDB) UnSetMultiplexPeers

func (odb *ChainindexDB) UnSetMultiplexPeers()

type ChainindexDBConfig

type ChainindexDBConfig struct {
	Maturity           int `json:"maturity"`           // how many blocks until maturity is reached
	IncomingBlocksSize int `json:"incomingBlocksSize"` // how big is the map of incoming blocks
	ActiveSet          int `json:"activeSet"`          // how many blocks past maturity to keep in memory
	AncientChunkSize   int `json:"ancientChunkSize"`   // how many blocks to serialize to disk together
}

func DefaultChainindexDBConfig

func DefaultChainindexDBConfig() ChainindexDBConfig

Jump to

Keyboard shortcuts

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