blockchain

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultBesuPrivateKey1 = "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63"
	DefaultBesuPrivateKey2 = "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"
	DefaultBesuPrivateKey3 = "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f"
)
View Source
const (
	RootFundingAddr   = `0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266`
	RootFundingWallet = `` /* 491-byte string literal not displayed */
	GenesisClique     = `` /* 921-byte string literal not displayed */

	DefaultGethPrivateKey = `ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
)
View Source
const (
	DefaultFaucetPort    = "9123/tcp"
	DefaultFaucetPortNum = "9123"
	DefaultSuiNodePort   = "9000"
)
View Source
const (
	DefaultAnvilPrivateKey = `ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
)
View Source
const (
	DefaultTronPort = "9090"
)

Variables

View Source
var (
	DefaultAptosAccount    = "0xa337b42bd0eecf8fb59ee5929ea4541904b3c35a642040223f3d26ab57f59d6e"
	DefaultAptosPrivateKey = "0xd477c65f88ed9e6d4ec6e2014755c3cfa3e0c44e521d0111a02868c5f04c41d4"
)
View Source
var TRONAccounts = Accounts{
	HDPath:   "m/44'/195'/0'/0/",
	Mnemonic: "resemble birth wool happy sun burger fatal trumpet globe purity health ritual",
	PrivateKeys: []string{
		"932a39242805a1b1095638027f26af9664d1d5bf8ab3b7527ee75e7efb2946dd",
		"1c17c9c049d36cde7e5ea99df6c86e0474b04f0e258ab619a1e674f397a17152",
		"458130a239671674746582184711a6f8d633355df1a491b9f3b323576134c2e9",
		"2676fd1427968e07feaa9aff967d4ba7607c5497c499968c098d0517cd75cfbb",
		"d26b24a691ff2b03ee6ab65bf164def216f73574996b9ca6299c43a9a63767ac",
		"55df6adf3d081944dbe4688205d94f236fb4427ac44f3a286a96d47db0860667",
		"8a9a60ddd722a40753c2a38edd6b6fa38e806d681c9b08a520ba4912e62b6458",
		"75eb182fb623acf5e53d9885c4e8578f2530533a96c753481cc4277ecc6022de",
		"6c4b22b1d9d68ef7a8ecd151cd4ffdd4ecc2a7b3a3f8a9f9f9bbdbcef6671f10",
		"e578d66453cb41b6c923b9caa91c375a0545eeb171ccafc60b46fa834ce5c200",
	},

	More: []string{},
}

Functions

func VerifyContract added in v0.3.1

func VerifyContract(out *Output, address, foundryDir, contractFile, contractName, compilerVersion string) error

VerifyContract wraps the forge verify-contract command.

Types

type Accounts added in v0.4.5

type Accounts struct {
	HDPath      string   `json:"hdPath"`
	Mnemonic    string   `json:"mnemonic"`
	PrivateKeys []string `json:"privateKeys"`
	More        []string `json:"more"`
}

type Input

type Input struct {
	// Common EVM fields
	Type      string `toml:"type" validate:"required,oneof=anvil geth besu solana aptos tron sui" envconfig:"net_type"`
	Image     string `toml:"image"`
	PullImage bool   `toml:"pull_image"`
	Port      string `toml:"port"`
	// Not applicable to Solana, ws port for Solana is +1 of port
	WSPort                   string   `toml:"port_ws"`
	ChainID                  string   `toml:"chain_id"`
	DockerCmdParamsOverrides []string `toml:"docker_cmd_params"`
	Out                      *Output  `toml:"out"`

	// Solana fields
	// publickey to mint when solana-test-validator starts
	PublicKey    string `toml:"public_key"`
	ContractsDir string `toml:"contracts_dir"`
	// programs to deploy on solana-test-validator start
	// a map of program name to program id
	// there needs to be a matching .so file in contracts_dir
	SolanaPrograms map[string]string `toml:"solana_programs"`
}

Input is a blockchain network configuration params

type NetworkSpecificData added in v0.4.4

type NetworkSpecificData struct {
	SuiAccount *SuiWalletInfo
}

type Node

type Node struct {
	HostWSUrl             string `toml:"ws_url"`
	HostHTTPUrl           string `toml:"http_url"`
	DockerInternalWSUrl   string `toml:"docker_internal_ws_url"`
	DockerInternalHTTPUrl string `toml:"docker_internal_http_url"`
}

Node represents blockchain node output, URLs required for connection locally and inside docker network

type Output

type Output struct {
	UseCache            bool                     `toml:"use_cache"`
	Family              string                   `toml:"family"`
	ContainerName       string                   `toml:"container_name"`
	NetworkSpecificData *NetworkSpecificData     `toml:"network_specific_data"`
	Container           testcontainers.Container `toml:"-"`
	ChainID             string                   `toml:"chain_id"`
	Nodes               []*Node                  `toml:"nodes"`
}

Output is a blockchain network output, ChainID and one or more nodes that forms the network

func NewBlockchainNetwork

func NewBlockchainNetwork(in *Input) (*Output, error)

NewBlockchainNetwork this is an abstraction that can spin up various blockchain network simulators

type SuiWalletInfo added in v0.4.4

type SuiWalletInfo struct {
	Alias           *string `json:"alias"`           // Alias key name, usually "null"
	Flag            int     `json:"flag"`            // Flag is an integer
	KeyScheme       string  `json:"keyScheme"`       // Key scheme is a string
	Mnemonic        string  `json:"mnemonic"`        // Mnemonic is a string
	PeerId          string  `json:"peerId"`          // Peer ID is a string
	PublicBase64Key string  `json:"publicBase64Key"` // Public key in Base64 format
	SuiAddress      string  `json:"suiAddress"`      // Sui address is a 0x prefixed hex string
}

SuiWalletInfo info about Sui account/wallet

Jump to

Keyboard shortcuts

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