Documentation ¶
Index ¶
- Constants
- Variables
- func ConsensusName() string
- func DecorateBlockRewardFn(fn BlockRewardFn)
- func Init(maxBlkBodySize uint32, coinbaseAccountStr string, isBp bool, ...) error
- func InitGenesisBPs(states *state.StateDB, genesis *types.Genesis) error
- func IsPublic() bool
- func MaxBlockBodySize() uint32
- func MaxBlockSize() uint32
- func RecoverExit()
- type BlockReader
- type BlockRewardFn
- type BlockValidator
- func (bv *BlockValidator) Stop()
- func (bv *BlockValidator) ValidateBlock(block *types.Block) error
- func (bv *BlockValidator) ValidateBody(block *types.Block) error
- func (bv *BlockValidator) ValidateHeader(header *types.BlockHeader) error
- func (bv *BlockValidator) ValidatePost(sdbRoot []byte, receipts *types.Receipts, block *types.Block) error
- func (bv *BlockValidator) WaitVerifyDone() error
- type ChainAnchor
- type ChainDB
- func (cdb *ChainDB) ClearWAL()
- func (cdb *ChainDB) Close()
- func (cdb *ChainDB) Get(key []byte) []byte
- func (cdb *ChainDB) GetBestBlock() (*types.Block, error)
- func (cdb *ChainDB) GetBlock(blockHash []byte) (*types.Block, error)
- func (cdb *ChainDB) GetBlockByNo(blockNo types.BlockNo) (*types.Block, error)
- func (cdb *ChainDB) GetChainTree() ([]byte, error)
- func (cdb *ChainDB) GetConfChangeProgress(id uint64) (*types.ConfChangeProgress, error)
- func (cdb *ChainDB) GetGenesisInfo() *types.Genesis
- func (cdb *ChainDB) GetHardState() (*raftpb.HardState, error)
- func (cdb *ChainDB) GetHashByNo(blockNo types.BlockNo) ([]byte, error)
- func (cdb *ChainDB) GetIdentity() (*consensus.RaftIdentity, error)
- func (cdb *ChainDB) GetRaftEntry(idx uint64) (*consensus.WalEntry, error)
- func (cdb *ChainDB) GetRaftEntryIndexOfBlock(hash []byte) (uint64, error)
- func (cdb *ChainDB) GetRaftEntryLastIdx() (uint64, error)
- func (cdb *ChainDB) GetRaftEntryOfBlock(hash []byte) (*consensus.WalEntry, error)
- func (cdb *ChainDB) GetSnapshot() (*raftpb.Snapshot, error)
- func (cdb *ChainDB) Hardfork(hConfig config.HardforkConfig) config.HardforkDbConfig
- func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error)
- func (cdb *ChainDB) Init(dbType string, dataDir string) error
- func (cdb *ChainDB) IsNew() bool
- func (cdb *ChainDB) NewTx() db.Transaction
- func (cdb *ChainDB) ResetBest(resetNo types.BlockNo) error
- func (cdb *ChainDB) ResetWAL(hardStateInfo *types.HardStateInfo) error
- func (cdb *ChainDB) WriteConfChangeProgress(id uint64, progress *types.ConfChangeProgress) error
- func (cdb *ChainDB) WriteHardState(hardstate *raftpb.HardState) error
- func (cdb *ChainDB) WriteHardfork(c *config.HardforkConfig) error
- func (cdb *ChainDB) WriteIdentity(identity *consensus.RaftIdentity) error
- func (cdb *ChainDB) WriteRaftEntry(ents []*consensus.WalEntry, blocks []*types.Block, ...) error
- func (cdb *ChainDB) WriteSnapshot(snap *raftpb.Snapshot) error
- type ChainInfo
- type ChainManager
- type ChainService
- func (cs *ChainService) AfterStart()
- func (cs *ChainService) BeforeStart()
- func (cs *ChainService) BeforeStop()
- func (cs *ChainService) CDB() consensus.ChainDB
- func (cs *ChainService) ChainID(bno types.BlockNo) *types.ChainID
- func (cs *ChainService) ConsensusType() string
- func (cs *ChainService) CountTxsInChain() int
- func (cs *ChainService) GetBestBlock() (*types.Block, error)
- func (cs *ChainService) GetBlock(blockHash []byte) (*types.Block, error)
- func (cs *ChainService) GetChainStats() string
- func (cs *ChainService) GetChainTree() ([]byte, error)
- func (cs *ChainService) GetConsensusInfo() string
- func (cs *ChainService) GetEnterpriseConfig(key string) (*types.EnterpriseConfig, error)
- func (cs *ChainService) GetGenesisInfo() *types.Genesis
- func (cs *ChainService) GetHashByNo(blockNo types.BlockNo) ([]byte, error)
- func (cs *ChainService) GetSystemValue(key types.SystemValue) (*big.Int, error)
- func (cs *ChainService) IsPublic() bool
- func (cs *ChainService) Receive(context actor.Context)
- func (cs *ChainService) Recover() error
- func (cs *ChainService) SDB() *state.ChainStateDB
- func (cs *ChainService) SetChainConsensus(cc consensus.ChainConsensus)
- func (cs *ChainService) Statistics() *map[string]interface{}
- func (cs *ChainService) WalDB() consensus.ChainWAL
- type ChainTree
- type ChainVerifier
- type ChainWorker
- type Core
- type DebugHandler
- type Debugger
- type ErrBlock
- type ErrDebug
- type ErrDropBlock
- type ErrNoBlock
- type ErrReorg
- type ErrReorgBlock
- type ErrTx
- type IChainHandler
- type OrphanBlock
- type OrphanPool
- type ReorgMarker
- type SignVerifier
- type StopCond
- type StubBlockChain
- func (tchain *StubBlockChain) AddBlock(newBlock *types.Block) error
- func (tchain *StubBlockChain) ChainID(bno types.BlockNo) *types.ChainID
- func (tchain *StubBlockChain) GenAddBlock()
- func (tchain *StubBlockChain) GetAncestorWithHashes(hashes [][]byte) *types.BlockInfo
- func (tchain *StubBlockChain) GetAnchors() (ChainAnchor, types.BlockNo, error)
- func (tchain *StubBlockChain) GetBestBlock() (*types.Block, error)
- func (tchain *StubBlockChain) GetBlock(blockHash []byte) (*types.Block, error)
- func (tchain *StubBlockChain) GetBlockByNo(no uint64) *types.Block
- func (tchain *StubBlockChain) GetBlockInfo(no uint64) *types.BlockInfo
- func (tchain *StubBlockChain) GetBlocks(hashes []message.BlockHash) ([]*types.Block, error)
- func (tchain *StubBlockChain) GetChainStats() string
- func (tchain *StubBlockChain) GetConsensusInfo() string
- func (tchain *StubBlockChain) GetEnterpriseConfig(key string) (*types.EnterpriseConfig, error)
- func (tchain *StubBlockChain) GetGenesisInfo() *types.Genesis
- func (tchain *StubBlockChain) GetHashByNo(blockNo types.BlockNo) ([]byte, error)
- func (tchain *StubBlockChain) GetHashes(prevInfo *types.BlockInfo, count uint64) ([]message.BlockHash, error)
- func (tchain *StubBlockChain) GetSystemValue(key types.SystemValue) (*big.Int, error)
- func (tchain *StubBlockChain) Rollback(ancestor *types.BlockInfo)
- type SubComponent
- type TestStage
- type TxExecFn
- type ValidatePostFn
- type ValidateSignWaitFn
- type VerifyResult
Constants ¶
const ( MaxAnchors = 32 //MaxAnchors = 1000000 Skip = 16 )
const ( // ReorgStat is a constant representing a stat about reorganization. ReorgStat statIndex = iota // MaxStat is a constant representing a value less than which all the // constants corresponding chain stats must be. MaxStat )
const (
DEBUG_CHAIN_STOP_INF = DEBUG_RAFT_SNAP_FREQ
)
const MaxEventSize = 4 * 1024 * 1024
Variables ¶
var ( ErrorBlockVerifySign = errors.New("Block verify failed") ErrorBlockVerifyTxRoot = errors.New("Block verify failed, because Tx root hash is invalid") ErrorBlockVerifyExistStateRoot = errors.New("Block verify failed, because state root hash is already exist") ErrorBlockVerifyStateRoot = errors.New("Block verify failed, because state root hash is not equal") ErrorBlockVerifyReceiptRoot = errors.New("Block verify failed, because receipt root hash is not equal") )
var ( // ErrNoChainDB reports chaindb is not prepared. ErrNoChainDB = fmt.Errorf("chaindb not prepared") ErrorLoadBestBlock = errors.New("failed to load latest block from DB") ErrCantDropGenesis = errors.New("can't drop genesis block") ErrTooBigResetHeight = errors.New("reset height is too big") ErrWalNoHardState = errors.New("not exist hard state") ErrInvalidHardState = errors.New("invalid hard state") ErrInvalidRaftSnapshot = errors.New("invalid raft snapshot") ErrInvalidCCProgress = errors.New("invalid conf change progress") )
var ( ErrMismatchedEntry = errors.New("mismatched entry") ErrNoWalEntry = errors.New("no entry") ErrEncodeRaftIdentity = errors.New("failed encoding of raft identity") ErrDecodeRaftIdentity = errors.New("failed decoding of raft identity") ErrNoWalEntryForBlock = errors.New("no raft entry for block") ErrNilHardState = errors.New("hardstateinfo must not be nil") )
var ( ErrWalNotEqualIdentityName = errors.New("name of identity is not equal") ErrWalNotEqualIdentityPeerID = errors.New("peerid of identity is not equal") )
var ( ErrorNoAncestor = errors.New("not found ancestor") ErrBlockOrphan = errors.New("block is ohphan, so not connected in chain") ErrBlockCachedErrLRU = errors.New("block is in errored blocks cache") ErrStateNoMarker = errors.New("statedb marker of block is not exists") InAddBlock = make(chan struct{}, 1) SendBlockReward = sendRewardCoinbase )
var ( ErrNotSupportedConsensus = errors.New("not supported by this consensus") ErrRecoNoBestStateRoot = errors.New("state root of best block is not exist") ErrRecoInvalidSdbRoot = errors.New("state root of sdb is invalid") TestDebugger *Debugger )
var ( CoinbaseAccount []byte MaxAnchorCount int VerifierCount int Genesis *types.Genesis )
var ( // ErrInvalidCoinbaseAccount is returned by Init when the coinbase account // address is invalid. ErrInvalidCoinbaseAccount = errors.New("invalid coinbase account in config") ErrInvalidConsensus = errors.New("invalid consensus name from genesis") )
var ( EnvNameStaticCrash = "DEBUG_CHAIN_CRASH" // 1 ~ 4 EnvNameRandomCrashTime = "DEBUG_RANDOM_CRASH_TIME" // 1 ~ 600000(=10min) ms EnvNameChainBPSleep = "DEBUG_CHAIN_BP_SLEEP" // bp node sleeps before connecting block for each block (ms). used EnvNameChainOtherSleep = "DEBUG_CHAIN_OTHER_SLEEP" // non bp node sleeps before connecting block for each block (ms). EnvNameSyncCrash = "DEBUG_SYNCER_CRASH" // case 1 EnvNameRaftSnapFreq = "DEBUG_RAFT_SNAP_FREQ" // case 1 )
var ( DfltOrphanPoolSize = 100 ErrRemoveOldestOrphan = errors.New("failed to remove oldest orphan block") ErrNotExistOrphanLRU = errors.New("given orphan doesn't exist in lru") )
var ( ErrInvalidPrevHash = errors.New("no of previous hash block is invalid") ErrRecoInvalidBest = errors.New("best block is not equal to old chain") )
var ( ErrInvalidReorgMarker = errors.New("reorg marker is invalid") ErrMarkerNil = errors.New("reorg marker is nil") )
var ( ErrInvalidBranchRoot = errors.New("best block can't be branch root block") ErrGatherChain = errors.New("new/old blocks must exist") ErrNotExistBranchRoot = errors.New("branch root block doesn't exist") ErrInvalidSwapChain = errors.New("New chain is not longer than old chain") ErrInvalidBlockHeader = errors.New("invalid block header") )
var ( ErrNotExistHash = errors.New("not exist hash") ErrNotExistBlock = errors.New("not exist block of the hash") )
var (
ErrTxFormatInvalid = errors.New("tx invalid format")
)
var TestStageStr = []string{
"Test if previous block exist",
"Test if target block exist",
"Test if block execution succeed",
"All tests completed",
}
Functions ¶
func ConsensusName ¶
func ConsensusName() string
func DecorateBlockRewardFn ¶
func DecorateBlockRewardFn(fn BlockRewardFn)
func Init ¶
func Init(maxBlkBodySize uint32, coinbaseAccountStr string, isBp bool, maxAnchorCount int, verifierCount int) error
Init initializes the blockchain-related parameters.
func InitGenesisBPs ¶
InitGenesisBPs opens system contract and put initial voting result it also set *State in Genesis to use statedb
func MaxBlockBodySize ¶
func MaxBlockBodySize() uint32
MaxBlockBodySize returns the max block body size.
func RecoverExit ¶
func RecoverExit()
Types ¶
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
type BlockRewardFn ¶
type BlockRewardFn = func(*state.BlockState, []byte) error
type BlockValidator ¶
type BlockValidator struct {
// contains filtered or unexported fields
}
func NewBlockValidator ¶
func NewBlockValidator(comm component.IComponentRequester, sdb *state.ChainStateDB, verbose bool) *BlockValidator
func (*BlockValidator) Stop ¶
func (bv *BlockValidator) Stop()
func (*BlockValidator) ValidateBlock ¶
func (bv *BlockValidator) ValidateBlock(block *types.Block) error
func (*BlockValidator) ValidateBody ¶
func (bv *BlockValidator) ValidateBody(block *types.Block) error
func (*BlockValidator) ValidateHeader ¶
func (bv *BlockValidator) ValidateHeader(header *types.BlockHeader) error
func (*BlockValidator) ValidatePost ¶
func (*BlockValidator) WaitVerifyDone ¶
func (bv *BlockValidator) WaitVerifyDone() error
type ChainAnchor ¶
type ChainAnchor []([]byte)
type ChainDB ¶
type ChainDB struct {
// contains filtered or unexported fields
}
func NewChainDB ¶
func NewChainDB() *ChainDB
func (*ChainDB) GetBlockByNo ¶
GetBlockByNo returns the block of which number is blockNo.
func (*ChainDB) GetChainTree ¶
func (*ChainDB) GetConfChangeProgress ¶
func (cdb *ChainDB) GetConfChangeProgress(id uint64) (*types.ConfChangeProgress, error)
func (*ChainDB) GetGenesisInfo ¶
GetGenesisInfo returns Genesis info, which is read from cdb.
func (*ChainDB) GetHashByNo ¶
func (*ChainDB) GetIdentity ¶
func (cdb *ChainDB) GetIdentity() (*consensus.RaftIdentity, error)
func (*ChainDB) GetRaftEntry ¶
func (*ChainDB) GetRaftEntryIndexOfBlock ¶
func (*ChainDB) GetRaftEntryLastIdx ¶
func (*ChainDB) GetRaftEntryOfBlock ¶
func (*ChainDB) Hardfork ¶
func (cdb *ChainDB) Hardfork(hConfig config.HardforkConfig) config.HardforkDbConfig
func (*ChainDB) HasWal ¶
func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error)
HasWal checks chaindb has valid status of Raft WAL. 1. compare identity with config 2. check if hardstate exists 3. check if last raft entiry index exists last entry index can be 0 if first sync has failed
func (*ChainDB) NewTx ¶
func (cdb *ChainDB) NewTx() db.Transaction
NewTx returns a new chain DB Transaction.
func (*ChainDB) ResetBest ¶
ResetBest reset best block of chain db manually remove blocks from original best to resetNo.
*Caution*: This API is dangerous. It must be used for test blockchain only.
func (*ChainDB) WriteConfChangeProgress ¶
func (cdb *ChainDB) WriteConfChangeProgress(id uint64, progress *types.ConfChangeProgress) error
func (*ChainDB) WriteHardState ¶
func (*ChainDB) WriteHardfork ¶
func (cdb *ChainDB) WriteHardfork(c *config.HardforkConfig) error
func (*ChainDB) WriteIdentity ¶
func (cdb *ChainDB) WriteIdentity(identity *consensus.RaftIdentity) error
func (*ChainDB) WriteRaftEntry ¶
type ChainManager ¶
type ChainManager struct { *SubComponent IChainHandler //to use chain APIs *Core // TODO remove after moving GetQuery to ChainWorker }
func (*ChainManager) Receive ¶
func (cm *ChainManager) Receive(context actor.Context)
type ChainService ¶
type ChainService struct { *component.BaseComponent consensus.ChainConsensus *Core // contains filtered or unexported fields }
ChainService manage connectivity of blocks
func NewChainService ¶
func NewChainService(cfg *cfg.Config) *ChainService
NewChainService creates an instance of ChainService.
func (*ChainService) BeforeStart ¶
func (cs *ChainService) BeforeStart()
BeforeStart initialize chain database and generate empty genesis block if necessary
func (*ChainService) BeforeStop ¶
func (cs *ChainService) BeforeStop()
BeforeStop close chain database and stop BlockValidator
func (*ChainService) CDB ¶
func (cs *ChainService) CDB() consensus.ChainDB
CDB returns cs.sdb as a consensus.ChainDbReader.
func (*ChainService) ConsensusType ¶
func (cs *ChainService) ConsensusType() string
func (*ChainService) CountTxsInChain ¶
func (cs *ChainService) CountTxsInChain() int
func (*ChainService) GetBestBlock ¶
func (cs *ChainService) GetBestBlock() (*types.Block, error)
func (*ChainService) GetBlock ¶
func (cs *ChainService) GetBlock(blockHash []byte) (*types.Block, error)
func (*ChainService) GetChainStats ¶
func (cs *ChainService) GetChainStats() string
func (*ChainService) GetChainTree ¶
func (cs *ChainService) GetChainTree() ([]byte, error)
func (*ChainService) GetConsensusInfo ¶
func (cs *ChainService) GetConsensusInfo() string
GetConsensusInfo returns consensus-related information, which is different from consensus to consensus.
func (*ChainService) GetEnterpriseConfig ¶
func (cs *ChainService) GetEnterpriseConfig(key string) (*types.EnterpriseConfig, error)
GetEnterpriseConfig return EnterpiseConfig. if the given key does not exist, fill EnterpriseConfig with only the key and return
func (*ChainService) GetGenesisInfo ¶
func (cs *ChainService) GetGenesisInfo() *types.Genesis
GetGenesisInfo returns the information on the genesis block.
func (*ChainService) GetHashByNo ¶
func (cs *ChainService) GetHashByNo(blockNo types.BlockNo) ([]byte, error)
func (*ChainService) GetSystemValue ¶
func (cs *ChainService) GetSystemValue(key types.SystemValue) (*big.Int, error)
func (*ChainService) IsPublic ¶
func (cs *ChainService) IsPublic() bool
func (*ChainService) Receive ¶
func (cs *ChainService) Receive(context actor.Context)
Receive actor message
func (*ChainService) Recover ¶
func (cs *ChainService) Recover() error
Recover has 2 situation
- normal recovery normal recovery recovers error that has occurs while adding single block
- reorg recovery reorg recovery recovers error that has occurs while executing reorg
func (*ChainService) SetChainConsensus ¶
func (cs *ChainService) SetChainConsensus(cc consensus.ChainConsensus)
SetChainConsensus sets cs.cc to cc.
func (*ChainService) Statistics ¶
func (cs *ChainService) Statistics() *map[string]interface{}
func (*ChainService) WalDB ¶
func (cs *ChainService) WalDB() consensus.ChainWAL
WalDB returns cs.sdb as a consensus.ChainDbReader.
type ChainVerifier ¶
type ChainVerifier struct { *SubComponent IChainHandler //to use chain APIs *Core // contains filtered or unexported fields }
func (*ChainVerifier) IsRunning ¶
func (cv *ChainVerifier) IsRunning() bool
func (*ChainVerifier) Receive ¶
func (cv *ChainVerifier) Receive(context actor.Context)
func (*ChainVerifier) Statistics ¶
func (cv *ChainVerifier) Statistics() *map[string]interface{}
func (*ChainVerifier) VerifyBlockWithReport ¶
func (cv *ChainVerifier) VerifyBlockWithReport() error
func (*ChainVerifier) VerifyChain ¶
func (cv *ChainVerifier) VerifyChain() error
type ChainWorker ¶
type ChainWorker struct { *SubComponent IChainHandler //to use chain APIs *Core }
func (*ChainWorker) Receive ¶
func (cw *ChainWorker) Receive(context actor.Context)
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core represents a storage layer of a blockchain (chain & state DB).
func NewCore ¶
func NewCore(dbType string, dataDir string, testModeOn bool, forceResetHeight types.BlockNo) (*Core, error)
NewCore returns an instance of Core.
func (*Core) GetGenesisInfo ¶
type DebugHandler ¶
type Debugger ¶
type ErrDropBlock ¶
type ErrDropBlock struct {
// contains filtered or unexported fields
}
func (*ErrDropBlock) Error ¶
func (err *ErrDropBlock) Error() string
type ErrNoBlock ¶
type ErrNoBlock struct {
// contains filtered or unexported fields
}
ErrNoBlock reports there is no such a block with id (hash or block number).
func (ErrNoBlock) Error ¶
func (e ErrNoBlock) Error() string
type ErrReorgBlock ¶
type ErrReorgBlock struct {
// contains filtered or unexported fields
}
func (*ErrReorgBlock) Error ¶
func (ec *ErrReorgBlock) Error() string
type IChainHandler ¶
type IChainHandler interface {
// contains filtered or unexported methods
}
type OrphanBlock ¶
type OrphanPool ¶
func NewOrphanPool ¶
func NewOrphanPool(size int) *OrphanPool
type ReorgMarker ¶
type ReorgMarker struct { BrStartHash []byte BrStartNo types.BlockNo BrBestHash []byte BrBestNo types.BlockNo BrTopHash []byte BrTopNo types.BlockNo // contains filtered or unexported fields }
func NewReorgMarker ¶
func NewReorgMarker(reorg *reorganizer) *ReorgMarker
func (*ReorgMarker) RecoverChainMapping ¶
func (rm *ReorgMarker) RecoverChainMapping(cdb *ChainDB) error
RecoverChainMapping rollback chain (no/hash) mapping to old chain of reorg. it is required for LIB loading
type SignVerifier ¶
type SignVerifier struct {
// contains filtered or unexported fields
}
func NewSignVerifier ¶
func NewSignVerifier(comm component.IComponentRequester, sdb *state.ChainStateDB, workerCnt int, useMempool bool) *SignVerifier
func (*SignVerifier) RequestVerifyTxs ¶
func (sv *SignVerifier) RequestVerifyTxs(txlist *types.TxList)
func (*SignVerifier) SetSkipMempool ¶
func (sv *SignVerifier) SetSkipMempool(val bool)
func (*SignVerifier) Stop ¶
func (sv *SignVerifier) Stop()
func (*SignVerifier) WaitDone ¶
func (sv *SignVerifier) WaitDone() (bool, []error)
type StopCond ¶
type StopCond int
type StubBlockChain ¶
type StubBlockChain struct { Best int Hashes []([]byte) Blocks []*types.Block BestBlock *types.Block }
StubSyncer receive Syncer, P2P, Chain Service actor message
func InitStubBlockChain ¶
func InitStubBlockChain(prefixChain []*types.Block, genCount int) *StubBlockChain
func NewStubBlockChain ¶
func NewStubBlockChain(size int) *StubBlockChain
func (*StubBlockChain) AddBlock ¶
func (tchain *StubBlockChain) AddBlock(newBlock *types.Block) error
func (*StubBlockChain) ChainID ¶
func (tchain *StubBlockChain) ChainID(bno types.BlockNo) *types.ChainID
func (*StubBlockChain) GenAddBlock ¶
func (tchain *StubBlockChain) GenAddBlock()
func (*StubBlockChain) GetAncestorWithHashes ¶
func (tchain *StubBlockChain) GetAncestorWithHashes(hashes [][]byte) *types.BlockInfo
func (*StubBlockChain) GetAnchors ¶
func (tchain *StubBlockChain) GetAnchors() (ChainAnchor, types.BlockNo, error)
TODO refactoring with getAnchorsNew()
func (*StubBlockChain) GetBestBlock ¶
func (tchain *StubBlockChain) GetBestBlock() (*types.Block, error)
func (*StubBlockChain) GetBlock ¶
func (tchain *StubBlockChain) GetBlock(blockHash []byte) (*types.Block, error)
func (*StubBlockChain) GetBlockByNo ¶
func (tchain *StubBlockChain) GetBlockByNo(no uint64) *types.Block
func (*StubBlockChain) GetBlockInfo ¶
func (tchain *StubBlockChain) GetBlockInfo(no uint64) *types.BlockInfo
func (*StubBlockChain) GetChainStats ¶
func (tchain *StubBlockChain) GetChainStats() string
func (*StubBlockChain) GetConsensusInfo ¶
func (tchain *StubBlockChain) GetConsensusInfo() string
func (*StubBlockChain) GetEnterpriseConfig ¶
func (tchain *StubBlockChain) GetEnterpriseConfig(key string) (*types.EnterpriseConfig, error)
func (*StubBlockChain) GetGenesisInfo ¶
func (tchain *StubBlockChain) GetGenesisInfo() *types.Genesis
func (*StubBlockChain) GetHashByNo ¶
func (tchain *StubBlockChain) GetHashByNo(blockNo types.BlockNo) ([]byte, error)
func (*StubBlockChain) GetSystemValue ¶
func (tchain *StubBlockChain) GetSystemValue(key types.SystemValue) (*big.Int, error)
func (*StubBlockChain) Rollback ¶
func (tchain *StubBlockChain) Rollback(ancestor *types.BlockInfo)
type SubComponent ¶
type SubComponent struct { actor.Actor component.IComponentRequester // use baseComponent to request to other actors // contains filtered or unexported fields }
SubComponent handles message with Receive(), and requests to other actor services with IComponentRequester To use SubComponent, only need to implement Actor interface
func NewSubComponent ¶
func NewSubComponent(subactor actor.Actor, requester *component.BaseComponent, name string, cntWorker int) *SubComponent
func (*SubComponent) Request ¶
func (sub *SubComponent) Request(message interface{}, respondTo *actor.PID)
send message to this subcomponent and reply to actor with pid respondTo
type TxExecFn ¶
type TxExecFn func(bState *state.BlockState, tx types.Transaction) error
func NewTxExecutor ¶
func NewTxExecutor(ccc consensus.ChainConsensusCluster, cdb contract.ChainAccessor, bi *types.BlockHeaderInfo, preloadService int) TxExecFn
NewTxExecutor returns a new TxExecFn.
type ValidatePostFn ¶
type ValidatePostFn func() error
type ValidateSignWaitFn ¶
type ValidateSignWaitFn func() error
type VerifyResult ¶
type VerifyResult struct {
// contains filtered or unexported fields
}