sbpn

package
v1.2.3-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder interface {
	Start(p2p p2p.Server) error
	Stop()
	Info() *Info
	SetListener(listener Listener)
}

Finder to find snapshot block producers, and connect to them

func New

func New(addr types.Address, informer Informer) Finder

type Info

type Info struct {
	Addr string
	SBPS []string
}

type Informer

type Informer interface {
	SubscribeProducers(gid types.Gid, id string, fn func(event consensus.ProducersEvent))
	UnSubscribe(gid types.Gid, id string)
}

Informer tell me who are super block producers

type Listener

type Listener interface {
	GotNodeCallback(*discovery.Node)
	GotSBPSCallback([]types.Address)
	ConnectCallback(addr types.Address, id discovery.NodeID)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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