Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlocksDeliverer ¶
type BlocksDeliverer interface {
// Recv capable to bring new blocks from the ordering service
Recv() (*orderer.DeliverResponse, error)
// Send used to send request to the ordering service to obtain new blocks
Send(*common.Envelope) error
}
BlocksDeliverer defines interface which actually helps to abstract the AtomicBroadcast_DeliverClient with only required method for blocks provider. This also help to build up mocking facilities for testing purposes
type BlocksProvider ¶
type BlocksProvider interface {
// RequestBlock acquire new blocks from ordering service based on
// information provided by ledger info instance
RequestBlocks(ledgerInfoProvider LedgerInfo) error
// DeliverBlocks starts delivering and disseminating blocks
DeliverBlocks()
// Stop shutdowns blocks provider and stops delivering new blocks
Stop()
}
BlocksProvider used to read blocks from the ordering service for specified chain it subscribed to
func NewBlocksProvider ¶
func NewBlocksProvider(chainID string, client BlocksDeliverer, gossip GossipServiceAdapter, mcs api.MessageCryptoService) BlocksProvider
NewBlocksProvider constructor function to creare blocks deliverer instance
type GossipServiceAdapter ¶
type GossipServiceAdapter interface {
// PeersOfChannel returns slice with members of specified channel
PeersOfChannel(gossipcommon.ChainID) []discovery.NetworkMember
// AddPayload adds payload to the local state sync buffer
AddPayload(chainID string, payload *gossip_proto.Payload) error
// Gossip the message across the peers
Gossip(msg *gossip_proto.GossipMessage)
}
GossipServiceAdapter serves to provide basic functionality required from gossip service by delivery service
Source Files
¶
- blocksprovider.go
Click to show internal directories.
Click to hide internal directories.