services

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Overview

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This work is licensed and released under GNU GPL v3 or any other later versions. The full text of the license is below/ found at <http://www.gnu.org/licenses/>

(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	DockerAPIVersion string = "1.40"
	BnContainerName  string = "eth2"
)

Config

View Source
const BeaconClientSyncTimeout = 16 // 16 seconds
View Source
const EthClientSyncTimeout = 16 // 16 seconds

Settings

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(c *cli.Context) (*config.StaderConfig, error)

func GetDocker

func GetDocker(c *cli.Context) (*client.Client, error)

func GetEthClientLatestBlockTimestamp

func GetEthClientLatestBlockTimestamp(ec stader.ExecutionClient) (uint64, error)

func GetEthxTokenAddress

func GetEthxTokenAddress(c *cli.Context) (common.Address, error)

func GetEthxTokenContract

func GetEthxTokenContract(c *cli.Context) (*stader.Erc20TokenContractManager, error)

func GetOperatorRewardsCollectorAddress

func GetOperatorRewardsCollectorAddress(c *cli.Context) (common.Address, error)

func GetPasswordManager

func GetPasswordManager(c *cli.Context) (*passwords.PasswordManager, error)

func GetPenaltyTrackerAddress

func GetPenaltyTrackerAddress(c *cli.Context) (common.Address, error)

func GetPenaltyTrackerContract

func GetPenaltyTrackerContract(c *cli.Context) (*stader.PenaltyTrackerContractManager, error)

func GetPermissionlessNodeRegistryAddress

func GetPermissionlessNodeRegistryAddress(c *cli.Context) (common.Address, error)

func GetPermissionlessPoolAddress

func GetPermissionlessPoolAddress(c *cli.Context) (common.Address, error)

func GetPoolUtilsAddress

func GetPoolUtilsAddress(c *cli.Context) (common.Address, error)

func GetPoolUtilsContract

func GetPoolUtilsContract(c *cli.Context) (*stader.PoolUtilsContractManager, error)

func GetSdCollateralAddress

func GetSdCollateralAddress(c *cli.Context) (common.Address, error)

func GetSdCollateralContract

func GetSdCollateralContract(c *cli.Context) (*stader.SdCollateralContractManager, error)

func GetSdTokenAddress

func GetSdTokenAddress(c *cli.Context) (common.Address, error)

func GetSdTokenContract

func GetSdTokenContract(c *cli.Context) (*stader.Erc20TokenContractManager, error)

func GetSdUtilityAddress added in v1.5.0

func GetSdUtilityAddress(c *cli.Context) (common.Address, error)

func GetSdUtilityContract added in v1.5.0

func GetSdUtilityContract(c *cli.Context) (*stader.SDUtilityPoolContractManager, error)

func GetSocializingPoolAddress

func GetSocializingPoolAddress(c *cli.Context) (common.Address, error)

func GetSocializingPoolContract

func GetSocializingPoolContract(c *cli.Context) (*stader.SocializingPoolContractManager, error)

func GetStaderConfigContract

func GetStaderConfigContract(c *cli.Context) (*stader.StaderConfigContractManager, error)

func GetStaderOracleAddress

func GetStaderOracleAddress(c *cli.Context) (common.Address, error)

func GetStakePoolManagerAddress

func GetStakePoolManagerAddress(c *cli.Context) (common.Address, error)

func GetVaultFactoryAddress

func GetVaultFactoryAddress(c *cli.Context) (common.Address, error)

func GetWallet

func GetWallet(c *cli.Context) (*wallet.Wallet, error)

func IsSyncWithinThreshold

func IsSyncWithinThreshold(ec stader.ExecutionClient) (bool, time.Time, error)

Confirm the EC's latest block is within the threshold of the current system clock

func RequireBeaconClientSynced

func RequireBeaconClientSynced(c *cli.Context) error

func RequireEthClientSynced

func RequireEthClientSynced(c *cli.Context) error

func RequireNodeActive

func RequireNodeActive(c *cli.Context) error

func RequireNodePassword

func RequireNodePassword(c *cli.Context) error

func RequireNodeRegistered

func RequireNodeRegistered(c *cli.Context) error

func RequireNodeWallet

func RequireNodeWallet(c *cli.Context) error

func WaitBeaconClientSynced

func WaitBeaconClientSynced(c *cli.Context, verbose bool) error

func WaitEthClientSynced

func WaitEthClientSynced(c *cli.Context, verbose bool) error

func WaitNodePassword

func WaitNodePassword(c *cli.Context, verbose bool) error

func WaitNodeRegistered

func WaitNodeRegistered(c *cli.Context, operatorAddress common.Address, verbose bool) error

func WaitNodeWallet

func WaitNodeWallet(c *cli.Context, verbose bool) error

Types

type BeaconClientManager

type BeaconClientManager struct {
	// contains filtered or unexported fields
}

This is a proxy for multiple Beacon clients, providing natural fallback support if one of them fails.

func GetBeaconClient

func GetBeaconClient(c *cli.Context) (*BeaconClientManager, error)

func NewBeaconClientManager

func NewBeaconClientManager(cfg *config.StaderConfig) (*BeaconClientManager, error)

Creates a new BeaconClientManager instance based on the Stader config

