dummyclient

package
v0.0.0-...-bd4e2c0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyClient

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

func NewDummyClient

func NewDummyClient(clientId t.ClientID, hasher modules.Hasher, crypto modules.Crypto, l logging.Logger) *DummyClient

func (*DummyClient) Connect

func (dc *DummyClient) Connect(ctx context.Context, membership map[t.NodeID]string)

Connect establishes (in parallel) network connections to all nodes in the system. The nodes' RequestReceivers must be running. Only after Connect() returns, sending requests through this DummyClient is possible. TODO: Deal with errors, e.g. when the connection times out (make sure the RPC call in connectToNode() has a timeout).

func (*DummyClient) Disconnect

func (dc *DummyClient) Disconnect()

Disconnect closes all open connections to MirBFT nodes.

func (*DummyClient) SubmitRequest

func (dc *DummyClient) SubmitRequest(data []byte) error

SubmitRequest submits a request by sending it to all nodes (as configured when creating the DummyClient). It automatically appends meta-info like client ID and request number. SubmitRequest must not be called concurrently. If an error occurs, SubmitRequest returns immediately, even if sending of the request was not attempted for all nodes.

Jump to

Keyboard shortcuts

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