config

package
v0.0.0-...-54462b1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRpcURL = "http://localhost:8545"

Variables

This section is empty.

Functions

func ValidateContractInfos

func ValidateContractInfos(cis []ContractInfo) error

func WriteConfig

func WriteConfig(path string, conf *Config) error

func WriteContractInfos

func WriteContractInfos(path string, infos []ContractInfo) error

WriteContractInfos writes the contract information to a file

Types

type Config

type Config struct {
	RpcURL     string `toml:"rpc_url"`
	PrivateKey string `toml:"private_key"`
	ChainId    uint64 `toml:"chain_id"`
	WaitTime   string `toml:"wait_time"`
}

func DefaultConfig

func DefaultConfig() *Config

func ReadConfig

func ReadConfig(path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type ContractInfo

type ContractInfo struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

func ReadContractInfos

func ReadContractInfos(path string) ([]ContractInfo, error)

func (ContractInfo) Validate

func (ci ContractInfo) Validate() error

Jump to

Keyboard shortcuts

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