Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastCB ¶
type BroadcastCB func(*blockchain.Block) error
BroadcastCB defines the callback to publish the consensus result
type ConsensusDoneCB ¶
type ConsensusDoneCB func(*blockchain.Block) error
ConsensusDoneCB defines the callback when consensus is reached
type CreateBlockCB ¶
type CreateBlockCB func() (*blockchain.Block, error)
CreateBlockCB defines the callback to create a new block
type Noop ¶
type Noop struct { }
Noop is the consensus scheme that does NOT create blocks
type Scheme ¶
Scheme is the interface that consensus schemes should implement
func NewStandalone ¶
func NewStandalone(create CreateBlockCB, commit ConsensusDoneCB, pub BroadcastCB, bc blockchain.IBlockchain, interval time.Duration) Scheme
NewStandalone creates a Standalone struct.
type Standalone ¶
type Standalone struct {
// contains filtered or unexported fields
}
Standalone is the consensus scheme that periodically create blocks
func (*Standalone) Handle ¶
func (n *Standalone) Handle(message proto.Message) error
Handle handles incoming requests
func (*Standalone) Start ¶
func (n *Standalone) Start() error
Start starts the service for a standalone
type TellPeerCB ¶
TellPeerCB defines the callback to tell (which is a unicast) message to peers on P2P network
Click to show internal directories.
Click to hide internal directories.