sbpn

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 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() interface{}
	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
	SPeers Peers
}

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)
}

type Peer added in v1.3.0

type Peer struct {
	ID      string
	NetAddr string
	Address string
	SBP     bool
}

type Peers added in v1.3.0

type Peers struct {
	Total  int
	Sbps   int
	Detail []Peer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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