func (*BeaconClientManager) CheckStatus

func (m *BeaconClientManager) CheckStatus() *api.ClientManagerStatus

func (*BeaconClientManager) Close

func (m *BeaconClientManager) Close() error

Close the connection to the Beacon client

func (*BeaconClientManager) ExitValidator

func (m *BeaconClientManager) ExitValidator(validatorIndex, epoch uint64, signature types.ValidatorSignature) error

Voluntarily exit a validator

func (*BeaconClientManager) GetAttestations

func (m *BeaconClientManager) GetAttestations(blockId string) ([]beacon.AttestationInfo, bool, error)

Get the attestations in a Beacon chain block

func (*BeaconClientManager) GetBeaconBlock

func (m *BeaconClientManager) GetBeaconBlock(blockId string) (beacon.BeaconBlock, bool, error)

Get a Beacon chain block

func (*BeaconClientManager) GetBeaconHead

func (m *BeaconClientManager) GetBeaconHead() (beacon.BeaconHead, error)

Get the Beacon chain's head information

func (*BeaconClientManager) GetClientType

func (m *BeaconClientManager) GetClientType() (beacon.BeaconClientType, error)

Get the client's process mode

func (*BeaconClientManager) GetCommitteesForEpoch

func (m *BeaconClientManager) GetCommitteesForEpoch(epoch *uint64) ([]beacon.Committee, error)

Get the attestation committees for an epoch

func (*BeaconClientManager) GetEth1DataForEth2Block

func (m *BeaconClientManager) GetEth1DataForEth2Block(blockId string) (beacon.Eth1Data, bool, error)

Get the EL data for a CL block

func (*BeaconClientManager) GetEth2Config

func (m *BeaconClientManager) GetEth2Config() (beacon.Eth2Config, error)

Get the Beacon configuration

func (*BeaconClientManager) GetEth2DepositContract

func (m *BeaconClientManager) GetEth2DepositContract() (beacon.Eth2DepositContract, error)

Get the Beacon configuration

func (*BeaconClientManager) GetExitDomainData added in v1.4.7

func (m *BeaconClientManager) GetExitDomainData(domainType []byte, network cfgtypes.Network) ([]byte, error)

Get the Beacon chain's domain data

func (*BeaconClientManager) GetNodeVersion added in v1.4.9

func (m *BeaconClientManager) GetNodeVersion() (beacon.NodeVersion, error)

func (*BeaconClientManager) GetSyncStatus

func (m *BeaconClientManager) GetSyncStatus() (beacon.SyncStatus, error)

Get the client's sync status

func (*BeaconClientManager) GetValidatorIndex

func (m *BeaconClientManager) GetValidatorIndex(pubkey types.ValidatorPubkey) (uint64, error)

Get a validator's index

func (*BeaconClientManager) GetValidatorProposerDuties

func (m *BeaconClientManager) GetValidatorProposerDuties(indices []uint64, epoch uint64) (map[uint64]uint64, error)

Get a validator's proposer duties

func (*BeaconClientManager) GetValidatorStatus

Get a validator's status by its pubkey

func (*BeaconClientManager) GetValidatorStatusByIndex

func (m *BeaconClientManager) GetValidatorStatusByIndex(index string, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)

Get a validator's status by its index

func (*BeaconClientManager) GetValidatorStatuses

Get the statuses of multiple validators by their pubkeys

func (*BeaconClientManager) GetValidatorSyncDuties

func (m *BeaconClientManager) GetValidatorSyncDuties(indices []uint64, epoch uint64) (map[uint64]bool, error)

Get a validator's sync duties

type ExecutionClientManager

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

func NewExecutionClientManager(cfg *config.StaderConfig) (*ExecutionClientManager, error)

Creates a new ExecutionClientManager instance based on the Stader config

func (*ExecutionClientManager) BalanceAt

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

func (p *ExecutionClientManager) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the most recent block number

func (*ExecutionClientManager) CallContract

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

func (*ExecutionClientManager) CodeAt

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

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

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.

func (*ExecutionClientManager) HeaderByHash

func (p *ExecutionClientManager) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

HeaderByHash returns the block header with the given hash.

func (*ExecutionClientManager) HeaderByNumber

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

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

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

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

func (p *ExecutionClientManager) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects the transaction into the pending pool for execution.

func (*ExecutionClientManager) SubscribeFilterLogs

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

func (p *ExecutionClientManager) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.

func (*ExecutionClientManager) SuggestGasTipCap

func (p *ExecutionClientManager) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

SuggestGasTipCap retrieves the currently suggested 1559 priority fee to allow a timely execution of a transaction.

func (*ExecutionClientManager) SyncProgress

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

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

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.

func (*ExecutionClientManager) Version added in v1.4.9

func (p *ExecutionClientManager) Version() (string, error)

Directories

Path Synopsis
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
client
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
gas
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
etherchain
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
etherscan
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
keystore
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
keystore/lighthouse
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
keystore/nimbus
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
keystore/prysm
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.
keystore/teku
This work is licensed and released under GNU GPL v3 or any other later versions.
This work is licensed and released under GNU GPL v3 or any other later versions.

Jump to

Keyboard shortcuts

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