observer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ledger Ledger, dcas DCAS, operationStore OperationStore)

Start starts channel observer routines

Types

type AnchorFile

type AnchorFile struct {
	// BatchFileHash is encoded hash of the batch file
	BatchFileHash string `json:"batchFileHash"`

	// UniqueSuffixes is an array of suffixes (the unique portion of the ID string that differentiates
	// one document from another) for all documents that are declared to have operations within the associated batch file.
	UniqueSuffixes []string `json:"uniqueSuffixes"`
}

AnchorFile defines the schema of a Anchor File

type BatchFile

type BatchFile struct {
	// Operations included in this batch file, each operation is an encoded string
	Operations []string `json:"operations"`
}

BatchFile defines the schema of a Batch File and its related operations.

type DCAS

type DCAS interface {
	Read(key string) ([]byte, error)
}

DCAS interface to access content addressable storage

type Ledger

type Ledger interface {
	RegisterForSidetreeTxn() <-chan []SidetreeTxn
}

Ledger interface to access ledger txn

type OperationStore

type OperationStore interface {
	Put(ops []*batch.Operation) error
}

OperationStore interface to access operation store

type SidetreeTxn

type SidetreeTxn struct {
	TransactionTime   uint64
	TransactionNumber uint64
	AnchorAddress     string
}

SidetreeTxn defines info about sidetree transaction

type TxnProcessor

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

TxnProcessor processes Sidetree transactions by persisting them to an operation store

func NewTxnProcessor

func NewTxnProcessor(dcas DCAS, opStore OperationStore) *TxnProcessor

NewTxnProcessor returns a new document operation processor

func (*TxnProcessor) Process

func (p *TxnProcessor) Process(sidetreeTxn SidetreeTxn) error

Process persists all of the operations for the given anchor

Jump to

Keyboard shortcuts

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