p2p

package
v0.0.0-...-2a42317 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBasicHost

func CreateBasicHost(listenPort int, secio bool, randseed int64) (host.Host, error)

CreateBasicHost creates a libP2P host with a random peer ID listening on the given multiaddress. It will use secio if secio is true.

func HandleStream

func HandleStream(s net.Stream)

HandleStream handles incoming network streams

func ReadData

func ReadData(rw *bufio.ReadWriter)

ReadData reads incoming blockchain stream data from a channel streams

func Start

func Start(port int, seed int64)

Start a basic peer-to-peer broadcast service

Types

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

Peer is a single client in the Blockchain

type Peers

type Peers []Peer

Peers are all client entities in the blockchain

func InitPeerDiscovery

func InitPeerDiscovery() (Peers, error)

InitPeerDiscovery begins the process of identifying peers on the Blockchain

Jump to

Keyboard shortcuts

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