Documentation
¶
Index ¶
Constants ¶
const MaxCount = 10
MaxCount represents the number of outgoing connections a gossip node should make
Variables ¶
var ConfigFile = flag.String("config", "", "config file created for the exp.")
var Ids arrayFlags
var Master = flag.String("master", "", "master address to synchronize")
var SyncAddr = flag.String("sync", "", "address to listen for master START")
Functions ¶
func IsIncluded ¶
IsIncluded returns true if the index is contained in the array
Types ¶
type Adaptor ¶
type Adaptor interface {
Make(ctx context.Context, nodes lib.NodeList, ids []int, threshold int, opts Opts) (handel.Registry, []Node)
}
Adaptor is an interface that gives back the registry and nodes from the list of node read from the simulation registry file
type AdaptorFunc ¶
type AdaptorFunc func(ctx context.Context, nodes lib.NodeList, ids []int, threshold int, opts Opts) (handel.Registry, []Node)
AdaptorFunc returns an Adaptor out of a func
func WithConnector ¶
func WithConnector(a AdaptorFunc) AdaptorFunc
WithConnector returns a Adaptor that also connects the nodes according to the connector specified in the opts.
func WithPostFunc ¶
func WithPostFunc(a AdaptorFunc, fn func(reg handel.Registry, ns []Node)) AdaptorFunc
WithPostFunc returns an Adaptor that executes a function after the given Adaptor
type Aggregator ¶
Aggregator is a struct holding the logic to aggregates all signatures gossiped until it gets the final one
func MakeAggregators ¶
func MakeAggregators(ctx context.Context, c lib.Constructor, nodes []Node, reg handel.Registry, threshold int, opts Opts) []*Aggregator
MakeAggregators returns
func NewAggregator ¶
func NewAggregator(ctx context.Context, n Node, r handel.Registry, c handel.Constructor, sig handel.Signature, threshold int, resendPeriod time.Duration, aggAndVerify bool) *Aggregator
NewAggregator returns an aggregator from the P2PNode
func (*Aggregator) FinalMultiSignature ¶
func (a *Aggregator) FinalMultiSignature() chan *handel.MultiSignature
FinalMultiSignature returns a channel that is used to signal the final multisignature is ready
func (*Aggregator) Start ¶
func (a *Aggregator) Start()
Start the aggregation for this node's perspective
type Connector ¶
Connector holds the logic to connect a node to a set of IDs on the overlay network
func ExtractConnector ¶
ExtractConnector returns connector
func NewNeighborConnector ¶
func NewNeighborConnector() Connector
NewNeighborConnector returns a connector that connects to its most immediate neighbors - ids.
func NewRandomConnector ¶
func NewRandomConnector() Connector
NewRandomConnector returns a Connector that connects nodes randomly
type ConsFunc ¶
type ConsFunc func(ctx context.Context, nodes []*lib.Node, ids []int, opts map[string]string) (handel.Registry, []Node)
ConsFunc is a type to implement Constructor for a func
type Node ¶
type Node interface { monitor.Counter Identity() handel.Identity SecretKey() lib.SecretKey Diffuse(*handel.Packet) Connect(handel.Identity) error Next() chan handel.Packet }
Node is an interface to be used by an Aggregator