spy

package
v0.0.0-...-b93a54a Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const RpcTimeout = time.Second * 5

RpcTimeout is the context timeout on RPC calls.

Variables

View Source
var SpyCmd = &cobra.Command{
	Use:   "spy",
	Short: "Run gossip spy client",
	Run:   runSpy,
}

SpyCmd represents the node command

Functions

func DoWithTimeout

func DoWithTimeout(f func() error, d time.Duration) error

DoWithTimeout runs f and returns its error. If the deadline d elapses first, it returns a grpc DeadlineExceeded error instead.

Types

type VaaVerifier

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

VaaVerifier is an object that can be used to validate VAA signatures. It reads the guardian set on chain whenever a new guardian set index is detected.

func NewVaaVerifier

func NewVaaVerifier(logger *zap.Logger, rpcUrl string, coreAddr string) *VaaVerifier

NewVaaVerifier creates a VaaVerifier.

func (*VaaVerifier) GetInitialGuardianSet

func (v *VaaVerifier) GetInitialGuardianSet() error

GetInitialGuardianSet gets the current guardian set and adds it to the map. It is not necessary to call this function, but doing so will allow you to verify that the RPC endpoint works on start up, rather than having it fail the first VAA is received.

func (*VaaVerifier) VerifySignatures

func (v *VaaVerifier) VerifySignatures(vv *vaa.VAA) (bool, error)

VerifySignatures verifies that the signature on a VAA is valid, based on the guardian set contained in the VAA. If the guardian set is not currently in our map, it queries that guardian set and adds it.

Jump to

Keyboard shortcuts

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