blockchain

package
v0.0.0-...-fc8b1f8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 27 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Time_format_layout = "01/02 15:04:05"
)

Variables

This section is empty.

Functions

func CheckAndUpdateBlockchainDatabaseVersion

func CheckAndUpdateBlockchainDatabaseVersion(ini *sys.Inicnf) error

Check upgrade database version

Types

type BlockChain

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

func NewBlockChain

func NewBlockChain(config *BlockChainConfig) (*BlockChain, error)

func UpdateDatabaseReturnBlockChain

func UpdateDatabaseReturnBlockChain(ini *sys.Inicnf, olddatadir string, maxtarhei uint64, isclosenew bool) (*BlockChain, error)

func (*BlockChain) CalculateNextDiffculty

func (bc *BlockChain) CalculateNextDiffculty(lastestBlock interfacev2.Block) ([]byte, *big.Int, uint32, error)

func (*BlockChain) CalculateNextTargetDiffculty

func (bc *BlockChain) CalculateNextTargetDiffculty() ([]byte, *big.Int, uint32, error)

func (*BlockChain) ChainStateIinitializeCall

func (b *BlockChain) ChainStateIinitializeCall(func(interfaces.ChainStateOperation))

func (*BlockChain) Close

func (bc *BlockChain) Close() error

func (*BlockChain) CreateNextBlockByValidateTxs

func (bc *BlockChain) CreateNextBlockByValidateTxs(txlist []interfaces.Transaction) (interfaces.Block, []interfaces.Transaction, uint32, error)

func (*BlockChain) CurrentState

func (bc *BlockChain) CurrentState() interfaces.ChainState

func (*BlockChain) GetChainEngineKernel

func (bc *BlockChain) GetChainEngineKernel() interfaces.ChainEngine

func (*BlockChain) GetLatestAverageFeePurity

func (bc *BlockChain) GetLatestAverageFeePurity() uint32

func (*BlockChain) GetRecentArrivedBlocks

func (bc *BlockChain) GetRecentArrivedBlocks() []interfaces.Block

func (*BlockChain) InsertBlock

func (bc *BlockChain) InsertBlock(newblock interfaces.Block, origin string) error

interface api

func (*BlockChain) LatestBlock

Latest blocks (confirmed and immature)

func (*BlockChain) LatestDiamond

func (bc *BlockChain) LatestDiamond() (*stores.DiamondSmelt, error)

Latest block diamonds

func (*BlockChain) ReadPrev288BlockTimestamp

func (bc *BlockChain) ReadPrev288BlockTimestamp(blockHeight uint64) (uint64, error)

func (*BlockChain) ReplaceChainstate

func (bc *BlockChain) ReplaceChainstate(new *BlockChain)

Replace yourself

func (*BlockChain) RollbackToBlockHeight

func (bc *BlockChain) RollbackToBlockHeight(targetblockheight uint64) (uint64, error)

func (*BlockChain) SetChainEngineKernel

func (bc *BlockChain) SetChainEngineKernel(engine interfaces.ChainEngine)

func (*BlockChain) SetConfirmTxIndexer

func (bc *BlockChain) SetConfirmTxIndexer(indexer interfaces.ConfirmTxIndexer)

func (*BlockChain) Start

func (bc *BlockChain) Start() error

func (*BlockChain) State

func (bc *BlockChain) State() interfacev2.ChainState

interface api

func (*BlockChain) StateRead

func (*BlockChain) SubscribeDiamondOnCreate

func (bc *BlockChain) SubscribeDiamondOnCreate(diamondCh chan *stores.DiamondSmelt)

func (*BlockChain) SubscribeValidatedBlockOnInsert

func (bc *BlockChain) SubscribeValidatedBlockOnInsert(blockCh chan interfaces.Block)

func (*BlockChain) ValidateDiamondCreateAction

func (b *BlockChain) ValidateDiamondCreateAction(action interfaces.Action) error

func (*BlockChain) ValidateTransactionForTxPool

func (bc *BlockChain) ValidateTransactionForTxPool(newtx interfaces.Transaction) error

type BlockChainConfig

type BlockChainConfig struct {
	Datadir          string
	RollbackToHeight uint64
	// btc move
	DownloadBTCMoveLogUrl     string
	DisableDownloadBTCMoveLog bool // Do not download logs

	// Database rebuild mode
	DatabaseVersionRebuildMode bool
	// contains filtered or unexported fields
}

func NewBlockChainConfig

func NewBlockChainConfig(cnffile *sys.Inicnf) *BlockChainConfig

func NewEmptyBlockChainConfig

func NewEmptyBlockChainConfig() *BlockChainConfig

Jump to

Keyboard shortcuts

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