state

package
v0.1.6 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: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveCacheUpdates added in v0.1.5

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

SaveCacheUpdates is called on the committing peer to save the state cache updates so that the results may be published to an endorsing peer when asked for via a Gossip request.

func UpdateCache added in v0.1.5

func UpdateCache(channelID string, blockNum uint64) error

UpdateCache is called on the endorsing peer to pre-populate the state cache. When a validated block is received from the committing peer, a Gossip request is made to the committing peer for cache-updates for that block. When the cache-updates are received then the cache on the endorsing peer is updated (pre-populated).

Types

type Providers added in v0.1.6

type Providers struct {
	BPProvider      blockPublisherProvider
	MgrProvider     ccEventMgrProvider
	MspProvider     mspProvider
	GossipProvider  common.GossipProvider
	StateDBProvider stateDBProvider
	HandlerRegistry appDataHandlerRegistry
}

Providers contains the dependencies of the update handler

type UpdateHandler

type UpdateHandler struct {
	*Providers
	// contains filtered or unexported fields
}

UpdateHandler handles updates to LSCC state and the state cache. As blocks are committed, the state cache is updated on the committing peer and the cache-updates are temporarily stored. When an endorsing peer receives a validated block from the committing peer, a request is made to the committing peer for the cache-updates. When the cache-updates are received then the cache on the endorsing peer is updated (pre-populated).

func NewUpdateHandler

func NewUpdateHandler(providers *Providers) *UpdateHandler

NewUpdateHandler returns a new state update handler.

func (*UpdateHandler) ChannelJoined

func (h *UpdateHandler) ChannelJoined(channelID string)

ChannelJoined is called when a peer joins a channel

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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