upstream

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: ISC Imports: 14 Imported by: 0

Documentation

Overview

maintain REQ/REP connection to clients this allow for push of blocks, transactions... as well as polling for out of sync conditions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Upstream

type Upstream struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(privateKey []byte, publicKey []byte, timeout time.Duration) (*Upstream, error)

func (*Upstream) Connect

func (u *Upstream) Connect(address *util.Connection, serverPublicKey []byte) error

connect (or reconnect) to a specific server

func (*Upstream) ConnectedTo

func (u *Upstream) ConnectedTo() *zmqutil.Connected

if registered the have avalid connection

func (*Upstream) Destroy

func (u *Upstream) Destroy()

func (*Upstream) GetBlockData

func (u *Upstream) GetBlockData(blockNumber uint64) ([]byte, error)

fetch block data

func (*Upstream) GetBlockDigest

func (u *Upstream) GetBlockDigest(blockNumber uint64) (blockdigest.Digest, error)

fetch block digest

func (*Upstream) GetHeight

func (u *Upstream) GetHeight() uint64

fetch height from last polled value

func (*Upstream) IsConnectedTo

func (u *Upstream) IsConnectedTo(serverPublicKey []byte) bool

check the current destination

does not mean actually connected, as could be in a timeout and reconnect state

func (*Upstream) IsOK

func (u *Upstream) IsOK() bool

if registered the have avalid connection

Jump to

Keyboard shortcuts

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