state

package
v0.0.0-...-bfcd41d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveCacheUpdates

func SaveCacheUpdates(channelID string, blockNum uint64, updates []byte)

SaveCacheUpdates saves the state cache updates so that the results may be published to endorsing peers

Types

type GossipServiceMediator

type GossipServiceMediator interface {
	// VerifyBlock returns nil if the block is properly signed, and the claimed seqNum is the
	// sequence number that the block's header contains.
	// else returns error
	VerifyBlock(channelID common2.ChannelID, seqNum uint64, signedBlock *common.Block) error

	// PeersOfChannel returns the NetworkMembers considered alive
	// and also subscribed to the channel given
	PeersOfChannel(common2.ChannelID) []discovery.NetworkMember

	// Gossip sends a message to other peers to the network
	Gossip(msg *proto.GossipMessage)
}

GossipServiceMediator aggregated adapter interface to compound basic mediator services required by state transfer into single struct

type GossipStateProviderExtension

type GossipStateProviderExtension interface {

	//HandleStateRequest can used to extend given request handle
	HandleStateRequest(func(msg protoext.ReceivedMessage)) func(msg protoext.ReceivedMessage)

	//Predicate can used to override existing predicate to filter peers to be asked for blocks
	Predicate(func(peer discovery.NetworkMember) bool) func(peer discovery.NetworkMember) bool

	//AddPayload can used to extend given add payload handle
	AddPayload(func(payload *proto.Payload, blockingMode bool) error) func(payload *proto.Payload, blockingMode bool) error

	//StoreBlock  can used to extend given store block handle
	StoreBlock(func(block *common.Block, pvtData util.PvtDataCollections) (*ledger.BlockAndPvtData, error)) func(block *common.Block, pvtData util.PvtDataCollections) (*ledger.BlockAndPvtData, error)

	//LedgerHeight can used to extend ledger height feature to get current ledger height
	LedgerHeight(func() (uint64, error)) func() (uint64, error)

	//RequestBlocksInRange can be used to extend given request blocks feature
	RequestBlocksInRange(func(start uint64, end uint64), func(payload *proto.Payload, blockingMode bool) error) func(start uint64, end uint64)
}

GossipStateProviderExtension extends GossipStateProvider features

func NewGossipStateProviderExtension

func NewGossipStateProviderExtension(chainID string, mediator GossipServiceMediator, support *api.Support, blockingMode bool) GossipStateProviderExtension

NewGossipStateProviderExtension returns new GossipStateProvider Extension implementation

type ValidationMgr

type ValidationMgr struct {
	// contains filtered or unexported fields
}

ValidationMgr manages distributed validation requests

func InitValidationMgr

func InitValidationMgr(vp validationProvider, cp validationContextProvider) *ValidationMgr

InitValidationMgr is called on startup

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL