ethereum

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 6 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// Keyfile is a full path to a key file.  Normally this file is one of the
	// imported keys in your local Ethereum server.  It can normally be found in
	// a directory <some-path>/data/keystore/ and starts with its creation date
	// "UTC--.*".
	KeyFile string

	// KeyFilePassword is the password used to unlock the account specified in
	// KeyFile.
	KeyFilePassword string
}

Account is a struct that contains the configuration for accessing an Ethereum network and a contract on the network.

type Config

type Config struct {
	// Example: "ws://192.168.0.157:8546".
	URL string

	// Example: "http://192.168.0.157:8545".
	URLRPC string

	// A  map from contract names to contract addresses.
	ContractAddresses map[string]string

	Account Account

	// MiningCheckInterval is the interval in which transaction
	// mining status is checked. If the transaction is not mined within this
	// time, the gas price is increased and transaction is resubmitted.
	MiningCheckInterval int

	// MaxGasPrice specifies the maximum gas price (in wei) the client is
	// willing to pay for the transaction to be mined. The offered transaction
	// gas price can not be higher than the max gas price value. If the maximum
	// allowed gas price is reached, no further resubmission attempts are
	// performed.
	MaxGasPrice *Wei

	// RequestsPerSecondLimit sets the maximum average number of requests
	// per second which can be executed against the Ethereum node.
	// All types of chain requests are rate-limited,
	// including view function calls.
	RequestsPerSecondLimit int

	// ConcurrencyLimit sets the maximum number of concurrent requests which
	// can be executed against the Ethereum node at the same time.
	// This limit affects all types of chain requests,
	// including view function calls.
	ConcurrencyLimit int

	// BalanceAlertThreshold defines a minimum value (wei) of the operator's account
	// balance below which an alert will be triggered.
	BalanceAlertThreshold *Wei
}

Config is a struct that contains the configuration needed to connect to an Ethereum node. This information will give access to an Ethereum network.

func (Config) ContractAddress

func (c Config) ContractAddress(contractName string) (*common.Address, error)

ContractAddress finds a given contract's address configuration and returns it as ethereum Address.

type Wei added in v1.3.0

type Wei struct {
	*big.Int
}

Wei is a custom type to handle Ether value parsing in configuration files using BurntSushi/toml package. It supports wei, Gwei and ether units. The Ether value is kept as `wei` and `wei` is the default unit. The value can be provided in the text file as e.g.: `1 wei`, `200 Gwei` or `0.5 ether`.

func (*Wei) UnmarshalText added in v1.3.0

func (e *Wei) UnmarshalText(text []byte) error

UnmarshalText is a function used to parse a value of Ethers.

Directories

Path Synopsis
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.

Jump to

Keyboard shortcuts

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