Documentation ¶
Index ¶
- func FillBS(t *testing.T, bServ blockservice.BlockService, shares []libshare.Share) *share.AxisRoots
- func RandFillBS(t *testing.T, n int, bServ blockservice.BlockService) *share.AxisRoots
- type SubNet
- type TestDagNet
- func (dn *TestDagNet) Connect(peerA, peerB peer.ID)
- func (dn *TestDagNet) ConnectAll()
- func (dn *TestDagNet) Disconnect(peerA, peerB peer.ID)
- func (dn *TestDagNet) NewTestNode() *TestNode
- func (dn *TestDagNet) NewTestNodeWithBlockstore(dstore ds.Datastore, bstore blockstore.Blockstore) *TestNode
- func (dn *TestDagNet) SubNet() *SubNet
- type TestNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillBS ¶
func FillBS(t *testing.T, bServ blockservice.BlockService, shares []libshare.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) ConnectAll ¶
func (sn *SubNet) ConnectAll()
type TestDagNet ¶ added in v0.5.0
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.