node

package
v2.0.0-b2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	// The address of this node
	Address common.Address

	// True if the node exists (i.e. there is a registered node at this address)
	Exists *core.SimpleField[bool]

	// The time that the node was registered with the network
	RegistrationTime *core.FormattedUint256Field[time.Time]

	// The node's timezone location
	TimezoneLocation *core.SimpleField[string]

	// The network ID for the node's rewards
	RewardNetwork *core.FormattedUint256Field[uint64]

	// The node's average minipool fee (commission)
	AverageFee *core.FormattedUint256Field[float64]

	// The node's smoothing pool opt-in status
	SmoothingPoolRegistrationState *core.SimpleField[bool]

	// The time of the node's last smoothing pool opt-in / opt-out
	SmoothingPoolRegistrationChanged *core.FormattedUint256Field[time.Time]

	// True if the node's fee distributor has been initialized yet
	IsFeeDistributorInitialized *core.SimpleField[bool]

	// The node's fee distributor address
	DistributorAddress *core.SimpleField[common.Address]

	// The amount of ETH in the node's deposit credit bank
	Credit *core.SimpleField[*big.Int]

	// The amount of ETH in the node's deposit credit bank that is currently usable for new deposits
	UsableCredit *core.SimpleField[*big.Int]

	// The current donated ETH balance for the node
	DonatedEthBalance *core.SimpleField[*big.Int]

	// The sum of the node's credit and donated balances
	TotalCreditAndDonatedBalance *core.SimpleField[*big.Int]

	// How much of the combined credit and donated balances can be used for new deposits
	UsableCreditAndDonatedBalance *core.SimpleField[*big.Int]

	// The node's RPL stake
	RplStake *core.SimpleField[*big.Int]

	// The node's effective RPL stake
	EffectiveRplStake *core.SimpleField[*big.Int]

	// The node's minimum RPL stake to collateralize its minipools
	MinimumRplStake *core.SimpleField[*big.Int]

	// The node's maximum RPL stake to collateralize its minipools
	MaximumRplStake *core.SimpleField[*big.Int]

	// The time the node last staked RPL
	RplStakedTime *core.FormattedUint256Field[time.Time]

	// The amount of ETH the node has borrowed from the deposit pool to create its minipools
	EthMatched *core.SimpleField[*big.Int]

	// The amount of ETH the node can still borrow from the deposit pool to create any new minipools
	EthMatchedLimit *core.SimpleField[*big.Int]

	// The number of minipools owned by the node count
	MinipoolCount *core.FormattedUint256Field[uint64]

	// The number of minipools owned by the node that are not finalised
	ActiveMinipoolCount *core.FormattedUint256Field[uint64]

	// The number of minipools owned by a node that are finalised
	FinalisedMinipoolCount *core.FormattedUint256Field[uint64]

	// The number of minipools owned by a node that are validating
	ValidatingMinipoolCount *core.FormattedUint256Field[uint64]

	// The node's primary withdrawal address
	PrimaryWithdrawalAddress *core.SimpleField[common.Address]

	// The node's pending primary withdrawal address
	PendingPrimaryWithdrawalAddress *core.SimpleField[common.Address]

	// The node's RPL withdrawal address
	IsRplWithdrawalAddressSet *core.SimpleField[bool]

	// The node's RPL withdrawal address
	RplWithdrawalAddress *core.SimpleField[common.Address]

	// The node's pending RPL withdrawal address
	PendingRplWithdrawalAddress *core.SimpleField[common.Address]

	// The amount of RPL locked as part of active PDAO proposals or challenges
	RplLocked *core.SimpleField[*big.Int]

	// True if RPL the node can have its RPL locked via protocol DAO proposals / challenges
	IsRplLockingAllowed *core.SimpleField[bool]

	// The address that the provided node has currently delegated voting power to
	CurrentVotingDelegate *core.SimpleField[common.Address]

	// Whether or not on-chain voting has been initialized for the node
	IsVotingInitialized *core.SimpleField[bool]
	// contains filtered or unexported fields
}

Binding for a Rocket Pool Node

func NewNode

func NewNode(rp *rocketpool.RocketPool, address common.Address) (*Node, error)

