devnet

package
v0.0.0-...-e8e2c10 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

package devnet contains constants and helper functions for the local deterministic devnet. See "Devnet addresses" in DEVELOP.md. Created by setup scripts/migrations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Ganache RPC URL
	GanacheRPCURL = "ws://localhost:8545"

	// Address of the first account, which is used as the default client account.
	GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1")

	// Contracts (deployed by "truffle migrate" on a deterministic devnet)
	GanacheWormholeContractAddress = common.HexToAddress("0xC89Ce4735882C9F0f0FE26686c53074E09B0D550")
)

Functions

func DeriveAccount

func DeriveAccount(accountIndex uint) accounts.Account

func DeterministicP2PPrivKeyByIndex

func DeterministicP2PPrivKeyByIndex(idx int64) crypto.PrivKey

DeterministicP2PPrivKeyByIndex generates a deterministic libp2p crypto.PrivateKey from a given index.

func DevnetGuardianSetVSS

func DevnetGuardianSetVSS(n uint) *vaa.VAA

DevnetGuardianSetVSS returns a VAA signed by guardian-0 that adds all n validators.

func GetDevnetIndex

func GetDevnetIndex() (int, error)

GetDevnetIndex returns the current host's devnet index (i.e. 0 for guardian-0).

func GetKeyedTransactor

func GetKeyedTransactor(ctx context.Context) *bind.TransactOpts

GetKeyedTransactor returns a transaction signer with the deterministic devnet key.

func InsecureDeterministicEcdsaKeyByIndex

func InsecureDeterministicEcdsaKeyByIndex(c elliptic.Curve, idx uint64) *ecdsa.PrivateKey

InsecureDeterministicEcdsaKeyByIndex generates a deterministic ecdsa.PrivateKey from a given index.

func MustBase58ToEthAddress

func MustBase58ToEthAddress(address string) (res vaa.Address)

Base58ToEthAddress converts a Solana base58 address to a 32-byte vaa.Address. Panics if the input data is invalid - intended for use on constants.

func SubmitVAA

func SubmitVAA(ctx context.Context, rpcURL string, vaa *vaa.VAA) (*types.Transaction, error)

SubmitVAA submits a VAA to the devnet chain using well-known accounts and contract addresses.

func Wallet

func Wallet() *hdwallet.Wallet

Types

This section is empty.

Jump to

Keyboard shortcuts

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