network

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0, MIT Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNoopLibP2PHost

func NewNoopLibP2PHost() noopLibP2PHost

nolint

Types

type NetworkAPI

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

func (*NetworkAPI) NetAddrsListen

func (networkAPI *NetworkAPI) NetAddrsListen(context.Context) (peer.AddrInfo, error)

func (*NetworkAPI) NetworkConnect

func (networkAPI *NetworkAPI) NetworkConnect(ctx context.Context, addrs []string) (<-chan net.ConnectionResult, error)

NetworkConnect connects to peers at the given addresses

func (*NetworkAPI) NetworkFindPeer

func (networkAPI *NetworkAPI) NetworkFindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, error)

NetworkFindPeer searches the libp2p router for a given peer id

func (*NetworkAPI) NetworkFindProvidersAsync

func (networkAPI *NetworkAPI) NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo

NetworkFindProvidersAsync issues a findProviders query to the filecoin network content router.

func (*NetworkAPI) NetworkGetBandwidthStats

func (networkAPI *NetworkAPI) NetworkGetBandwidthStats() metrics.Stats

NetworkGetBandwidthStats gets stats on the current bandwidth usage of the network

func (*NetworkAPI) NetworkGetClosestPeers

func (networkAPI *NetworkAPI) NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error)

NetworkGetClosestPeers issues a getClosestPeers query to the filecoin network.

func (*NetworkAPI) NetworkGetPeerAddresses

func (networkAPI *NetworkAPI) NetworkGetPeerAddresses() []ma.Multiaddr

NetworkGetPeerAddresses gets the current addresses of the node

func (*NetworkAPI) NetworkGetPeerID

func (networkAPI *NetworkAPI) NetworkGetPeerID() peer.ID

NetworkGetPeerID gets the current peer id of the node

func (*NetworkAPI) NetworkPeers

func (networkAPI *NetworkAPI) NetworkPeers(ctx context.Context, verbose, latency, streams bool) (*net.SwarmConnInfos, error)

NetworkPeers lists peers currently available on the network

func (*NetworkAPI) Version

func (networkAPI *NetworkAPI) Version(context.Context) (Version, error)

type NetworkSubmodule

type NetworkSubmodule struct {
	NetworkName string

	Host host.Host

	// Router is a router from IPFS
	Router routing.Routing

	Pubsub *libp2pps.PubSub

	// TODO: split chain bitswap from storage bitswap (issue: ???)
	Bitswap exchange.Interface

	Network *net.Network

	GraphExchange graphsync.GraphExchange

	PeerMgr net.IPeerMgr
	//data transfer
	DataTransfer     datatransfer.Manager
	DataTransferHost dtnet.DataTransferNetwork
	// contains filtered or unexported fields
}

NetworkSubmodule enhances the `Node` with networking capabilities.

func NewNetworkSubmodule

func NewNetworkSubmodule(ctx context.Context, config networkConfig, repo networkRepo, blockstore *blockstore.BlockstoreSubmodule) (*NetworkSubmodule, error)

NewNetworkSubmodule creates a new network submodule.

func (*NetworkSubmodule) API

func (networkSubmodule *NetworkSubmodule) API() *NetworkAPI

func (*NetworkSubmodule) FetchMessagesByCids

func (networkSubmodule *NetworkSubmodule) FetchMessagesByCids(
	ctx context.Context,
	cids []cid.Cid,
) ([]*types.UnsignedMessage, error)

func (*NetworkSubmodule) FetchSignedMessagesByCids

func (networkSubmodule *NetworkSubmodule) FetchSignedMessagesByCids(
	ctx context.Context,
	cids []cid.Cid,
) ([]*types.SignedMessage, error)

func (*NetworkSubmodule) Stop

func (networkSubmodule *NetworkSubmodule) Stop(ctx context.Context)

type Version

type Version struct {
	Version string

	// APIVersion is a binary encoded semver version of the remote implementing
	// this api
	//
	// See APIVersion in build/version.go
	APIVersion constants.Version
}

Version provides various build-time information

Jump to

Keyboard shortcuts

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