tcpclient

package
v0.0.0-...-8e17a21 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BytesPool *bytePool
View Source
var (
	ErrNodesUnavailable = errors.New("All nodes unvailabale")
)
View Source
var ErrorEmptyBlockBody = errors.New("block is empty")
View Source
var ErrorWrongSizeBytes = errors.New("wrong size bytes")

Functions

func CheckConfirmation

func CheckConfirmation(host string, blockID int64, logger *log.Entry) (hash string)

func GetBlockBodiesChan

func GetBlockBodiesChan(ctx context.Context, src io.ReadCloser, blocksCount int64) (<-chan []byte, <-chan error)

func GetBlocksBodies

func GetBlocksBodies(ctx context.Context, host string, blockID int64, reverseOrder bool) (<-chan []byte, error)

GetBlocksBodies send GetBodiesRequest returns channel of binary blocks data

func GetMaxBlockID

func GetMaxBlockID(host string) (blockID int64, err error)

func HostWithMaxBlock

func HostWithMaxBlock(ctx context.Context, hosts []string) (bestHost string, maxBlockID int64, err error)

func NormalizeHostAddress

func NormalizeHostAddress(address string, defaultPort int64) (string, error)

NormalizeHostAddress get address. if port not defined returns combined string with ip and defaultPort

func SendFullBlockToAll

func SendFullBlockToAll(ctx context.Context, hosts []string, block *model.InfoBlock, txes []model.Transaction, nodeID int64) error

func SendStopNetwork

func SendStopNetwork(addr string, req *network.StopNetworkRequest) error

func SendTransacitionsToAll

func SendTransacitionsToAll(ctx context.Context, hosts []string, txes []model.Transaction) error

func SendTransactionsToHost

func SendTransactionsToHost(host string, txes []model.Transaction) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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