warp

package
v0.5.6-fuji-warp Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: GPL-3.0, LGPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWarpAPIFetcher added in v0.5.3

func NewWarpAPIFetcher(clients map[ids.NodeID]Client) *warpAPIFetcher

Types

type Backend added in v0.5.6

type Backend interface {
	// AddMessage signs [unsignedMessage] and adds it to the warp backend database
	AddMessage(unsignedMessage *avalancheWarp.UnsignedMessage) error

	// GetSignature returns the signature of the requested message hash.
	GetSignature(messageHash ids.ID) ([bls.SignatureLen]byte, error)

	// GetMessage retrieves the [unsignedMessage] from the warp backend database if available
	GetMessage(messageHash ids.ID) (*avalancheWarp.UnsignedMessage, error)

	// Clear clears the entire db
	Clear() error
}

Backend tracks signature-eligible warp messages and provides an interface to fetch them. The backend is also used to query for warp message signatures by the signature request handler.

func NewBackend added in v0.5.6

func NewBackend(warpSigner avalancheWarp.Signer, db database.Database, cacheSize int) Backend

NewBackend creates a new Backend, and initializes the signature cache and message tracking database.

type Client added in v0.5.6

type Client interface {
	// GetSignature requests the BLS signature associated with a messageID
	GetSignature(ctx context.Context, messageID ids.ID) ([]byte, error)
	// GetAggregateSignature requests the aggregate signature associated with messageID
	GetAggregateSignature(ctx context.Context, messageID ids.ID, quorumNum uint64) ([]byte, error)
}

func NewClient added in v0.5.6

func NewClient(uri, chain string) (Client, error)

NewClient returns a Client for interacting with EVM [chain]

type WarpAPI

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

WarpAPI introduces snowman specific functionality to the evm

func NewWarpAPI added in v0.5.3

func NewWarpAPI(backend Backend, aggregator *aggregator.Aggregator) *WarpAPI

func (*WarpAPI) GetAggregateSignature added in v0.5.3

func (api *WarpAPI) GetAggregateSignature(ctx context.Context, messageID ids.ID, quorumNum uint64) (signedMessageBytes hexutil.Bytes, err error)

GetAggregateSignature fetches the aggregate signature for the requested [messageID]

func (*WarpAPI) GetSignature

func (api *WarpAPI) GetSignature(ctx context.Context, messageID ids.ID) (hexutil.Bytes, error)

GetSignature returns the BLS signature associated with a messageID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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