Documentation ¶
Index ¶
- Constants
- func GetBeaconClient(c *cli.Context) (beacon.Client, error)
- func GetConfig(c *cli.Context) (*config.RocketPoolConfig, error)
- func GetDocker(c *cli.Context) (*client.Client, error)
- func GetEthClientLatestBlockTimestamp(ec rocketpool.ExecutionClient) (uint64, error)
- func GetOneInchOracle(c *cli.Context) (*contracts.OneInchOracle, error)
- func GetPasswordManager(c *cli.Context) (*passwords.PasswordManager, error)
- func GetRocketPool(c *cli.Context) (*rocketpool.RocketPool, error)
- func GetRplFaucet(c *cli.Context) (*contracts.RPLFaucet, error)
- func GetSnapshotDelegation(c *cli.Context) (*contracts.SnapshotDelegation, error)
- func GetWallet(c *cli.Context) (*wallet.Wallet, error)
- func IsSyncWithinThreshold(ec rocketpool.ExecutionClient) (bool, time.Time, error)
- func RequireBeaconClientSynced(c *cli.Context) error
- func RequireEthClientSynced(c *cli.Context) error
- func RequireNodePassword(c *cli.Context) error
- func RequireNodeRegistered(c *cli.Context) error
- func RequireNodeTrusted(c *cli.Context) error
- func RequireNodeWallet(c *cli.Context) error
- func RequireOneInchOracle(c *cli.Context) error
- func RequireRocketStorage(c *cli.Context) error
- func RequireRplFaucet(c *cli.Context) error
- func WaitBeaconClientSynced(c *cli.Context, verbose bool) error
- func WaitEthClientSynced(c *cli.Context, verbose bool) error
- func WaitNodePassword(c *cli.Context, verbose bool) error
- func WaitNodeRegistered(c *cli.Context, verbose bool) error
- func WaitNodeWallet(c *cli.Context, verbose bool) error
- func WaitRocketStorage(c *cli.Context, verbose bool) error
- type ExecutionClientManager
- func (p *ExecutionClientManager) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (p *ExecutionClientManager) BlockNumber(ctx context.Context) (uint64, error)
- func (p *ExecutionClientManager) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (p *ExecutionClientManager) CheckStatus(alwaysCheckFallback bool) *api.ExecutionClientManagerStatus
- func (p *ExecutionClientManager) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
- func (p *ExecutionClientManager) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (p *ExecutionClientManager) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (p *ExecutionClientManager) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (p *ExecutionClientManager) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (p *ExecutionClientManager) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (p *ExecutionClientManager) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (p *ExecutionClientManager) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (p *ExecutionClientManager) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (p *ExecutionClientManager) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (p *ExecutionClientManager) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (p *ExecutionClientManager) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
- func (p *ExecutionClientManager) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
- func (p *ExecutionClientManager) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
Constants ¶
const ( DockerAPIVersion string = "1.40" EcContainerName string = "eth1" FallbackEcContainerName string = "eth1-fallback" BnContainerName string = "eth2" )
Config
const BeaconClientSyncTimeout = 16 // 16 seconds
const EthClientSyncTimeout = 16 // 16 seconds
Settings
Variables ¶
This section is empty.
Functions ¶
func GetEthClientLatestBlockTimestamp ¶ added in v1.1.0
func GetEthClientLatestBlockTimestamp(ec rocketpool.ExecutionClient) (uint64, error)
func GetOneInchOracle ¶ added in v1.0.0
func GetOneInchOracle(c *cli.Context) (*contracts.OneInchOracle, error)
func GetPasswordManager ¶
func GetPasswordManager(c *cli.Context) (*passwords.PasswordManager, error)
func GetRocketPool ¶
func GetRocketPool(c *cli.Context) (*rocketpool.RocketPool, error)
func GetSnapshotDelegation ¶ added in v1.4.2
func GetSnapshotDelegation(c *cli.Context) (*contracts.SnapshotDelegation, error)
func IsSyncWithinThreshold ¶ added in v1.4.0
func IsSyncWithinThreshold(ec rocketpool.ExecutionClient) (bool, time.Time, error)
Confirm the EC's latest block is within the threshold of the current system clock
func RequireEthClientSynced ¶
func RequireNodePassword ¶
func RequireNodeRegistered ¶
func RequireNodeTrusted ¶ added in v1.0.0
func RequireNodeWallet ¶
func RequireOneInchOracle ¶ added in v1.0.0
func RequireRocketStorage ¶
func RequireRplFaucet ¶ added in v1.0.0
Types ¶
type ExecutionClientManager ¶ added in v1.4.0
type ExecutionClientManager struct {
// contains filtered or unexported fields
}
This is a proxy for multiple ETH clients, providing natural fallback support if one of them fails.
func GetEthClient ¶
func GetEthClient(c *cli.Context) (*ExecutionClientManager, error)
func NewExecutionClientManager ¶ added in v1.4.0
func NewExecutionClientManager(cfg *config.RocketPoolConfig) (*ExecutionClientManager, error)
Creates a new ExecutionClientManager instance based on the Rocket Pool config
func (*ExecutionClientManager) BalanceAt ¶ added in v1.4.0
func (p *ExecutionClientManager) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.
func (*ExecutionClientManager) BlockNumber ¶ added in v1.4.0
func (p *ExecutionClientManager) BlockNumber(ctx context.Context) (uint64, error)
BlockNumber returns the most recent block number
func (*ExecutionClientManager) CallContract ¶ added in v1.4.0
func (p *ExecutionClientManager) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract executes an Ethereum contract call with the specified data as the input.
func (*ExecutionClientManager) CheckStatus ¶ added in v1.4.0
func (p *ExecutionClientManager) CheckStatus(alwaysCheckFallback bool) *api.ExecutionClientManagerStatus
func (*ExecutionClientManager) CodeAt ¶ added in v1.4.0
func (p *ExecutionClientManager) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
CodeAt returns the code of the given account. This is needed to differentiate between contract internal errors and the local chain being out of sync.
func (*ExecutionClientManager) EstimateGas ¶ added in v1.4.0
func (p *ExecutionClientManager) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.
func (*ExecutionClientManager) FilterLogs ¶ added in v1.4.0
func (p *ExecutionClientManager) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
FilterLogs executes a log filter operation, blocking during execution and returning all the results in one batch.
TODO(karalabe): Deprecate when the subscription one can return past data too.
func (*ExecutionClientManager) HeaderByNumber ¶ added in v1.4.0
func (p *ExecutionClientManager) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.
func (*ExecutionClientManager) NonceAt ¶ added in v1.4.0
func (p *ExecutionClientManager) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
NonceAt returns the account nonce of the given account. The block number can be nil, in which case the nonce is taken from the latest known block.
func (*ExecutionClientManager) PendingCodeAt ¶ added in v1.4.0
func (p *ExecutionClientManager) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
PendingCodeAt returns the code of the given account in the pending state.
func (*ExecutionClientManager) PendingNonceAt ¶ added in v1.4.0
func (p *ExecutionClientManager) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
PendingNonceAt retrieves the current pending nonce associated with an account.
func (*ExecutionClientManager) SendTransaction ¶ added in v1.4.0
func (p *ExecutionClientManager) SendTransaction(ctx context.Context, tx *types.Transaction) error
SendTransaction injects the transaction into the pending pool for execution.
func (*ExecutionClientManager) SubscribeFilterLogs ¶ added in v1.4.0
func (p *ExecutionClientManager) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
SubscribeFilterLogs creates a background log filtering operation, returning a subscription immediately, which can be used to stream the found events.
func (*ExecutionClientManager) SuggestGasPrice ¶ added in v1.4.0
SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.
func (*ExecutionClientManager) SuggestGasTipCap ¶ added in v1.4.0
SuggestGasTipCap retrieves the currently suggested 1559 priority fee to allow a timely execution of a transaction.
func (*ExecutionClientManager) SyncProgress ¶ added in v1.4.0
func (p *ExecutionClientManager) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
SyncProgress retrieves the current progress of the sync algorithm. If there's no sync currently running, it returns nil.
func (*ExecutionClientManager) TransactionByHash ¶ added in v1.4.0
func (p *ExecutionClientManager) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
TransactionByHash returns the transaction with the given hash.
func (*ExecutionClientManager) TransactionReceipt ¶ added in v1.4.0
func (p *ExecutionClientManager) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
TransactionReceipt returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.