witness

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	EntryType  string `json:"entryType"`
	AnchorID   string `json:"anchorID"`
	ExpiryTime int64  `json:"expiryTime"`
}

Entry contains common data for witness-info and witness-proof.

type Store

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

Store is db implementation of anchor witness store.

func New

func New(provider storage.Provider, expiryService *expiry.Service, expiryPeriod time.Duration) (*Store, error)

New creates new anchor witness store.

func (*Store) AddProof

func (s *Store) AddProof(anchorID string, witness *url.URL, p []byte) error

AddProof adds proof for anchor id and witness.

func (*Store) Delete

func (s *Store) Delete(anchorID string) error

Delete deletes all witnesses associated with anchor ID.

func (*Store) Get

func (s *Store) Get(anchorID string) ([]*proof.WitnessProof, error)

Get retrieves witnesses for the given anchor id.

func (*Store) HandleExpiredKeys

func (s *Store) HandleExpiredKeys(keys ...string) error

HandleExpiredKeys is expired keys inspector/handler.

func (*Store) Put

func (s *Store) Put(anchorID string, witnesses []*proof.Witness) error

Put saves witnesses into anchor witness store.

func (*Store) UpdateWitnessSelection

func (s *Store) UpdateWitnessSelection(anchorID string, witnesses []*url.URL, selected bool) error

UpdateWitnessSelection updates witness selection flag.

Jump to

Keyboard shortcuts

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