local_v1

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCurve elliptic.Curve = btcec.S256()

DefaultCurve is the default elliptic curve implementation used in the chain/local package. The local chain uses the secp256k1 curve and the specific implementation is provided by the btcec package. Normally, the go-ethereum implementation could be used as well but that implementation has an unset elliptic curve name (elliptic.Curve.Params().Name returns an empty string) so that curve cannot be easily used with operator.GenerateKeyPair which is widely used in the local chain environment. This is why the btcec implementation is used.

Functions

func BlockCounter

func BlockCounter(blockTime ...time.Duration) (chain.BlockCounter, error)

BlockCounter creates a BlockCounter that runs completely locally. It is designed to simply increase block height at a set time interval in the background.

func Connect

func Connect(
	groupSize int,
	honestThreshold int,
) *localChain

Connect initializes a local stub implementation of the chain interfaces for testing. It uses auto-generated operator key.

func ConnectWithKey

func ConnectWithKey(
	groupSize int,
	honestThreshold int,
	operatorPrivateKey *operator.PrivateKey,
) *localChain

ConnectWithKey initializes a local stub implementation of the chain interfaces for testing.

func GenerateHandlerID

func GenerateHandlerID() int

func NewSigner

func NewSigner(operatorPrivateKey *operator.PrivateKey) *signer

Types

This section is empty.

Jump to

Keyboard shortcuts

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