node

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package node defines a node executing the TSS protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node holds interfaces to interact with the blockchain and network messages transport layer.

func NewNode

func NewNode(
	chain chain.Handle,
	networkProvider net.Provider,
	tssConfig *tss.Config,
) *Node

NewNode initializes node struct with provided chain interface and network provider. It also initializes TSS Pre-Parameters pool. But does not start parameters generation. This should be called separately.

func (*Node) AnnounceSignerPresence

func (n *Node) AnnounceSignerPresence(
	ctx context.Context,
	operatorPublicKey *operator.PublicKey,
	keepID chain.ID,
	keepMemberIDs []chain.ID,
) ([]tss.MemberID, error)

AnnounceSignerPresence triggers the announce protocol in order to signal signer presence and gather information about other signers.

func (*Node) CalculateSignature

func (n *Node) CalculateSignature(
	ctx context.Context,
	keep chain.BondedECDSAKeepHandle,
	signer *tss.ThresholdSigner,
	digest [32]byte,
) error

CalculateSignature calculates a signature over a digest with threshold signer and publishes the result to the keep associated with the signer.

The attempt for generating and publishing signature is retried on failure until the provided context is done.

func (*Node) GenerateSignerForKeep

func (n *Node) GenerateSignerForKeep(
	ctx context.Context,
	operatorPublicKey *operator.PublicKey,
	keep chain.BondedECDSAKeepHandle,
	members []chain.ID,
	keepsRegistry *registry.Keeps,
) (*tss.ThresholdSigner, error)

GenerateSignerForKeep generates a new threshold signer with ECDSA key pair and submits the public key to the on-chain keep.

The attempt for generating signer is retried on failure until the provided context is done.

func (*Node) InitializeTSSPreParamsPool

func (n *Node) InitializeTSSPreParamsPool()

InitializeTSSPreParamsPool generates TSS pre-parameters and stores them in a pool.

func (*Node) TSSPreParamsPoolSize added in v1.6.0

func (n *Node) TSSPreParamsPoolSize() int

TSSPreParamsPoolSize returns the current size of the TSS params pool.

Jump to

Keyboard shortcuts

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