network

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0, MIT Imports: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashMsgId added in v1.7.0

func HashMsgId(m *pubsub_pb.Message) string

func NewNoopLibP2PHost

func NewNoopLibP2PHost() noopLibP2PHost

nolint

Types

type NetworkSubmodule

type NetworkSubmodule struct {
	NetworkName string

	Host    host.Host
	RawHost types.RawHost

	// 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

	HelloHandler *helloprotocol.HelloProtocolHandler

	PeerMgr        peermgr.IPeerMgr
	ExchangeClient filexchange.Client

	// data transfer
	DataTransfer     datatransfer.Manager
	DataTransferHost dtnet.DataTransferNetwork

	ScoreKeeper *net.ScoreKeeper

	F3Cfg *vf3.Config
	// contains filtered or unexported fields
}

NetworkSubmodule enhances the `Node` with networking capabilities.

func NewNetworkSubmodule

func NewNetworkSubmodule(ctx context.Context,
	chainStore *chain.Store,
	messageStore *chain.MessageStore,
	config networkConfig,
) (*NetworkSubmodule, error)

NewNetworkSubmodule creates a new network submodule.

func (*NetworkSubmodule) API

func (networkSubmodule *NetworkSubmodule) API() v1api.INetwork

API create a new network implement

func (*NetworkSubmodule) FetchMessagesByCids

func (networkSubmodule *NetworkSubmodule) FetchMessagesByCids(
	ctx context.Context,
	service bserv.BlockService,
	cids []cid.Cid,
) ([]*types.Message, error)

func (*NetworkSubmodule) FetchSignedMessagesByCids

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

func (*NetworkSubmodule) Start added in v1.7.0

func (networkSubmodule *NetworkSubmodule) Start(ctx context.Context) error

func (*NetworkSubmodule) Stop

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

func (*NetworkSubmodule) V0API added in v0.9.7

func (networkSubmodule *NetworkSubmodule) V0API() v0api.INetwork

Jump to

Keyboard shortcuts

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