availability_test

package
v0.17.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillBS

func FillBS(t *testing.T, bServ blockservice.BlockService, shares []share.Share) *share.AxisRoots

FillBS fills the given BlockService with the given shares.

func RandFillBS

func RandFillBS(t *testing.T, n int, bServ blockservice.BlockService) *share.AxisRoots

RandFillBS fills the given BlockService with a random block of a given size.

Types

type SubNet

type SubNet struct {
	*TestDagNet
	// contains filtered or unexported fields
}

func (*SubNet) AddNode

func (sn *SubNet) AddNode(nd *TestNode)

func (*SubNet) ConnectAll

func (sn *SubNet) ConnectAll()

type TestDagNet added in v0.5.0

type TestDagNet struct {
	T *testing.T
	// contains filtered or unexported fields
}

func NewTestDAGNet

func NewTestDAGNet(ctx context.Context, t *testing.T) *TestDagNet

NewTestDAGNet creates a new testing swarm utility to spawn different nodes and test how they interact and/or exchange data.

func (*TestDagNet) Connect added in v0.5.0

func (dn *TestDagNet) Connect(peerA, peerB peer.ID)

Connect connects two given peers.

func (*TestDagNet) ConnectAll added in v0.5.0

func (dn *TestDagNet) ConnectAll()

ConnectAll connects all the peers on registered on the TestDagNet.

func (*TestDagNet) Disconnect added in v0.5.0

func (dn *TestDagNet) Disconnect(peerA, peerB peer.ID)

Disconnect disconnects two peers. It does a hard disconnect, meaning that disconnected peers won't be able to reconnect on their own but only with DagNet.Connect or TestDagNet.ConnectAll.

func (*TestDagNet) NewTestNode added in v0.5.0

func (dn *TestDagNet) NewTestNode() *TestNode

NewTestNode creates a plain network node that can serve and request data.

func (*TestDagNet) NewTestNodeWithBlockstore added in v0.5.0

func (dn *TestDagNet) NewTestNodeWithBlockstore(dstore ds.Datastore, bstore blockstore.Blockstore) *TestNode

NewTestNodeWithBlockstore creates a new plain TestNode with the given blockstore that can serve and request data.

func (*TestDagNet) SubNet added in v0.5.0

func (dn *TestDagNet) SubNet() *SubNet

type TestNode added in v0.5.0

type TestNode struct {
	shwap.Getter
	share.Availability
	blockservice.BlockService
	host.Host
	// contains filtered or unexported fields
}

func (*TestNode) ClearStorage added in v0.5.0

func (n *TestNode) ClearStorage()

ClearStorage cleans up the storage of the node.

Jump to

Keyboard shortcuts

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