client

package
v0.0.0-...-7cc9995 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 19 Imported by: 0

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

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

New returns a new Client.

func (*Client) Connect

func (c *Client) Connect(replicas []backend.ReplicaInfo) (err error)

Connect connects the client to the replicas.

func (*Client) InitModule

func (c *Client) InitModule(mods *modules.Core)

InitModule initializes the client.

func (*Client) Run

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

Run runs the client until the context is closed.

func (*Client) Start

func (c *Client) Start()

Start starts the client.

func (*Client) Stop

func (c *Client) Stop()

Stop stops the client.

type Config

type Config struct {
	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
	Timeout          time.Duration
}

Config contains config options for a client.

type LatencyMeasurementEvent

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