parsigdb

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemDB

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

MemDB is a placeholder in-memory partial signature database. It will be replaced with a BadgerDB implementation.

func NewMemDB

func NewMemDB(threshold int, deadliner core.Deadliner) *MemDB

NewMemDB returns a new in-memory partial signature database instance.

func (*MemDB) StoreExternal

func (db *MemDB) StoreExternal(ctx context.Context, duty core.Duty, signedSet core.ParSignedDataSet) error

StoreExternal stores an externally received partially signed duty data set.

func (*MemDB) StoreInternal

func (db *MemDB) StoreInternal(ctx context.Context, duty core.Duty, signedSet core.ParSignedDataSet) error

StoreInternal stores an internally received partially signed duty data set.

func (*MemDB) SubscribeInternal

func (db *MemDB) SubscribeInternal(fn func(context.Context, core.Duty, core.ParSignedDataSet) error)

SubscribeInternal registers a callback when an internal partially signed duty set is stored.

func (*MemDB) SubscribeThreshold

func (db *MemDB) SubscribeThreshold(fn func(context.Context, core.Duty, core.PubKey, []core.ParSignedData) error)

SubscribeThreshold registers a callback when *threshold* partially signed duty is reached for a DV.

func (*MemDB) Trim added in v0.12.0

func (db *MemDB) Trim(ctx context.Context)

Trim blocks until the context is closed, it deletes state for expired duties. It should only be called once.

Jump to

Keyboard shortcuts

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