client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 18 Imported by: 2

Documentation

Overview

Package client implements a simple client for testing HotStuff. The client reads data from an input stream and sends the data in commands to a HotStuff replica. The client waits for replies from f+1 replicas before it considers a command to be executed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a hotstuff client.

func New added in v0.3.0

func New(conf Config, builder modules.Builder) (client *Client)

New returns a new Client.

func (*Client) Connect added in v0.3.0

func (c *Client) Connect(replicaConfig *config.ReplicaConfig) (err error)

Connect connects the client to the replicas.

func (*Client) Run added in v0.3.0

func (c *Client) Run(ctx context.Context)

Run runs the client until the context is closed.

func (*Client) Start added in v0.3.0

func (c *Client) Start()

Start starts the client.

func (*Client) Stop added in v0.3.0

func (c *Client) Stop()

Stop stops the client.

type Config added in v0.3.0

type Config struct {
	ID               hotstuff.ID
	TLS              bool
	RootCAs          *x509.CertPool
	MaxConcurrent    uint32
	PayloadSize      uint32
	Input            io.ReadCloser
	ManagerOptions   []gorums.ManagerOption
	RateLimit        float64       // initial rate limit
	RateStep         float64       // rate limit step up
	RateStepInterval time.Duration // step up interval
}

Config contains config options for a client.

type LatencyMeasurementEvent added in v0.3.0

type LatencyMeasurementEvent struct {
	Latency time.Duration
}

LatencyMeasurementEvent represents a single latency measurement.

Jump to

Keyboard shortcuts

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