cometbft

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlocksyncChannel = byte(0x40)
)

Variables

This section is empty.

Functions

func CometLogger

func CometLogger() (logger log.Logger)

func CreateAndStartEventBus

func CreateAndStartEventBus() (*cometTypes.EventBus, error)

func CreateAndStartProxyAppConns

func CreateAndStartProxyAppConns(config *Config) (proxy.AppConns, error)

func CreateEvidenceReactor

func CreateEvidenceReactor(config *Config, stateStore sm.Store, blockStore *store.BlockStore) (*evidence.Reactor, *evidence.Pool, error)

func CreateMempool

func CreateMempool(config *Config, proxyApp proxy.AppConns, state sm.State) mempl.Mempool

func CreateSwitch

func CreateSwitch(config *Config,
	transport p2p.Transport,
	bcReactor p2p.Reactor,
	nodeInfo p2p.NodeInfo,
	nodeKey *p2p.NodeKey,
	logger cometLog.Logger) *p2p.Switch

func DefaultDBProvider

func DefaultDBProvider(ctx *DBContext) (dbm.DB, error)

func DoHandshake

func DoHandshake(
	stateStore sm.Store,
	state sm.State,
	blockStore sm.BlockStore,
	genDoc *GenesisDoc,
	eventBus cometTypes.BlockEventPublisher,
	proxyApp proxy.AppConns,
) error

func GetBlockstoreDBs

func GetBlockstoreDBs(config *Config) (dbm.DB, *store.BlockStore, error)

func GetStateDBs

func GetStateDBs(config *Config) (dbm.DB, state.Store, error)

func KsyncLogger

func KsyncLogger(moduleName string) zerolog.Logger

func LoadConfig

func LoadConfig(homePath string) (*cfg.Config, error)

func LogFormatter

func LogFormatter(keyvals ...interface{}) zerolog.Logger

func MakeNodeInfo

func MakeNodeInfo(
	config *Config,
	nodeKey *p2p.NodeKey,
	genDoc *GenesisDoc,
) (p2p.NodeInfo, error)

Types

type Block

type Block = cometTypes.Block

type BlockchainReactor

type BlockchainReactor struct {
	p2p.BaseReactor
	// contains filtered or unexported fields
}

func NewBlockchainReactor

func NewBlockchainReactor(block *Block, nextBlock *Block) *BlockchainReactor

func (*BlockchainReactor) GetChannels

func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor

func (*BlockchainReactor) ReceiveEnvelope

func (bcR *BlockchainReactor) ReceiveEnvelope(e p2p.Envelope)

type CometEngine

type CometEngine struct {
	// contains filtered or unexported fields
}

func (*CometEngine) ApplyBlock

func (comet *CometEngine) ApplyBlock(runtime string, value []byte) error

func (*CometEngine) ApplyFirstBlockOverP2P

func (comet *CometEngine) ApplyFirstBlockOverP2P(runtime string, value, nextValue []byte) error

func (*CometEngine) ApplySnapshotChunk

func (comet *CometEngine) ApplySnapshotChunk(chunkIndex uint32, value []byte) (string, error)

func (*CometEngine) BootstrapState

func (comet *CometEngine) BootstrapState(value []byte) error

func (*CometEngine) CloseDBs

func (comet *CometEngine) CloseDBs() error

func (*CometEngine) DoHandshake

func (comet *CometEngine) DoHandshake() error

func (*CometEngine) GetAppHeight

func (comet *CometEngine) GetAppHeight() (int64, error)

func (*CometEngine) GetBaseHeight

func (comet *CometEngine) GetBaseHeight() int64

func (*CometEngine) GetBlock

func (comet *CometEngine) GetBlock(height int64) ([]byte, error)

func (*CometEngine) GetChainId

func (comet *CometEngine) GetChainId() (string, error)

func (*CometEngine) GetContinuationHeight

func (comet *CometEngine) GetContinuationHeight() (int64, error)

func (*CometEngine) GetGenesisHeight

func (comet *CometEngine) GetGenesisHeight() (int64, error)

func (*CometEngine) GetGenesisPath

func (comet *CometEngine) GetGenesisPath() string

func (*CometEngine) GetHeight

func (comet *CometEngine) GetHeight() int64

func (*CometEngine) GetHomePath

func (comet *CometEngine) GetHomePath() string

func (*CometEngine) GetMetrics

