parsigex

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemExFunc

func NewMemExFunc() func() core.ParSigEx

NewMemExFunc returns a function that itself returns in-memory exchange components that exchange partial signatures.

Types

type MemEx

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

MemEx provides an in-memory implementation of the core workflow's partial signature exchange component.

func (MemEx) Broadcast

func (s MemEx) Broadcast(ctx context.Context, duty core.Duty, set core.ParSignedDataSet) error

Broadcast broadcasts the partially signed duty data set to all peers.

func (MemEx) Subscribe

func (s MemEx) Subscribe(fn func(context.Context, core.Duty, core.ParSignedDataSet) error)

Subscribe registers a callback when a partially signed duty set is received from a peer.

type ParSigEx

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

ParSigEx exchanges partially signed duty data sets. It ensures that all partial signatures are persisted by all peers.

func NewParSigEx

func NewParSigEx(tcpNode host.Host, sendFunc p2p.SendFunc, peerIdx int, peers []peer.ID) *ParSigEx

func (*ParSigEx) Broadcast

func (m *ParSigEx) Broadcast(ctx context.Context, duty core.Duty, set core.ParSignedDataSet) error

Broadcast broadcasts the partially signed duty data set to all peers.

func (*ParSigEx) Subscribe

func (m *ParSigEx) Subscribe(fn func(context.Context, core.Duty, core.ParSignedDataSet) error)

Subscribe registers a callback when a partially signed duty set is received from a peer. This is not thread safe, it must be called before starting to use parsigex.

Jump to

Keyboard shortcuts

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