blockpublisher

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: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider maintains a cache of Block Publishers - one per channel

func NewProvider

func NewProvider() *Provider

NewProvider returns a new block publisher provider

func (*Provider) ChannelJoined added in v0.1.1

func (p *Provider) ChannelJoined(channelID string)

ChannelJoined is invoked when the peer joins a channel. This function initializes the value of lastCommittedBlock for the channel.

func (*Provider) Close

func (p *Provider) Close()

Close closes all block publishers

func (*Provider) ForChannel

func (p *Provider) ForChannel(channelID string) api.BlockPublisher

ForChannel returns the block publisher for the given channel

func (*Provider) Initialize added in v0.1.1

func (p *Provider) Initialize(ledgerProvider collcommon.LedgerProvider) *Provider

Initialize is called by the resource manager to initialize the block publisher provider

type Publisher

type Publisher struct {
	*blockvisitor.Visitor
	// contains filtered or unexported fields
}

Publisher traverses a block and publishes KV read, KV write, and chaincode events to registered handlers

func New

func New(channelID string) *Publisher

New returns a new block Publisher for the given channel

func (*Publisher) AddBlockHandler added in v0.1.6

func (p *Publisher) AddBlockHandler(handler api.PublishedBlockHandler)

AddBlockHandler adds a handler for published blocks

func (*Publisher) AddCCEventHandler

func (p *Publisher) AddCCEventHandler(handler api.ChaincodeEventHandler)

AddCCEventHandler adds a new handler for chaincode events

func (*Publisher) AddCCUpgradeHandler

func (p *Publisher) AddCCUpgradeHandler(handler api.ChaincodeUpgradeHandler)

AddCCUpgradeHandler adds a handler for chaincode upgrade events

func (*Publisher) AddCollHashReadHandler added in v0.1.4

func (p *Publisher) AddCollHashReadHandler(handler api.CollHashReadHandler)

AddCollHashReadHandler adds a new handler for KV collection hash reads

func (*Publisher) AddCollHashWriteHandler added in v0.1.4

func (p *Publisher) AddCollHashWriteHandler(handler api.CollHashWriteHandler)

AddCollHashWriteHandler adds a new handler for KV collection hash writes

func (*Publisher) AddConfigUpdateHandler

func (p *Publisher) AddConfigUpdateHandler(handler api.ConfigUpdateHandler)

AddConfigUpdateHandler adds a handler for config update events

func (*Publisher) AddLSCCWriteHandler

func (p *Publisher) AddLSCCWriteHandler(handler api.LSCCWriteHandler)

AddLSCCWriteHandler adds a handler for chaincode instantiation/upgrade events

func (*Publisher) AddReadHandler

func (p *Publisher) AddReadHandler(handler api.ReadHandler)

AddReadHandler adds a new handler for KV reads

func (*Publisher) AddWriteHandler

func (p *Publisher) AddWriteHandler(handler api.WriteHandler)

AddWriteHandler adds a new handler for KV writes

func (*Publisher) Close

func (p *Publisher) Close()

Close releases all resources associated with the Publisher. Calling this function multiple times has no effect.

func (*Publisher) Publish

func (p *Publisher) Publish(block *cb.Block, pvtData ledger.TxPvtDataMap)

Publish publishes a block

Jump to

Keyboard shortcuts

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