p2p

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewP2PClient4EOS

func NewP2PClient4EOS(name string, chainID string, startBlock uint32, peers []string, logger *zap.Logger) *p2pEOSClient

NewP2PClient4EOS new p2p peers from cfg

func NewP2PClient4EOSForce

func NewP2PClient4EOSForce(name string, chainID string, startBlock uint32, peers []string, logger *zap.Logger) *p2pEOSForceClient

NewP2PClient4EOSForce new p2p peers from cfg

func NewP2PClient4Forceio

func NewP2PClient4Forceio(name string, chainID string, startBlock uint32, peers []string, logger *zap.Logger) *p2pForceioClient

NewP2PPeers new p2p peers from cfg

Types

type ClientInterface

type ClientInterface interface {
	Type() types.ClientType
	Start() error
	CloseConnection() error
	IsClosed() bool
	SetReadTimeout(readTimeout time.Duration)
	RegHandler(handler types.P2PHandler)
}

ClientInterface interface for common p2p client

func NewP2PClient

func NewP2PClient(typ types.ClientType, params P2PInitParams) ClientInterface

type P2PInitParams

type P2PInitParams struct {
	Name          string   `json:"name"`
	ClientID      string   `json:"clientID"`
	Peers         []string `json:"peers"`
	StartBlockNum uint32   `json:"start"`
	Logger        *zap.Logger
}

P2PInitParams init params for P2P client

Jump to

Keyboard shortcuts

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