Documentation ¶
Index ¶
Constants ¶
const ( // ChainInitOpCreate indicates that the chains should be creates afresh ChainInitOpCreate chainInitOp = iota + 1 // ChainInitOpOpen indicates that the existing chains should be opened ChainInitOpOpen )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchConf ¶
BatchConf captures the batch related configurations BatchSize specifies the number of transactions in one block SignBlock specifies whether the transactions should be signed
type Chain ¶
type Chain struct { ledger.PeerLedger ID ChainID // contains filtered or unexported fields }
Chain extends ledger.PeerLedger and the experiments invoke ledger functions via a chain type
func (*Chain) Commit ¶
Commit overrides the Commit function in ledger.PeerLedger because, experiments are not expected to call Commit directly to the ledger
func (*Chain) Done ¶
func (c *Chain) Done()
Done is expected to be called by an experiment when the experiment does not have any more transactions to submit
func (*Chain) SubmitTx ¶
func (c *Chain) SubmitTx(sr SimulationResult)
SubmitTx is expected to be called by an experiment for submitting the transactions
type ChainMgrConf ¶
ChainMgrConf captures the configurations meant at the level of chainMgr DataDir field specifies the filesystem location where the chains data is maintained NumChains field specifies the number of chains to instantiate
type SimulationResult ¶
type SimulationResult []byte
SimulationResult is a type used for simulation results
type TestEnv ¶
type TestEnv struct {
// contains filtered or unexported fields
}
TestEnv is a high level struct that the experiments are expeted to use as a starting point. See one of the Benchmark tests for the intended usage
func InitTestEnv ¶
func InitTestEnv(mgrConf *ChainMgrConf, batchConf *BatchConf, initOperation chainInitOp) *TestEnv
InitTestEnv initialize TestEnv with given configurations. The initialization cuases creation (or openning of existing) chains and the block creation and commit go routines for each of the chains. For configurations options, see comments on specific configuration type
func (TestEnv) WaitForTestCompletion ¶
func (env TestEnv) WaitForTestCompletion()
WaitForTestCompletion waits till all the transactions are committed An experiment after launching all the goroutine should call this so that the process is alive till all the goroutines complete