consim

package
v0.2101.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Package consim implements the mock consensus simulator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(parentCmd *cobra.Command)

Register registers the consim sub-command.

Types

type BlockTx

type BlockTx struct {
	Tx   []byte
	Code uint32
}

Tx is a single transaction, and the expected Check/DeliverTx status code.

type Workload

type Workload interface {
	// Init initializes the workload (and alters the genesis document as required).
	Init(*genesis.Document) error

	// Start starts the workload.
	//
	// Note: The genesis document is the initial chain state, after the fixups
	// from Init are applied, and existing state is loaded from disk.
	Start(*genesis.Document, <-chan struct{}, chan<- error) (<-chan []BlockTx, error)

	// Finalize is called after the workload is complete with the final chain state.
	Finalize(*genesis.Document) error

	// Cleanup cleans up the workload.
	Cleanup()
}

Workload is a simulator workload.

Jump to

Keyboard shortcuts

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