bootstraptest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DummyNonLocalAddr is used to work-around the fact that this test will
	// run locally, but local-only addresses aren't accepted in network
	// configurations.
	// So we'll assign this dummy external address to all nodes.
	DummyNonLocalAddr = multiaddr.StringCast("/ip4/42.42.42.42/tcp/8903")
)

Functions

This section is empty.

Types

type TestNetwork

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

TestNetwork lets you configure a test network.

func NewTestNetwork

func NewTestNetwork(ctx context.Context, t *testing.T) *TestNetwork

NewTestNetwork returns an empty TestNetwork.

func (*TestNetwork) AddCoordinatedNode

func (n *TestNetwork) AddCoordinatedNode() (protocol.Handler, peer.ID)

AddCoordinatedNode adds a coordinated node to the test network.

func (*TestNetwork) AddCoordinatorNode

func (n *TestNetwork) AddCoordinatorNode() protocol.Handler

AddCoordinatorNode adds a coordinator node to the network.

func (*TestNetwork) Close

func (n *TestNetwork) Close()

Close tears down the network components.

func (*TestNetwork) CoordinatedConfig

func (n *TestNetwork) CoordinatedConfig(peerID peer.ID) protector.NetworkConfig

CoordinatedConfig returns the network config of a given coordinated node.

func (*TestNetwork) CoordinatedHost

func (n *TestNetwork) CoordinatedHost(peerID peer.ID) ihost.Host

CoordinatedHost returns the underlying host of a given coordinated node.

func (*TestNetwork) CoordinatedStore

func (n *TestNetwork) CoordinatedStore(peerID peer.ID) proposal.Store

CoordinatedStore returns the proposal store of a given coordinated node.

func (*TestNetwork) CoordinatorConfig

func (n *TestNetwork) CoordinatorConfig() protector.NetworkConfig

CoordinatorConfig returns the network config of the coordinator.

func (*TestNetwork) CoordinatorHost

func (n *TestNetwork) CoordinatorHost() ihost.Host

CoordinatorHost returns the underlying host of the coordinator.

func (*TestNetwork) CoordinatorID

func (n *TestNetwork) CoordinatorID() peer.ID

CoordinatorID returns the ID of the coordinator.

func (*TestNetwork) CoordinatorKey

func (n *TestNetwork) CoordinatorKey() crypto.PrivKey

CoordinatorKey returns the private key of the coordinator.

func (*TestNetwork) CoordinatorStore

func (n *TestNetwork) CoordinatorStore() proposal.Store

CoordinatorStore returns the proposal store of the coordinator.

Jump to

Keyboard shortcuts

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