Documentation
¶
Index ¶
- Constants
- func CheckAndUpdateBlockchainDatabaseVersion(ini *sys.Inicnf) error
- type BlockChain
- func (bc *BlockChain) CalculateNextDiffculty(lastestBlock interfacev2.Block) ([]byte, *big.Int, uint32, error)
- func (bc *BlockChain) CalculateNextTargetDiffculty() ([]byte, *big.Int, uint32, error)
- func (b *BlockChain) ChainStateIinitializeCall(func(interfaces.ChainStateOperation))
- func (bc *BlockChain) Close() error
- func (bc *BlockChain) CreateNextBlockByValidateTxs(txlist []interfaces.Transaction) (interfaces.Block, []interfaces.Transaction, uint32, error)
- func (bc *BlockChain) CurrentState() interfaces.ChainState
- func (bc *BlockChain) GetChainEngineKernel() interfaces.ChainEngine
- func (bc *BlockChain) GetLatestAverageFeePurity() uint32
- func (bc *BlockChain) GetRecentArrivedBlocks() []interfaces.Block
- func (bc *BlockChain) InsertBlock(newblock interfaces.Block, origin string) error
- func (bc *BlockChain) LatestBlock() (interfaces.BlockHeadMetaRead, interfaces.BlockHeadMetaRead, error)
- func (bc *BlockChain) LatestDiamond() (*stores.DiamondSmelt, error)
- func (bc *BlockChain) ReadPrev288BlockTimestamp(blockHeight uint64) (uint64, error)
- func (bc *BlockChain) ReplaceChainstate(new *BlockChain)
- func (bc *BlockChain) RollbackToBlockHeight(targetblockheight uint64) (uint64, error)
- func (bc *BlockChain) SetChainEngineKernel(engine interfaces.ChainEngine)
- func (bc *BlockChain) SetConfirmTxIndexer(indexer interfaces.ConfirmTxIndexer)
- func (bc *BlockChain) Start() error
- func (bc *BlockChain) State() interfacev2.ChainState
- func (bc *BlockChain) StateRead() interfaces.ChainStateOperationRead
- func (bc *BlockChain) SubscribeDiamondOnCreate(diamondCh chan *stores.DiamondSmelt)
- func (bc *BlockChain) SubscribeValidatedBlockOnInsert(blockCh chan interfaces.Block)
- func (b *BlockChain) ValidateDiamondCreateAction(action interfaces.Action) error
- func (bc *BlockChain) ValidateTransactionForTxPool(newtx interfaces.Transaction) error
- type BlockChainConfig
Constants ¶
View Source
const (
Time_format_layout = "01/02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func CheckAndUpdateBlockchainDatabaseVersion ¶
Check upgrade database version
Types ¶
type BlockChain ¶
type BlockChain struct {
// contains filtered or unexported fields
}
func NewBlockChain ¶
func NewBlockChain(config *BlockChainConfig) (*BlockChain, error)
func (*BlockChain) CalculateNextDiffculty ¶
func (bc *BlockChain) CalculateNextDiffculty(lastestBlock interfacev2.Block) ([]byte, *big.Int, uint32, error)
func (*BlockChain) CalculateNextTargetDiffculty ¶
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 ¶
func (bc *BlockChain) LatestBlock() (interfaces.BlockHeadMetaRead, interfaces.BlockHeadMetaRead, error)
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) StateRead ¶
func (bc *BlockChain) StateRead() interfaces.ChainStateOperationRead
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
Click to show internal directories.
Click to hide internal directories.