Documentation
¶
Index ¶
- Variables
- type TestNetwork
- func (n *TestNetwork) AddCoordinatedNode() (protocol.Handler, peer.ID)
- func (n *TestNetwork) AddCoordinatorNode() protocol.Handler
- func (n *TestNetwork) Close()
- func (n *TestNetwork) CoordinatedConfig(peerID peer.ID) protector.NetworkConfig
- func (n *TestNetwork) CoordinatedHost(peerID peer.ID) ihost.Host
- func (n *TestNetwork) CoordinatedStore(peerID peer.ID) proposal.Store
- func (n *TestNetwork) CoordinatorConfig() protector.NetworkConfig
- func (n *TestNetwork) CoordinatorHost() ihost.Host
- func (n *TestNetwork) CoordinatorID() peer.ID
- func (n *TestNetwork) CoordinatorKey() crypto.PrivKey
- func (n *TestNetwork) CoordinatorStore() proposal.Store
Constants ¶
This section is empty.
Variables ¶
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) 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.