connmgr

package
v0.0.0-...-35a1b05 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UploadV1   protocol.ID = "/upload/1.0.0"
	DownloadV1 protocol.ID = "/download/1.0.0"
	BranchV1   protocol.ID = "/branch/1.0.0"
)

Variables

View Source
var Clients map[string]*Client

Functions

func Disconnect

func Disconnect(publicKey string) error

func UploadDag

func UploadDag(ctx context.Context, dag *merkle_dag.Dag, publicKey *string, signature *string) (context.Context, error)

Upload dag to all connected hornet nodes

func UploadLeafChildren

func UploadLeafChildren(ctx context.Context, stream network.Stream, leaf *merkle_dag.DagLeaf, dag *merkle_dag.Dag) error

func WaitForResponse

func WaitForResponse(ctx context.Context, stream network.Stream) bool

func WaitForUploadMessage

func WaitForUploadMessage(ctx context.Context, stream network.Stream) (bool, *lib.UploadMessage)

func WriteResponseToStream

func WriteResponseToStream(ctx context.Context, stream network.Stream, response bool) error

Types

type Client

type Client struct {
	Host          *host.Host
	ServerAddress *multiaddr.Multiaddr
	Peer          *peer.AddrInfo
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context, serverAddress string, publicKey string, opts ...config.Option) (context.Context, *Client, error)

func GetClient

func GetClient(publicKey string) (*Client, error)

func (*Client) Disconnect

func (client *Client) Disconnect() error

func (*Client) DownloadDag

func (client *Client) DownloadDag(ctx context.Context, root string, publicKey *string, signature *string) (context.Context, *merkle_dag.Dag, error)

Download dag from single hornet node

func (*Client) UploadDag

func (client *Client) UploadDag(ctx context.Context, dag *merkle_dag.Dag, publicKey *string, signature *string) (context.Context, error)

Upload dag to a single hornet node

Jump to

Keyboard shortcuts

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