Documentation ¶
Index ¶
Constants ¶
View Source
const BootstrappedEthereumClient string = "BootstrappedEthereumClient"
BootstrappedEthereumClient is a key to mapped client in bootstrap context.
Variables ¶
This section is empty.
Functions ¶
func DefaultWaitForTransactionMiningContext ¶
func DefaultWaitForTransactionMiningContext(d time.Duration) (ctx context.Context, cancelFunc context.CancelFunc)
DefaultWaitForTransactionMiningContext returns context with timeout for write operations
Types ¶
type Bootstrapper ¶
type Bootstrapper struct{}
Bootstrapper implements bootstrap.Bootstrapper.
func (Bootstrapper) Bootstrap ¶
func (Bootstrapper) Bootstrap(context map[string]interface{}) error
Bootstrap initialises ethereum client.
type Client ¶
type Client interface { // GetEthClient returns the ethereum client GetEthClient() *ethclient.Client // GetNodeURL returns the node url GetNodeURL() *url.URL // GetTxOpts returns a cached options if available else creates and returns new options GetTxOpts(accountName string) (*bind.TransactOpts, error) // SubmitTransactionWithRetries submits transaction to the ethereum chain // Blocking Function that sends transaction using reflection wrapped in a retrial block. It is based on the transactionUnderpriced error, // meaning that a transaction is being attempted to run twice, and the logic is to override the existing one. As we have constant // gas prices that means that a concurrent transaction race condition event has happened. // - contractMethod: Contract Method that implements GenericEthereumAsset (usually autogenerated binding from abi) // - params: Arbitrary number of parameters that are passed to the function fname call // Note: contractMethod must always return "*types.Transaction, error" SubmitTransactionWithRetries(contractMethod interface{}, opts *bind.TransactOpts, params ...interface{}) (tx *types.Transaction, err error) // GetGethCallOpts returns the Call options with default GetGethCallOpts() (*bind.CallOpts, context.CancelFunc) }
Client can be implemented by any chain client
func NewGethClient ¶
NewGethClient returns an gethClient which implements Client
type Config ¶
type Config interface { GetEthereumGasPrice() *big.Int GetEthereumGasLimit() uint64 GetEthereumNodeURL() string GetEthereumAccount(accountName string) (account *config.AccountConfig, err error) GetEthereumIntervalRetry() time.Duration GetEthereumMaxRetries() int GetTxPoolAccessEnabled() bool GetEthereumContextReadWaitTimeout() time.Duration }
Config defines functions to get ethereum details
Click to show internal directories.
Click to hide internal directories.