func (comet *CometEngine) GetMetrics() ([]byte, error)

func (*CometEngine) GetName

func (comet *CometEngine) GetName() string

func (*CometEngine) GetProxyAppAddress

func (comet *CometEngine) GetProxyAppAddress() string

func (*CometEngine) GetSeenCommit

func (comet *CometEngine) GetSeenCommit(height int64) ([]byte, error)

func (*CometEngine) GetSnapshotChunk

func (comet *CometEngine) GetSnapshotChunk(height, format, chunk int64) ([]byte, error)

func (*CometEngine) GetSnapshots

func (comet *CometEngine) GetSnapshots() ([]byte, error)

func (*CometEngine) GetState

func (comet *CometEngine) GetState(height int64) ([]byte, error)

func (*CometEngine) IsSnapshotAvailable

func (comet *CometEngine) IsSnapshotAvailable(height int64) (bool, error)

func (*CometEngine) OfferSnapshot

func (comet *CometEngine) OfferSnapshot(value []byte) (string, uint32, error)

func (*CometEngine) OpenDBs

func (comet *CometEngine) OpenDBs(homePath string) error

func (*CometEngine) PruneBlocks

func (comet *CometEngine) PruneBlocks(toHeight int64) error

func (*CometEngine) ResetAll

func (comet *CometEngine) ResetAll(homePath string, keepAddrBook bool) error

func (*CometEngine) StartProxyApp

func (comet *CometEngine) StartProxyApp() error

func (*CometEngine) StopProxyApp

func (comet *CometEngine) StopProxyApp() error

type Config

type Config = cometCfg.Config

type DBContext

type DBContext struct {
	ID     string
	Config *Config
}

type GenesisDoc

type GenesisDoc = cometTypes.GenesisDoc

type KsyncCometLogger

type KsyncCometLogger struct {
	// contains filtered or unexported fields
}

func (KsyncCometLogger) Debug

func (l KsyncCometLogger) Debug(msg string, keyvals ...interface{})

func (KsyncCometLogger) Error

func (l KsyncCometLogger) Error(msg string, keyvals ...interface{})

func (KsyncCometLogger) Info

func (l KsyncCometLogger) Info(msg string, keyvals ...interface{})

func (KsyncCometLogger) With

func (l KsyncCometLogger) With(keyvals ...interface{}) (logger log.Logger)

type LightBlock

type LightBlock = cometTypes.LightBlock

type Metrics

type Metrics struct {
	LatestBlockHash     string    `json:"latest_block_hash"`
	LatestAppHash       string    `json:"latest_app_hash"`
	LatestBlockHeight   int64     `json:"latest_block_height"`
	LatestBlockTime     time.Time `json:"latest_block_time"`
	EarliestBlockHash   string    `json:"earliest_block_hash"`
	EarliestAppHash     string    `json:"earliest_app_hash"`
	EarliestBlockHeight int64     `json:"earliest_block_height"`
	EarliestBlockTime   time.Time `json:"earliest_block_time"`
	CatchingUp          bool      `json:"catching_up"`
}

type Snapshot

type Snapshot = abciTypes.Snapshot

type TendermintBsyncBundle

type TendermintBsyncBundle = []TendermintBsyncDataItem

type TendermintBsyncDataItem

type TendermintBsyncDataItem struct {
	Key   string `json:"key"`
	Value *Block `json:"value"`
}

type TendermintBundle

type TendermintBundle = []TendermintDataItem

type TendermintDataItem

type TendermintDataItem struct {
	Key   string          `json:"key"`
	Value TendermintValue `json:"value"`
}

type TendermintSsyncBundle

type TendermintSsyncBundle = []TendermintSsyncDataItem

type TendermintSsyncDataItem

type TendermintSsyncDataItem struct {
	Key   string `json:"key"`
	Value struct {
		Snapshot   *abciTypes.Snapshot `json:"snapshot"`
		Block      *Block              `json:"block"`
		SeenCommit *cometTypes.Commit  `json:"seenCommit"`
		State      *cometState.State   `json:"state"`
		ChunkIndex uint32              `json:"chunkIndex"`
		Chunk      []byte              `json:"chunk"`
	} `json:"value"`
}

type TendermintValue

type TendermintValue struct {
	Block struct {
		Block *Block `json:"block"`
	} `json:"block"`
}

Jump to

Keyboard shortcuts

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