Documentation ¶
Index ¶
- Constants
- type ChainindexBlockchain
- func (obc *ChainindexBlockchain) AddBlock(block *ci_pb.BcBlock) bool
- func (obc *ChainindexBlockchain) AddBlockRange(blocks *ci_pb.BcBlocks) int
- func (obc *ChainindexBlockchain) GetBlockByHash(hash string) (*ci_pb.BcBlock, error)
- func (obc *ChainindexBlockchain) GetBlockByHeight(height uint64) (*ci_pb.BcBlock, error)
- func (obc *ChainindexBlockchain) GetBlockByTx(txHash string) (*ci_pb.BcBlock, error)
- func (obc *ChainindexBlockchain) GetHighestBlock() (*ci_pb.BcBlock, error)
- func (obc *ChainindexBlockchain) IsFollowingChain() bool
- func (obc *ChainindexBlockchain) SetFollowingChain()
- func (obc *ChainindexBlockchain) SyncProgress() ProgressInfo
- func (obc *ChainindexBlockchain) UnsetFollowingChain()
- type ChainindexBlockchainConfig
- type HeadInformation
- type ProgressInfo
Constants ¶
View Source
const ( BLOCK_TYPE = "block" CONNECTION_TYPE = "connects" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainindexBlockchain ¶
type ChainindexBlockchain struct { Config ChainindexBlockchainConfig Mu sync.Mutex GraphMu sync.Mutex CheckupMu sync.Mutex Heads map[string]bool HeadsToCheck map[string]uint64 BlockGraph *dagger.Graph DB *database.ChainindexDB IbdTransitionPeriodRelativeDepth float64 // contains filtered or unexported fields }
func (*ChainindexBlockchain) AddBlock ¶
func (obc *ChainindexBlockchain) AddBlock(block *ci_pb.BcBlock) bool
func (*ChainindexBlockchain) AddBlockRange ¶
func (obc *ChainindexBlockchain) AddBlockRange(blocks *ci_pb.BcBlocks) int
func (*ChainindexBlockchain) GetBlockByHash ¶
func (obc *ChainindexBlockchain) GetBlockByHash(hash string) (*ci_pb.BcBlock, error)
func (*ChainindexBlockchain) GetBlockByHeight ¶
func (obc *ChainindexBlockchain) GetBlockByHeight(height uint64) (*ci_pb.BcBlock, error)
func (*ChainindexBlockchain) GetBlockByTx ¶
func (obc *ChainindexBlockchain) GetBlockByTx(txHash string) (*ci_pb.BcBlock, error)
func (*ChainindexBlockchain) GetHighestBlock ¶
func (obc *ChainindexBlockchain) GetHighestBlock() (*ci_pb.BcBlock, error)
func (*ChainindexBlockchain) IsFollowingChain ¶
func (obc *ChainindexBlockchain) IsFollowingChain() bool
func (*ChainindexBlockchain) SetFollowingChain ¶
func (obc *ChainindexBlockchain) SetFollowingChain()
func (*ChainindexBlockchain) SyncProgress ¶
func (obc *ChainindexBlockchain) SyncProgress() ProgressInfo
func (*ChainindexBlockchain) UnsetFollowingChain ¶
func (obc *ChainindexBlockchain) UnsetFollowingChain()
type ChainindexBlockchainConfig ¶
type ChainindexBlockchainConfig struct { DisjointCheckupDepth int `json:"disjoint_checkup_depth"` // if there is a chain segment not connected to db, how long does it have to be to ask to go look for blocks to try to connect? DisjointCheckupHeight int `json:"disjoint_checkup_height"` // if any chain segment not connected to db is higher by this number of blocks, investigate it DisplayDepth int `json:"display_depth"` // only show chains of this length or longer }
func DefaultChainindexBlockchainConfig ¶
func DefaultChainindexBlockchainConfig() ChainindexBlockchainConfig
type HeadInformation ¶
Click to show internal directories.
Click to hide internal directories.