Documentation ¶
Index ¶
- Constants
- 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 NewNetServiceForTest() protocol.NetService
- func NewProposalCache(chainConf protocol.ChainConf, ledgerCache protocol.LedgerCache) protocol.ProposalCache
- func RemoveLocalConfigs()
- func SetTxSizeAndTxNum(size, num int)
- type BlockchainStoreForTest
- func (b *BlockchainStoreForTest) ArchiveBlock(archiveHeight uint64) error
- func (b *BlockchainStoreForTest) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (b *BlockchainStoreForTest) BlockExists(blockHash []byte) (bool, error)
- func (b *BlockchainStoreForTest) Close() error
- func (b *BlockchainStoreForTest) CommitDbTransaction(txName string) error
- func (b *BlockchainStoreForTest) CreateDatabase(contractName string) error
- func (b *BlockchainStoreForTest) DropDatabase(contractName string) error
- func (b *BlockchainStoreForTest) ExecDdlSql(contractName, sql, version string) error
- func (b *BlockchainStoreForTest) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
- func (b *BlockchainStoreForTest) GetArchivedPivot() uint64
- func (b *BlockchainStoreForTest) GetBlock(height uint64) (*commonPb.Block, error)
- func (b *BlockchainStoreForTest) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
- func (b *BlockchainStoreForTest) GetBlockByTx(txId string) (*commonPb.Block, error)
- func (b *BlockchainStoreForTest) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
- func (b *BlockchainStoreForTest) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error)
- func (b *BlockchainStoreForTest) GetContractByName(name string) (*commonPb.Contract, error)
- func (b *BlockchainStoreForTest) GetContractBytecode(name string) ([]byte, error)
- func (b *BlockchainStoreForTest) GetContractDbName(contractName string) string
- func (b *BlockchainStoreForTest) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
- func (b *BlockchainStoreForTest) GetDBHandle(dbName string) protocol.DBHandle
- func (b *BlockchainStoreForTest) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (b *BlockchainStoreForTest) GetHeightByHash(blockHash []byte) (uint64, error)
- func (b *BlockchainStoreForTest) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
- func (b *BlockchainStoreForTest) GetLastBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreForTest) GetLastChainConfig() (*configPb.ChainConfig, error)
- func (b *BlockchainStoreForTest) GetLastConfigBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreForTest) GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)
- func (b *BlockchainStoreForTest) GetTx(txId string) (*commonPb.Transaction, error)
- func (b *BlockchainStoreForTest) GetTxConfirmedTime(txId string) (int64, error)
- func (b *BlockchainStoreForTest) GetTxHeight(txId string) (uint64, error)
- func (b *BlockchainStoreForTest) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
- func (b *BlockchainStoreForTest) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
- func (b *BlockchainStoreForTest) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
- func (b *BlockchainStoreForTest) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
- func (b *BlockchainStoreForTest) InitGenesis(genesisBlock *storePb.BlockWithRWSet) error
- func (b *BlockchainStoreForTest) PutBlock(block *commonPb.Block, txRWSets []*commonPb.TxRWSet) error
- func (b *BlockchainStoreForTest) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
- func (b *BlockchainStoreForTest) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
- func (b *BlockchainStoreForTest) ReadObject(contractName string, key []byte) ([]byte, error)
- func (b *BlockchainStoreForTest) RestoreBlocks(serializedBlocks [][]byte) error
- func (b *BlockchainStoreForTest) RollbackDbTransaction(txName string) error
- func (b *BlockchainStoreForTest) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
- func (b *BlockchainStoreForTest) SetInitStates(contractName, key string, val []byte)
- func (b *BlockchainStoreForTest) TxExists(txId string) (bool, error)
- type Cache
- type ChainConfImplForTest
- 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
- type ConfigData
- type CoreEngineForTest
- func (ce *CoreEngineForTest) CalcTime()
- func (ce *CoreEngineForTest) GetBlockCommitter() protocol.BlockCommitter
- func (ce *CoreEngineForTest) GetBlockVerifier() protocol.BlockVerifier
- func (ce *CoreEngineForTest) GetHotStuffHelper() protocol.MaxbftHelper
- 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 GetConsensusArg
- type MaxbftHelper
- type NetEngineForTest
- type ProposalCache
- func (pc *ProposalCache) ClearProposedBlockAt(height uint64)
- func (pc *ProposalCache) ClearTheBlock(block *commonpb.Block)
- func (pc *ProposalCache) DiscardAboveHeight(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 TestClusterFramework
- type TestNode
- type TestNodeConfig
Constants ¶
const ( Org1Path = "lh-org1.hercules.org" Org2Path = "lh-org2.hercules.org" Org3Path = "lh-org3.hercules.org" Org4Path = "lh-org4.hercules.org" Org5Path = "lh-org5.hercules.org" Org6Path = "lh-org6.hercules.org" Org7Path = "lh-org7.hercules.org" )
const (
LIMIT_DELIMITER = "/"
)
Variables ¶
This section is empty.
Functions ¶
func InitChainConfig ¶
func InitChainConfig(chainId string, consensusType consensusPb.ConsensusType, nodeNum int) *configPb.ChainConfig
InitChainConfig
func NewCache ¶
func NewCache(chainId string) protocol.LedgerCache
NewLedgerCache get a ledger cache. One ledger cache for one chain.
func NewNetServiceForTest ¶
func NewNetServiceForTest() protocol.NetService
####################################################################################################################
impls NetService for TBFT (only use GetNodeUidByCertId() method)
#################################################################################################################### NewNetServiceForTest
func NewProposalCache ¶
func NewProposalCache(chainConf protocol.ChainConf, ledgerCache protocol.LedgerCache) protocol.ProposalCache
NewProposalCache get a ProposalCache. One ProposalCache for one chain.
Types ¶
type BlockchainStoreForTest ¶
type BlockchainStoreForTest struct {
// contains filtered or unexported fields
}
BlockchainStoreForTest
func NewBlockChainStoreForTest ¶
func NewBlockChainStoreForTest() *BlockchainStoreForTest
NewBlockChainStoreForTest
func (*BlockchainStoreForTest) ArchiveBlock ¶
func (b *BlockchainStoreForTest) ArchiveBlock(archiveHeight uint64) error
ArchiveBlock
func (*BlockchainStoreForTest) BeginDbTransaction ¶
func (b *BlockchainStoreForTest) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
BeginDbTransaction
func (*BlockchainStoreForTest) BlockExists ¶
func (b *BlockchainStoreForTest) BlockExists(blockHash []byte) (bool, error)
BlockExists
func (*BlockchainStoreForTest) CommitDbTransaction ¶
func (b *BlockchainStoreForTest) CommitDbTransaction(txName string) error
CommitDbTransaction
func (*BlockchainStoreForTest) CreateDatabase ¶
func (b *BlockchainStoreForTest) CreateDatabase(contractName string) error
CreateDatabase
func (*BlockchainStoreForTest) DropDatabase ¶
func (b *BlockchainStoreForTest) DropDatabase(contractName string) error
DropDatabase
func (*BlockchainStoreForTest) ExecDdlSql ¶
func (b *BlockchainStoreForTest) ExecDdlSql(contractName, sql, version string) error
ExecDdlSql
func (*BlockchainStoreForTest) GetAccountTxHistory ¶
func (b *BlockchainStoreForTest) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
GetAccountTxHistory
func (*BlockchainStoreForTest) GetArchivedPivot ¶
func (b *BlockchainStoreForTest) GetArchivedPivot() uint64
GetArchivedPivot
func (*BlockchainStoreForTest) GetBlock ¶
func (b *BlockchainStoreForTest) GetBlock(height uint64) (*commonPb.Block, error)
GetBlock
func (*BlockchainStoreForTest) GetBlockByHash ¶
func (b *BlockchainStoreForTest) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
GetBlockByHash
func (*BlockchainStoreForTest) GetBlockByTx ¶
func (b *BlockchainStoreForTest) GetBlockByTx(txId string) (*commonPb.Block, error)
GetBlockByTx
func (*BlockchainStoreForTest) GetBlockHeaderByHeight ¶
func (b *BlockchainStoreForTest) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
GetBlockHeaderByHeight
func (*BlockchainStoreForTest) GetBlockWithRWSets ¶
func (b *BlockchainStoreForTest) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error)
GetBlockWithRWSets
func (*BlockchainStoreForTest) GetContractByName ¶
func (b *BlockchainStoreForTest) GetContractByName(name string) (*commonPb.Contract, error)
GetContractByName
func (*BlockchainStoreForTest) GetContractBytecode ¶
func (b *BlockchainStoreForTest) GetContractBytecode(name string) ([]byte, error)
GetContractBytecode
func (*BlockchainStoreForTest) GetContractDbName ¶
func (b *BlockchainStoreForTest) GetContractDbName(contractName string) string
GetContractDbName
func (*BlockchainStoreForTest) GetContractTxHistory ¶
func (b *BlockchainStoreForTest) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
GetContractTxHistory
func (*BlockchainStoreForTest) GetDBHandle ¶
func (b *BlockchainStoreForTest) GetDBHandle(dbName string) protocol.DBHandle
GetDBHandle
func (*BlockchainStoreForTest) GetDbTransaction ¶
func (b *BlockchainStoreForTest) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
GetDbTransaction
func (*BlockchainStoreForTest) GetHeightByHash ¶
func (b *BlockchainStoreForTest) GetHeightByHash(blockHash []byte) (uint64, error)
GetHeightByHash
func (*BlockchainStoreForTest) GetHistoryForKey ¶
func (b *BlockchainStoreForTest) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
GetHistoryForKey
func (*BlockchainStoreForTest) GetLastBlock ¶
func (b *BlockchainStoreForTest) GetLastBlock() (*commonPb.Block, error)
GetLastBlock
func (*BlockchainStoreForTest) GetLastChainConfig ¶
func (b *BlockchainStoreForTest) GetLastChainConfig() (*configPb.ChainConfig, error)
GetLastChainConfig
func (*BlockchainStoreForTest) GetLastConfigBlock ¶
func (b *BlockchainStoreForTest) GetLastConfigBlock() (*commonPb.Block, error)
GetLastConfigBlock
func (*BlockchainStoreForTest) GetMemberExtraData ¶
func (b *BlockchainStoreForTest) GetMemberExtraData( member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)
GetMemberExtraData
func (*BlockchainStoreForTest) GetTx ¶
func (b *BlockchainStoreForTest) GetTx(txId string) (*commonPb.Transaction, error)
GetTx
func (*BlockchainStoreForTest) GetTxConfirmedTime ¶
func (b *BlockchainStoreForTest) GetTxConfirmedTime(txId string) (int64, error)
GetTxConfirmedTime
func (*BlockchainStoreForTest) GetTxHeight ¶
func (b *BlockchainStoreForTest) GetTxHeight(txId string) (uint64, error)
GetTxHeight
func (*BlockchainStoreForTest) GetTxInfoOnly ¶
func (b *BlockchainStoreForTest) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
GetTxInfoOnly
func (*BlockchainStoreForTest) GetTxRWSet ¶
func (b *BlockchainStoreForTest) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
GetTxRWSet
func (*BlockchainStoreForTest) GetTxRWSetsByHeight ¶
func (b *BlockchainStoreForTest) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
GetTxRWSetsByHeight
func (*BlockchainStoreForTest) GetTxWithInfo ¶
func (b *BlockchainStoreForTest) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
GetTxWithInfo
func (*BlockchainStoreForTest) InitGenesis ¶
func (b *BlockchainStoreForTest) InitGenesis(genesisBlock *storePb.BlockWithRWSet) error
InitGenesis
func (*BlockchainStoreForTest) PutBlock ¶
func (b *BlockchainStoreForTest) PutBlock(block *commonPb.Block, txRWSets []*commonPb.TxRWSet) error
PutBlock
func (*BlockchainStoreForTest) QueryMulti ¶
func (b *BlockchainStoreForTest) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
QueryMulti
func (*BlockchainStoreForTest) QuerySingle ¶
func (b *BlockchainStoreForTest) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
QuerySingle
func (*BlockchainStoreForTest) ReadObject ¶
func (b *BlockchainStoreForTest) ReadObject(contractName string, key []byte) ([]byte, error)
ReadObject
func (*BlockchainStoreForTest) RestoreBlocks ¶
func (b *BlockchainStoreForTest) RestoreBlocks(serializedBlocks [][]byte) error
RestoreBlocks
func (*BlockchainStoreForTest) RollbackDbTransaction ¶
func (b *BlockchainStoreForTest) RollbackDbTransaction(txName string) error
RollbackDbTransaction
func (*BlockchainStoreForTest) SelectObject ¶
func (b *BlockchainStoreForTest) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
SelectObject
func (*BlockchainStoreForTest) SetInitStates ¶
func (b *BlockchainStoreForTest) SetInitStates(contractName, key string, val []byte)
SetInitStates
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
####################################################################################################################
impls LedgerCache (avoid circular references to core module)
#################################################################################################################### Cache is used for cache current block info
func (*Cache) CurrentHeight ¶
CurrentHeight get current block height
func (*Cache) GetLastCommittedBlock ¶
GetLastCommittedBlock get the latest committed block
func (*Cache) SetLastCommittedBlock ¶
SetLastCommittedBlock set the latest committed block
type ChainConfImplForTest ¶
type ChainConfImplForTest struct { ChainConf *configPb.ChainConfig // contains filtered or unexported fields }
####################################################################################################################
impls ChainConf interface
####################################################################################################################
func (*ChainConfImplForTest) AddVmWatch ¶
func (cc *ChainConfImplForTest) AddVmWatch(w protocol.VmWatcher)
AddVmWatch
func (*ChainConfImplForTest) AddWatch ¶
func (cc *ChainConfImplForTest) AddWatch(w protocol.Watcher)
AddWatch
func (*ChainConfImplForTest) ChainConfig ¶
func (cc *ChainConfImplForTest) ChainConfig() *configPb.ChainConfig
ChainConfig
func (*ChainConfImplForTest) CompleteBlock ¶
func (cc *ChainConfImplForTest) CompleteBlock(block *commonPb.Block) error
CompleteBlock
func (*ChainConfImplForTest) GetChainConfigAt ¶
func (cc *ChainConfImplForTest) GetChainConfigAt(blockHeight uint64) (*configPb.ChainConfig, error)
GetChainConfigAt
func (*ChainConfImplForTest) GetChainConfigFromFuture ¶
func (cc *ChainConfImplForTest) GetChainConfigFromFuture(blockHeight uint64) (*configPb.ChainConfig, error)
GetChainConfigFromFuture
func (*ChainConfImplForTest) GetConsensusNodeIdList ¶
func (cc *ChainConfImplForTest) GetConsensusNodeIdList() ([]string, error)
GetConsensusNodeIdList
type ConfigData ¶
type CoreEngineForTest ¶
func NewCoreEngineForTest ¶
func NewCoreEngineForTest(tnc *TestNodeConfig, log protocol.Logger) *CoreEngineForTest
NewCoreEngineForTest
func (*CoreEngineForTest) GetBlockCommitter ¶
func (ce *CoreEngineForTest) GetBlockCommitter() protocol.BlockCommitter
GetBlockCommitter
func (*CoreEngineForTest) GetBlockVerifier ¶
func (ce *CoreEngineForTest) GetBlockVerifier() protocol.BlockVerifier
GetBlockVerifier
func (*CoreEngineForTest) GetHotStuffHelper ¶
func (ce *CoreEngineForTest) GetHotStuffHelper() protocol.MaxbftHelper
GetHotStuffHelper
func (*CoreEngineForTest) GetMaxbftHelper ¶
func (ce *CoreEngineForTest) GetMaxbftHelper() protocol.MaxbftHelper
GetMaxbftHelper
func (*CoreEngineForTest) OnMessage ¶
func (ce *CoreEngineForTest) OnMessage(message *msgbus.Message)
OnMessage
type MaxbftHelper ¶
type MaxbftHelper struct{}
func (*MaxbftHelper) DiscardAboveHeight ¶
func (mh *MaxbftHelper) DiscardAboveHeight(baseHeight uint64)
DiscardAboveHeight
type NetEngineForTest ¶
type NetEngineForTest struct {
// contains filtered or unexported fields
}
####################################################################################################################
Net Engine
####################################################################################################################
func NewNetEngineForTest ¶
func NewNetEngineForTest(chainId, nodeId string, msgBus msgbus.MessageBus, tf *TestClusterFramework) *NetEngineForTest
NewNetEngineForTest
func (*NetEngineForTest) OnMessage ¶
func (ne *NetEngineForTest) OnMessage(message *msgbus.Message)
OnMessage
type ProposalCache ¶
type ProposalCache struct {
// contains filtered or unexported fields
}
ProposalCache is used for cache proposal blocks
func (*ProposalCache) ClearProposedBlockAt ¶
func (pc *ProposalCache) ClearProposedBlockAt(height uint64)
ClearProposedBlockAt clear proposed blocks with height.
func (*ProposalCache) ClearTheBlock ¶
func (pc *ProposalCache) ClearTheBlock(block *commonpb.Block)
ClearTheBlock f
func (*ProposalCache) DiscardAboveHeight ¶
func (pc *ProposalCache) DiscardAboveHeight(baseHeight uint64) []*commonpb.Block
func (*ProposalCache) GetProposedBlock ¶
func (pc *ProposalCache) GetProposedBlock(b *commonpb.Block) ( *commonpb.Block, map[string]*commonpb.TxRWSet, map[string][]*commonpb.ContractEvent)
GetProposedBlock get proposed block with specific block hash in current consensus height.
func (*ProposalCache) GetProposedBlockByHashAndHeight ¶
func (pc *ProposalCache) GetProposedBlockByHashAndHeight(hash []byte, height uint64) ( *commonpb.Block, map[string]*commonpb.TxRWSet)
GetProposedBlockByHashAndHeight get proposed block by block hash and block height.
func (*ProposalCache) GetProposedBlocksAt ¶
func (pc *ProposalCache) GetProposedBlocksAt(height uint64) []*commonpb.Block
GetProposedBlocksAt get all proposed blocks at a specific height. It is possible that generate several proposal blocks in one height because of some unpredictable situation of consensus.
func (*ProposalCache) GetSelfProposedBlockAt ¶
func (pc *ProposalCache) GetSelfProposedBlockAt(height uint64) *commonpb.Block
GetSelfProposedBlockAt get proposed block that is proposed by node itself.
func (*ProposalCache) HasProposedBlockAt ¶
func (pc *ProposalCache) HasProposedBlockAt(height uint64) bool
HasProposedBlockAt return if a proposed block has cached in current consensus height.
func (*ProposalCache) IsProposedAt ¶
func (pc *ProposalCache) IsProposedAt(height uint64) bool
IsProposedAt return if this node has proposed a block as proposer.
func (*ProposalCache) KeepProposedBlock ¶
func (pc *ProposalCache) KeepProposedBlock(hash []byte, height uint64) []*commonpb.Block
Remove proposed block in height except the specific block.
func (*ProposalCache) ResetProposedAt ¶
func (pc *ProposalCache) ResetProposedAt(height uint64)
ResetProposedAt reset propose status of this node.
func (*ProposalCache) SetProposedAt ¶
func (pc *ProposalCache) SetProposedAt(height uint64)
SetProposedAt to mark this node has proposed a block as proposer.
func (*ProposalCache) SetProposedBlock ¶
func (pc *ProposalCache) SetProposedBlock(b *commonpb.Block, rwSetMap map[string]*commonpb.TxRWSet, contractEventMap map[string][]*commonpb.ContractEvent, selfPropose bool) error
SetProposedBlock set porposed block in current consensus height, after it's generated or verified.
type TestClusterFramework ¶
type TestClusterFramework struct {
// contains filtered or unexported fields
}
####################################################################################################################
Cluster Framework
####################################################################################################################
func NewTestClusterFramework ¶
func NewTestClusterFramework(chainId string, consensusType consensusPb.ConsensusType, nodeNum int, tnc []*TestNodeConfig, consensusEngines []protocol.ConsensusEngine, coreEngines []protocol.CoreEngine) (*TestClusterFramework, error)
NewTestClusterFramework
type TestNode ¶
type TestNode struct {
// contains filtered or unexported fields
}
####################################################################################################################
Test Node
####################################################################################################################
func NewTestNode ¶
func NewTestNode( consensusType consensusPb.ConsensusType, config *TestNodeConfig, tf *TestClusterFramework, ce protocol.ConsensusEngine, core protocol.CoreEngine) (*TestNode, error)
NewTestNode
type TestNodeConfig ¶
type TestNodeConfig struct { ChainID string NodeId string ConsensusType consensusPb.ConsensusType GenesisBlock *commonPb.Block Signer protocol.SigningMember Ac protocol.AccessControlProvider LedgerCache protocol.LedgerCache ChainConf protocol.ChainConf MsgBus msgbus.MessageBus BlockchainStore protocol.BlockchainStore ProposalCache protocol.ProposalCache }
TestNodeConfig
func CreateTestNodeConfig ¶
func CreateTestNodeConfig(ctrl *gomock.Controller, nodeNum int, chainId string, consensusType consensus.ConsensusType, fn GetConsensusArg) ([]*TestNodeConfig, error)
CreateTestNodeConfig