llmq

package
v0.14.0-dev.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuorumParams

func QuorumParams(quorumType btcjson.LLMQType) (int, int, error)

QuorumParams returns corresponding LLMQ parameters the first integer is an expected size of quorum the second is an expected threshold the third parameter is an error, it returns in a case if quorumType is not supported

func WithSeed

func WithSeed(seedSource int64) func(c *llmqConfig)

WithSeed sets a seed generator with passed seed-source

func WithThreshold

func WithThreshold(threshold int) func(c *llmqConfig)

WithThreshold sets a threshold number of allowed members for a recovery a threshold public key / signature or private key

Types

type Data

type Data struct {
	Threshold        int
	ProTxHashes      []crypto.ProTxHash
	PrivKeys         []crypto.PrivKey
	PubKeys          []crypto.PubKey
	PrivKeyShares    []crypto.PrivKey
	PubKeyShares     []crypto.PubKey
	ThresholdPrivKey crypto.PrivKey
	ThresholdPubKey  crypto.PubKey
}

Data contains pre generated keys/shares/signatures for the participants of LLMQ network

func Generate

func Generate(proTxHashes []crypto.ProTxHash, opts ...optionFunc) (*Data, error)

Generate generates long living master node quorum for a list of pro-tx-hashes to be able to override default values, need to provide option functions

func MustGenerate

func MustGenerate(proTxHashes []crypto.ProTxHash, opts ...optionFunc) *Data

MustGenerate generates long-living master node quorum, but panics if a got error

func (*Data) Iter

func (l *Data) Iter() *Iter

Iter creates and returns LLMQ iterator

type Iter

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

Iter is an iterator implementation this iterator go through the proTxHash and validator quorum-keys (like: private and public share keys)

func (*Iter) Next

func (i *Iter) Next() bool

Next moves a position pointer to a next element

func (*Iter) Value

func (i *Iter) Value() (crypto.ProTxHash, crypto.QuorumKeys)

Value returns node's crypto.ProTxHash and crypto.QuorumKeys from the current position

Jump to

Keyboard shortcuts

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