Versions in this module Expand all Collapse all v3 v3.0.1 Dec 27, 2023 v3.0.0 Dec 23, 2022 Changes in this version + var BlockchainId = "chain1" + var CoreEngines = []protocol.CoreEngine + var ListenAddrs = []string + var NodeNums = 4 + var Seeds = []string + func ConsensusTypeFromInt(configType int32) (consensusPb.ConsensusType, error) + func GetBlockFromMockCache(blockHash string, height uint64) *common.Block + func InConsensusSlice(need consensus.ConsensusType, typeArr []consensus.ConsensusType) bool + func InitChainConfig(chainId string, consensusType consensusPb.ConsensusType, nodeNum int) *configPb.ChainConfig + func InitLocalConfig(nodeNum int) + func InitLocalConfigs() error + func NewCache(chainId string) protocol.LedgerCache + func NewNet(keyPath, certPath string, config *TestNodeConfig) (protocol.Net, error) + func NewNetService(net protocol.Net, chainId string, ac protocol.AccessControlProvider, ...) (protocol.NetService, error) + func NewNetServiceForTest() protocol.NetService + func NewProposalCache(chainConf protocol.ChainConf, ledgerCache protocol.LedgerCache) protocol.ProposalCache + func RemoveLocalConfigs() + func SetBlockToMockCache(block *common.Block, blockHash string, height uint64) + func SetTxSizeAndTxNum(size, num int) + type Cache struct + func (c *Cache) CurrentHeight() (uint64, error) + func (c *Cache) GetLastCommittedBlock() *commonPb.Block + func (c *Cache) SetLastCommittedBlock(b *commonPb.Block) + type ChainConfImplForTest struct + ChainConf *configPb.ChainConfig + func (cc *ChainConfImplForTest) AddVmWatch(w protocol.VmWatcher) + func (cc *ChainConfImplForTest) AddWatch(w protocol.Watcher) + func (cc *ChainConfImplForTest) ChainConfig() *configPb.ChainConfig + func (cc *ChainConfImplForTest) CompleteBlock(block *commonPb.Block) error + func (cc *ChainConfImplForTest) GetChainConfigAt(blockHeight uint64) (*configPb.ChainConfig, error) + func (cc *ChainConfImplForTest) GetChainConfigFromFuture(blockHeight uint64) (*configPb.ChainConfig, error) + func (cc *ChainConfImplForTest) GetConsensusNodeIdList() ([]string, error) + func (cc *ChainConfImplForTest) Init() error + func (cc *ChainConfImplForTest) SetChainConfig(chainConf *configPb.ChainConfig) error + type ClusterTestNode struct + func NewClusterTestNode(consensusType consensusPb.ConsensusType, config *TestNodeConfig, ...) (*ClusterTestNode, error) + func (tn *ClusterTestNode) Start() + func (tn *ClusterTestNode) Stop() + type ConfigData struct + Data string + Path string + type ConsensusArgs func(cfg *configPb.ChainConfig) []byte + type CoreEngineForTest struct + func NewCoreEngineForTest(tnc *TestNodeConfig, log protocol.Logger) *CoreEngineForTest + func (ce *CoreEngineForTest) CalcTime() + func (ce *CoreEngineForTest) CalcTimeForMaxbft() + func (ce *CoreEngineForTest) GetBlockCommitter() protocol.BlockCommitter + func (ce *CoreEngineForTest) GetBlockProposer() protocol.BlockProposer + func (ce *CoreEngineForTest) GetBlockVerifier() protocol.BlockVerifier + func (ce *CoreEngineForTest) GetMaxbftHelper() protocol.MaxbftHelper + func (ce *CoreEngineForTest) OnMessage(message *msgbus.Message) + func (ce *CoreEngineForTest) OnQuit() + func (ce *CoreEngineForTest) Start() + func (ce *CoreEngineForTest) Stop() + type MaxbftHelper struct + func (mh *MaxbftHelper) DiscardBlocks(baseHeight uint64) + type NetEngineForTest struct + func NewNetEngineForTest(chainId, nodeId string, msgBus msgbus.MessageBus, tf *TestClusterFramework, ...) *NetEngineForTest + func (ne *NetEngineForTest) OnMessage(message *msgbus.Message) + func (ne *NetEngineForTest) OnQuit() + func (ne *NetEngineForTest) Start() + func (ne *NetEngineForTest) Stop() + type ProposalCache struct + func (pc *ProposalCache) ClearProposedBlockAt(height uint64) + func (pc *ProposalCache) ClearTheBlock(block *commonpb.Block) + func (pc *ProposalCache) DiscardBlocks(baseHeight uint64) []*commonpb.Block + func (pc *ProposalCache) GetProposedBlock(b *commonpb.Block) (*commonpb.Block, map[string]*commonpb.TxRWSet, ...) + func (pc *ProposalCache) GetProposedBlockByHashAndHeight(hash []byte, height uint64) (*commonpb.Block, map[string]*commonpb.TxRWSet) + func (pc *ProposalCache) GetProposedBlocksAt(height uint64) []*commonpb.Block + func (pc *ProposalCache) GetSelfProposedBlockAt(height uint64) *commonpb.Block + func (pc *ProposalCache) HasProposedBlockAt(height uint64) bool + func (pc *ProposalCache) IsProposedAt(height uint64) bool + func (pc *ProposalCache) KeepProposedBlock(hash []byte, height uint64) []*commonpb.Block + func (pc *ProposalCache) ResetProposedAt(height uint64) + func (pc *ProposalCache) SetProposedAt(height uint64) + func (pc *ProposalCache) SetProposedBlock(b *commonpb.Block, rwSetMap map[string]*commonpb.TxRWSet, ...) error + type ProposerForTest struct + func (p *ProposerForTest) ProposeBlock(proposal *maxbft.BuildProposal) (*consensusPb.ProposalBlock, error) + type TestClusterFramework struct + func NewTestClusterFramework(chainId string, consensusType consensusPb.ConsensusType, nodeNum int, ...) (*TestClusterFramework, error) + func (tf *TestClusterFramework) Start() + func (tf *TestClusterFramework) Stop() + type TestFramework struct + func NewTestFramework(chainId string, index int, consensusType consensusPb.ConsensusType, ...) (*TestFramework, error) + func (tf *TestFramework) Start() + func (tf *TestFramework) Stop() + type TestNode struct + func NewTestNode(consensusType consensusPb.ConsensusType, config *TestNodeConfig, ...) (*TestNode, error) + func (tn *TestNode) Start() + func (tn *TestNode) Stop() + type TestNodeConfig struct + Ac protocol.AccessControlProvider + BlockchainStore protocol.BlockchainStore + ChainConf protocol.ChainConf + ChainID string + ConsensusType consensusPb.ConsensusType + GenesisBlock *commonPb.Block + LedgerCache protocol.LedgerCache + ListenAddr string + Log protocol.Logger + MsgBus msgbus.MessageBus + NodeId string + ProposalCache protocol.ProposalCache + Seeds []string + Signer protocol.SigningMember + func CreateTestNodeConfig(ctrl *gomock.Controller, chainId string, consensusType consensus.ConsensusType, ...) ([]*TestNodeConfig, error) Other modules containing this package chainmaker.org/chainmaker/consensus-utils/v2