dummyclient

package
v0.0.0-...-9727c61 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 12 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 tt.ClientID,
	hasher crypto.Hash,
	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' Transactionreceivers must be running. Only after Connect() returns, sending transactions 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 Mir nodes.

func (*DummyClient) SubmitTransaction

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

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

Jump to

Keyboard shortcuts

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