Documentation ¶
Index ¶
- func BuildConfirm(ccName string, proposalC chan<- framework.ProposalTask, ...) func(uint64, []byte)
- func DefaultWrapper(ccname string, method string) func([]byte) (*pb.Transaction, error)
- func NewChaincode(core *ConsensusCore, notify func(*cspb.PurposeBlock)) monologueCC
- func NewMiner(wrapper func([]byte) (*pb.Transaction, error)) *miner
- type ConsensusCore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfirm ¶
func BuildConfirm(ccName string, proposalC chan<- framework.ProposalTask, deliver framework.ConsensusTxDeliver) func(uint64, []byte)
monologue will "hide" its lastest block but a miner require it to be able to mine the next one, the latest block is selected external of our module and here is the entry to set the result. A custom mining progress is generated and delivered (so core and states can be accessed without racing cases), the latest block can be poped up from core and delivered to learner, push the state forward, so miner can do mining for the next block. i.e. miner mining on a series of continuous blocks should alternately call mining - confirming - mining the deliver should direct send tx into local learner instead of the tx network, which is provided by framework.baseLearnerImpl
func DefaultWrapper ¶
default wrapper purpose the generated tx is applied on the monologueCC (which should be a system cc) directly
func NewChaincode ¶
func NewChaincode(core *ConsensusCore, notify func(*cspb.PurposeBlock)) monologueCC
Types ¶
type ConsensusCore ¶
type ConsensusCore struct {
// contains filtered or unexported fields
}
func NewCore ¶
func NewCore(candidateSize int) *ConsensusCore
func (*ConsensusCore) ConsensusInput ¶
func (cc *ConsensusCore) ConsensusInput(pblk *cspb.PurposeBlock) (ret *cspb.ConsensusOutput)
monologue directly output the results
func (*ConsensusCore) Tip ¶
func (cc *ConsensusCore) Tip(n uint64, hash []byte) (ret *cspb.ConsensusOutput)
allow an additional tip input to "pop up" the candidate block