observer

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MetaDataColName is the name of the metadata collection used by the Observer
	// to store peer-specific information
	MetaDataColName = "meta_data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientProviders added in v0.1.4

type ClientProviders struct {
	OffLedger                common.OffLedgerClientProvider
	Blockchain               common.BlockchainClientProvider
	Gossip                   common.GossipProvider
	CacheInvalidatorProvider cacheInvalidatorProvider
}

ClientProviders contains the providers for off-ledger, DCAS, and blockchain clients

type Metadata added in v0.1.4

type Metadata struct {
	LastBlockProcessed uint64
	LastTxNumProcessed int64
	LeaseOwner         string
	FailedAttempts     int
	LastErrorCode      transienterr.Code
}

Metadata contains meta-data for the document store

type MetadataStore added in v0.1.4

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

MetadataStore manages the persistence and retrieval of peer-specific metadata

func NewMetaDataStore added in v0.1.4

func NewMetaDataStore(channelID string, peerConfig peerConfig, ccName string, offLedgerProvider common.OffLedgerClientProvider) *MetadataStore

NewMetaDataStore returns a new meta data store

func (*MetadataStore) Get added in v0.1.4

func (m *MetadataStore) Get() (*Metadata, error)

Get retrieves the meta-data for this peer

func (*MetadataStore) Put added in v0.1.4

func (m *MetadataStore) Put(data *Metadata) error

Put persists the meta data for this peer

type Observer

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

Observer reads blocks from the ledger looking for Sidetree anchor writes and persists the document operations to the document store.

func New

func New(channelID string, peerCfg peerConfig, observerCfg config.Observer, clientProviders *ClientProviders, txnChan <-chan gossipapi.TxMetadata, pcp ctxcommon.ProtocolClientProvider) *Observer

New returns a new Observer

func (*Observer) Start

func (m *Observer) Start() error

Start starts the Observer

func (*Observer) Stop

func (m *Observer) Stop()

Stop stops the Observer

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