node

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeAddressBatchSize               = 50
	NodeDetailsBatchSize               = 20
	SmoothingPoolCountBatchSize uint64 = 2000
	NativeNodeDetailsBatchSize         = 10000
)

Settings

Variables

This section is empty.

Functions

func CalculateTotalEffectiveRPLStake

func CalculateTotalEffectiveRPLStake(rp *rocketpool.RocketPool, offset, limit, rplPrice *big.Int, opts *bind.CallOpts) (*big.Int, error)

Calculate total effective RPL stake

func CreateVacantMinipool

func CreateVacantMinipool(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, salt *big.Int, expectedMinipoolAddress common.Address, currentBalance *big.Int, opts *bind.TransactOpts) (*types.Transaction, error)

Make a vacant minipool for solo staker migration

func Deposit

func Deposit(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (*types.Transaction, error)

Make a node deposit

func DepositWithCredit

func DepositWithCredit(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (*types.Transaction, error)

Make a node deposit by using the credit balance

func EstimateCreateVacantMinipoolGas

func EstimateCreateVacantMinipoolGas(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, salt *big.Int, expectedMinipoolAddress common.Address, currentBalance *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of CreateVacantMinipool

func EstimateDepositGas

func EstimateDepositGas(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of Deposit

func EstimateDepositWithCreditGas

func EstimateDepositWithCreditGas(rp *rocketpool.RocketPool, bondAmount *big.Int, minimumNodeFee float64, validatorPubkey rptypes.ValidatorPubkey, validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of DepositWithCredit

func EstimateInitializeFeeDistributorGas

func EstimateInitializeFeeDistributorGas(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas for creating the fee distributor contract for a node

func EstimateRegisterNodeGas

func EstimateRegisterNodeGas(rp *rocketpool.RocketPool, timezoneLocation string, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of RegisterNode

func EstimateSetSmoothingPoolRegistrationStateGas

func EstimateSetSmoothingPoolRegistrationStateGas(rp *rocketpool.RocketPool, optIn bool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas for opting into / out of the smoothing pool

func EstimateSetStakeRPLForAllowedGas

func EstimateSetStakeRPLForAllowedGas(rp *rocketpool.RocketPool, caller common.Address, allowed bool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of set stake RPL for allowed

func EstimateSetTimezoneLocationGas

func EstimateSetTimezoneLocationGas(rp *rocketpool.RocketPool, timezoneLocation string, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of SetTimezoneLocation

func EstimateStakeGas

func EstimateStakeGas(rp *rocketpool.RocketPool, rplAmount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of Stake

func EstimateWithdrawRPLGas

func EstimateWithdrawRPLGas(rp *rocketpool.RocketPool, rplAmount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of WithdrawRPL

func GetBalancesSubmissions

func GetBalancesSubmissions(rp *rocketpool.RocketPool, nodeAddress common.Address, fromBlock uint64, intervalSize *big.Int, opts *bind.CallOpts) (*[]uint64, error)

Returns an array of block numbers for balances submissions the given trusted node has submitted since fromBlock

func GetDistributorAddress

func GetDistributorAddress(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (common.Address, error)

Gets the deterministic address for a node's reward distributor contract

func GetFeeDistributorInitialized

func GetFeeDistributorInitialized(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (bool, error)

Check if a node's fee distributor has been initialized yet

func GetLatestBalancesSubmissions

func GetLatestBalancesSubmissions(rp *rocketpool.RocketPool, fromBlock uint64, intervalSize *big.Int, opts *bind.CallOpts) ([]common.Address, error)

Returns an array of members who submitted a balance since fromBlock

func GetLatestPricesSubmissions

func GetLatestPricesSubmissions(rp *rocketpool.RocketPool, fromBlock uint64, intervalSize *big.Int, opts *bind.CallOpts) ([]common.Address, error)

Returns an array of members who submitted prices since fromBlock

func GetNodeAddresses

func GetNodeAddresses(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]common.Address, error)

Get all node addresses

func GetNodeAt

func GetNodeAt(rp *rocketpool.RocketPool, index uint64, opts *bind.CallOpts) (common.Address, error)

Get a node address by index

func GetNodeAverageFee

func GetNodeAverageFee(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (float64, error)

Get a node's average minipool fee

func GetNodeAverageFeeRaw

func GetNodeAverageFeeRaw(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's average minipool fee

func GetNodeCount

func GetNodeCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the number of nodes in the network

func GetNodeDepositCredit

func GetNodeDepositCredit(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the amount of ETH in the node's deposit credit bank

func GetNodeEffectiveRPLStake

func GetNodeEffectiveRPLStake(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's effective RPL stake

func GetNodeEthMatched

func GetNodeEthMatched(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the amount of ETH the node has borrowed from the deposit pool to create its minipools

func GetNodeEthMatchedLimit

func GetNodeEthMatchedLimit(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the amount of ETH the node can borrow from the deposit pool to create its minipools

func GetNodeExists

func GetNodeExists(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (bool, error)

Check whether a node exists

func GetNodeManagerVersion

func GetNodeManagerVersion(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint8, error)

Get the version of the Node Manager contract

func GetNodeMaximumRPLStake

func GetNodeMaximumRPLStake(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's maximum RPL stake to collateralize their minipools

func GetNodeMinimumRPLStake

func GetNodeMinimumRPLStake(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's minimum RPL stake to collateralize their minipools

func GetNodeRPLStake

func GetNodeRPLStake(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's RPL stake

func GetNodeRPLStakedTime

func GetNodeRPLStakedTime(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get the time a node last staked RPL

func GetNodeRegistrationTime

func GetNodeRegistrationTime(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (time.Time, error)

Get the time that the user registered as a claimer

func GetNodeRegistrationTimeRaw

func GetNodeRegistrationTimeRaw(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the time that the user registered as a claimer

func GetNodeStakingVersion

func GetNodeStakingVersion(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint8, error)

Get the version of the Node Staking contract

func GetNodeTimezoneLocation

func GetNodeTimezoneLocation(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (string, error)

Get a node's timezone location

func GetPricesSubmissions

func GetPricesSubmissions(rp *rocketpool.RocketPool, nodeAddress common.Address, fromBlock uint64, intervalSize *big.Int, opts *bind.CallOpts) (*[]uint64, error)

Returns an array of block numbers for prices submissions the given trusted node has submitted since fromBlock

func GetRewardNetwork

func GetRewardNetwork(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get the network ID for a node's rewards

func GetRewardNetworkRaw

func GetRewardNetworkRaw(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the network ID for a node's rewards

func GetSmoothingPoolRegisteredNodeCount

func GetSmoothingPoolRegisteredNodeCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the number of nodes in the Smoothing Pool

func GetSmoothingPoolRegistrationChanged

func GetSmoothingPoolRegistrationChanged(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (time.Time, error)

Get the time of the previous smoothing pool opt-in / opt-out

func GetSmoothingPoolRegistrationChangedRaw

func GetSmoothingPoolRegistrationChangedRaw(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get the time of the previous smoothing pool opt-in / opt-out

func GetSmoothingPoolRegistrationState

func GetSmoothingPoolRegistrationState(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (bool, error)

Get the smoothing pool opt-in status of a node

func GetTotalRPLStake

func GetTotalRPLStake(rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)

Get the total RPL staked in the network

func GetTrustedNodeLatestBalancesParticipation

func GetTrustedNodeLatestBalancesParticipation(rp *rocketpool.RocketPool, intervalSize *big.Int, opts *bind.CallOpts) (map[common.Address]bool, error)

Returns a mapping of members and whether they have submitted balances this interval or not

func GetTrustedNodeLatestPricesParticipation

func GetTrustedNodeLatestPricesParticipation(rp *rocketpool.RocketPool, intervalSize *big.Int, opts *bind.CallOpts) (map[common.Address]bool, error)

Returns a mapping of members and whether they have submitted prices this interval or not

func InitializeFeeDistributor

func InitializeFeeDistributor(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (common.Hash, error)

Create the fee distributor contract for a node

func RegisterNode

func RegisterNode(rp *rocketpool.RocketPool, timezoneLocation string, opts *bind.TransactOpts) (common.Hash, error)

Register a node

func SetSmoothingPoolRegistrationState

func SetSmoothingPoolRegistrationState(rp *rocketpool.RocketPool, optIn bool, opts *bind.TransactOpts) (common.Hash, error)

Opt into / out of the smoothing pool

func SetStakeRPLForAllowed

func SetStakeRPLForAllowed(rp *rocketpool.RocketPool, caller common.Address, allowed bool, opts *bind.TransactOpts) (common.Hash, error)

Set stake RPL for allowed

func SetTimezoneLocation

func SetTimezoneLocation(rp *rocketpool.RocketPool, timezoneLocation string, opts *bind.TransactOpts) (common.Hash, error)

Set a node's timezone location

func StakeRPL

func StakeRPL(rp *rocketpool.RocketPool, rplAmount *big.Int, opts *bind.TransactOpts) (common.Hash, error)

Stake RPL

func WithdrawRPL

func WithdrawRPL(rp *rocketpool.RocketPool, rplAmount *big.Int, opts *bind.TransactOpts) (common.Hash, error)

Withdraw staked RPL

Types

type Distributor

type Distributor struct {
	Address    common.Address
	Contract   *rocketpool.Contract
	RocketPool *rocketpool.RocketPool
}

Distributor contract

func NewDistributor

func NewDistributor(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (*Distributor, error)

Create new distributor contract

func (*Distributor) Distribute

func (d *Distributor) Distribute(opts *bind.TransactOpts) (common.Hash, error)

Distribute the contract's balance to the rETH contract and the user

func (*Distributor) EstimateDistributeGas

func (d *Distributor) EstimateDistributeGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of a distribute

func (*Distributor) GetNodeShare

func (d *Distributor) GetNodeShare(opts *bind.CallOpts) (*big.Int, error)

Gets the node share of the distributor's current balance

func (*Distributor) GetUserShare

func (d *Distributor) GetUserShare(opts *bind.CallOpts) (*big.Int, error)

Gets the user share of the distributor's current balance

type NodeDetails

type NodeDetails struct {
	Address                  common.Address `json:"address"`
	Exists                   bool           `json:"exists"`
	WithdrawalAddress        common.Address `json:"withdrawalAddress"`
	PendingWithdrawalAddress common.Address `json:"pendingWithdrawalAddress"`
	TimezoneLocation         string         `json:"timezoneLocation"`
}

Node details

func GetNodeDetails

func GetNodeDetails(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (NodeDetails, error)

Get a node's details

func GetNodes

func GetNodes(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]NodeDetails, error)

Get all node details

type TimezoneCount

type TimezoneCount struct {
	Timezone string   `abi:"timezone"`
	Count    *big.Int `abi:"count"`
}

Count of nodes belonging to a timezone

func GetNodeCountPerTimezone

func GetNodeCountPerTimezone(rp *rocketpool.RocketPool, offset, limit *big.Int, opts *bind.CallOpts) ([]TimezoneCount, error)

Get a breakdown of the number of nodes per timezone

type TrustedNodeParticipation

type TrustedNodeParticipation struct {
	StartBlock          uint64
	UpdateFrequency     uint64
	UpdateCount         uint64
	Probability         float64
	ExpectedSubmissions float64
	ActualSubmissions   map[common.Address]float64
	Participation       map[common.Address][]bool
}

The results of the trusted node participation calculation

func CalculateTrustedNodeBalancesParticipation

func CalculateTrustedNodeBalancesParticipation(rp *rocketpool.RocketPool, intervalSize *big.Int, opts *bind.CallOpts) (*TrustedNodeParticipation, error)

Calculates the participation rate of every trusted node on balance submission since the last block that member count changed

func CalculateTrustedNodePricesParticipation

func CalculateTrustedNodePricesParticipation(rp *rocketpool.RocketPool, intervalSize *big.Int, opts *bind.CallOpts) (*TrustedNodeParticipation, error)

Calculates the participation rate of every trusted node on price submission since the last block that member count changed

Jump to

Keyboard shortcuts

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