Help us shape the future of Go! Take the 2026 Go Developer Survey

bft

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const CodecVersion = warp.CodecVersion + 1

Variables

Functions

func NewBLSAuth

func NewBLSAuth(config *Config) (BLSSigner, BLSVerifier)

Types

type BLSSigner

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

BLSSigner signs messages encoded with the provided ChainID and NetworkID. using the SignBLS function.

func (*BLSSigner) Sign

func (s *BLSSigner) Sign(message []byte) ([]byte, error)

Sign returns a signature on the given message using BLS signature scheme. It encodes the message to sign with the chain ID, and network ID,

type BLSVerifier

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

func (BLSVerifier) Verify

func (v BLSVerifier) Verify(message []byte, signature []byte, signer simplex.NodeID) error

type Block

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

func (*Block) BlockHeader

func (b *Block) BlockHeader() simplex.BlockHeader

BlockHeader returns the block header for the block.

func (*Block) Bytes

func (b *Block) Bytes() ([]byte, error)

Bytes returns the serialized bytes of the block.

func (*Block) Verify

func (b *Block) Verify(ctx context.Context) (simplex.VerifiedBlock, error)

Verify verifies the block.

type Comm

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

func NewComm

func NewComm(config *Config) (*Comm, error)

func (*Comm) Broadcast

func (c *Comm) Broadcast(msg *simplex.Message)

func (*Comm) Nodes

func (c *Comm) Nodes() []simplex.NodeID

func (*Comm) Send

func (c *Comm) Send(msg *simplex.Message, destination simplex.NodeID)

type Config

type Config struct {
	Ctx SimplexChainContext
	Log log.Logger

	Sender             sender.ExternalSender
	OutboundMsgBuilder message.OutboundMsgBuilder

	// Validators is a map of node IDs to their validator information.
	// This tells the node about the current membership set, and should be consistent
	// across all nodes in the subnet.
	Validators map[ids.NodeID]*validators.GetValidatorOutput

	// SignBLS is the signing function used for this node to sign messages.
	SignBLS SignFunc
}

Config wraps all the parameters needed for a simplex engine

type SignFunc

type SignFunc func(msg []byte) (*bls.Signature, error)

type SimplexChainContext

type SimplexChainContext struct {
	// Network is the ID of the network this context exists within.
	NodeID ids.NodeID

	// ChainID is the ID of the chain this context exists within.
	ChainID ids.ID

	// SubnetID is the ID of the subnet this context exists within.
	SubnetID ids.ID

	// NodeID is the ID of this node
	NetworkID uint32
}

Context is information about the current execution.

Jump to

Keyboard shortcuts

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