p2p

package
v0.0.0-...-3fb6a18 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_CONNECTION       = 8
	BOOTSTRAP_CONNECTION = 2
)
View Source
const (
	P2PINGCONNECT  = "--------P2PING--CONNECT--------"
	P2PRPCONNECT   = "--------P2P2RPC--CONNECT--------"
	P2PRPCONNECTED = "--------P2P2RPC--CONNECTED--------"
)
View Source
const (
	P2PSSHCONNECT   = "--------P2PSSH--CONNECT--------"
	P2PSSHCONNECTED = "--------P2PSSH--CONNECTED--------"
	ID              = "/ssh/1.0.0"
)
View Source
const (
	Community = "p2pssh"
)

Variables

View Source
var (
	Libp2p     *P2PSSH
	PrivateKey string
)
View Source
var (
	BootStrap = []string{
		"/ip4/119.3.66.159/udp/9000/quic/p2p/QmdQERFyHXZE4mBUuSrjbcuicRrmrQk4BB6uTAfiFWWjvq",
		"/ip4/119.3.66.159/tcp/9000/p2p/QmdQERFyHXZE4mBUuSrjbcuicRrmrQk4BB6uTAfiFWWjvq",
		"/ip4/132.232.79.195/udp/9000/quic/p2p/QmZLdPPkXanNCaQYk7CUaQkPioYBnoanhHC4Z9ZvF7eNWt",
		"/ip4/132.232.79.195/tcp/9000/p2p/QmZLdPPkXanNCaQYk7CUaQkPioYBnoanhHC4Z9ZvF7eNWt",
	}
)

Functions

func UnmarshalConfig

func UnmarshalConfig(scanner *bufio.Scanner) (auth api.ClientConfig, found bool)

Types

type P2PSSH

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

func GetLibp2p

func GetLibp2p() *P2PSSH

func New

func New(privkey string) (_ *P2PSSH, err error)

func (*P2PSSH) ConnectPeerInfo

func (p *P2PSSH) ConnectPeerInfo(peerInfo *peer.AddrInfo) error

func (*P2PSSH) ConnectionManager

func (p *P2PSSH) ConnectionManager()

func (*P2PSSH) DisConnectPeer

func (p *P2PSSH) DisConnectPeer(peerID peer.ID) error

func (*P2PSSH) GetPeers

func (p *P2PSSH) GetPeers() []peer.ID

func (*P2PSSH) NewPingService

func (p *P2PSSH) NewPingService()

func (*P2PSSH) NewSSHService

func (p *P2PSSH) NewSSHService()

func (*P2PSSH) Ping

func (p *P2PSSH) Ping(pid peer.ID, reader io.Reader, writer io.Writer) error

func (*P2PSSH) SSHConnect

func (p *P2PSSH) SSHConnect(pid peer.ID, clientConfig ssh.ClientConfig, reader io.Reader, writer io.Writer) error

Jump to

Keyboard shortcuts

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