Creates a new Node instance

func (*Node) ConfirmPrimaryWithdrawalAddress

func (c *Node) ConfirmPrimaryWithdrawalAddress(opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for confirming the node's primary withdrawal address

func (*Node) ConfirmRplWithdrawalAddress

func (c *Node) ConfirmRplWithdrawalAddress(opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for confirming the RPL withdrawal address

func (*Node) CreateVacantMinipool

func (c *Node) CreateVacantMinipool(bondAmount *big.Int, minimumNodeFee float64, validatorPubkey beacon.ValidatorPubkey, salt *big.Int, expectedMinipoolAddress common.Address, currentBalance *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for making a vacant minipool for solo staker migration

func (*Node) Deposit

func (c *Node) Deposit(bondAmount *big.Int, minimumNodeFee float64, validatorPubkey beacon.ValidatorPubkey, validatorSignature beacon.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for making a node deposit and creating a new minipool

func (*Node) DepositWithCredit

func (c *Node) DepositWithCredit(bondAmount *big.Int, minimumNodeFee float64, validatorPubkey beacon.ValidatorPubkey, validatorSignature beacon.ValidatorSignature, depositDataRoot common.Hash, salt *big.Int, expectedMinipoolAddress common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for making a node deposit and creating a new minipool by using the credit balance

func (*Node) GetExpectedMinipoolAddress

func (c *Node) GetExpectedMinipoolAddress(mc *batch.MultiCaller, address_Out *common.Address, salt *big.Int)

Get the address of a minipool based on the node's address and a salt

func (*Node) GetMinipoolAddress

func (c *Node) GetMinipoolAddress(mc *batch.MultiCaller, address_Out *common.Address, index uint64)

Get one of the node's minipool addresses by index

func (*Node) GetMinipoolAddresses

func (c *Node) GetMinipoolAddresses(minipoolCount uint64, opts *bind.CallOpts) ([]common.Address, error)

Get all of the node's minipool addresses in a standalone call. This will use an internal batched multicall invocation to retrieve all of them. Provide the value returned from GetMinipoolCount() in minipoolCount.

func (*Node) GetNodeDistributor

func (c *Node) GetNodeDistributor(distributorAddress common.Address, includeDetails bool, opts *bind.CallOpts) (*NodeDistributor, error)

Get a node's distributor with details

func (*Node) GetValidatingMinipoolAddress

func (c *Node) GetValidatingMinipoolAddress(mc *batch.MultiCaller, address_Out *common.Address, index uint64)

Get one of the node's validating minipool addresses by index

func (*Node) GetValidatingMinipoolAddresses

func (c *Node) GetValidatingMinipoolAddresses(minipoolCount uint64, opts *bind.CallOpts) ([]common.Address, error)

Get all of the node's validating minipool addresses in a standalone call. This will use an internal batched multicall invocation to retrieve all of them. Provide the value returned from GetValidatingMinipoolCount() in minipoolCount.

func (*Node) GetVotingDelegateAtBlock

func (c *Node) GetVotingDelegateAtBlock(mc *batch.MultiCaller, delegate_Out *common.Address, blockNumber uint32)

Get the address that the node has delegated voting power to at the given block

func (*Node) GetVotingPowerAtBlock

func (c *Node) GetVotingPowerAtBlock(mc *batch.MultiCaller, power_Out **big.Int, blockNumber uint32)

Get the voting power of the given node at the provided block

func (*Node) InitializeFeeDistributor

func (c *Node) InitializeFeeDistributor(opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for initializing (creating) the node's fee distributor

func (*Node) InitializeVoting

func (c *Node) InitializeVoting(opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for initializing on-chain voting for the node

func (*Node) InitializeVotingWithDelegate

func (c *Node) InitializeVotingWithDelegate(delegate common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for initializing on-chain voting for the node, specifying an optional delegate along with it

func (*Node) Register

func (c *Node) Register(timezoneLocation string, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for registering a node

func (*Node) SetPrimaryWithdrawalAddress

func (c *Node) SetPrimaryWithdrawalAddress(withdrawalAddress common.Address, confirm bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for setting the node's primary withdrawal address

func (*Node) SetRplLockingAllowed

func (c *Node) SetRplLockingAllowed(allowed bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for enabling or disabling RPL locking (for Protocol DAO votes or challenges)

func (*Node) SetRplWithdrawalAddress

func (c *Node) SetRplWithdrawalAddress(withdrawalAddress common.Address, confirm bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for setting the RPL withdrawal address

func (*Node) SetSmoothingPoolRegistrationState

func (c *Node) SetSmoothingPoolRegistrationState(optIn bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for opting in or out of the smoothing pool

func (*Node) SetStakeRplForAllowed

func (c *Node) SetStakeRplForAllowed(caller common.Address, allowed bool, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for adding or removing an address from the stake-RPL-on-behalf allowlist

func (*Node) SetTimezoneLocation

func (c *Node) SetTimezoneLocation(timezoneLocation string, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for setting a node's timezone location

func (*Node) SetVotingDelegate

func (c *Node) SetVotingDelegate(newDelegate common.Address, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for setting the voting delegate for the node

func (*Node) StakeRpl

func (c *Node) StakeRpl(rplAmount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for staking RPL

func (*Node) WithdrawDonatedEth

func (c *Node) WithdrawDonatedEth(amount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Withdraw unused ETH that was donated (staked on behalf of the node)

func (*Node) WithdrawRpl

func (c *Node) WithdrawRpl(rplAmount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for withdrawing staked RPL

type NodeDistributor

type NodeDistributor struct {
	// The address of the distributor
	DistributorAddress common.Address

	// The address of the node that owns this distributor
	NodeAddress common.Address

	// The node share of the distributor's current balance
	NodeShare *core.SimpleField[*big.Int]

	// The user share of the distributor's current balance
	UserShare *core.SimpleField[*big.Int]
	// contains filtered or unexported fields
}

Binding for RocketNodeDistributorDelegate

func NewNodeDistributor

func NewNodeDistributor(rp *rocketpool.RocketPool, nodeAddress common.Address, distributorAddress common.Address) (*NodeDistributor, error)

Creates a new NodeDistributor contract binding

func (*NodeDistributor) Distribute

func (c *NodeDistributor) Distribute(opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for distributing the contract's balance to the rETH contract and the user

type NodeManager

type NodeManager struct {
	// The number of nodes in the network
	NodeCount *core.FormattedUint256Field[uint64]

	// The total RPL staked in the network
	TotalRplStake *core.SimpleField[*big.Int]
	// contains filtered or unexported fields
}

Binding for RocketNodeManager

func NewNodeManager

func NewNodeManager(rp *rocketpool.RocketPool) (*NodeManager, error)

Creates a new NodeManager contract binding

func (*NodeManager) GetNodeAddress

func (c *NodeManager) GetNodeAddress(mc *batch.MultiCaller, address_Out *common.Address, index uint64)

Get a node address by index

func (*NodeManager) GetNodeAddresses

func (c *NodeManager) GetNodeAddresses(nodeCount uint64, opts *bind.CallOpts) ([]common.Address, error)

Get all minipool addresses in a standalone call. This will use an internal batched multicall invocation to retrieve all of them. Provide the value returned from GetNodeCount() in nodeCount.

func (*NodeManager) GetNodeCountPerTimezone

func (c *NodeManager) GetNodeCountPerTimezone(nodeCount uint64, opts *bind.CallOpts) (map[string]uint64, error)

Get a breakdown of the number of nodes per timezone for the subset of nodes provided. Provide the value returned from GetNodeCount() in nodeCount.

func (*NodeManager) GetSmoothingPoolRegisteredNodeCount

func (c *NodeManager) GetSmoothingPoolRegisteredNodeCount(nodeCount uint64, opts *bind.CallOpts) (uint64, error)

Get the number of nodes in the Smoothing Pool for the subset of nodes provided. Provide the value returned from GetNodeCount() in nodeCount.

func (*NodeManager) GetTotalEffectiveRplStake

func (c *NodeManager) GetTotalEffectiveRplStake(nodeCount uint64, opts *bind.CallOpts) (*big.Int, error)

Get the total effective RPL stake of the network

type TimezoneCount

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

Count of nodes belonging to a timezone

Jump to

Keyboard shortcuts

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