config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "k2"

Variables

View Source
var (
	WalletPrivateKeyFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "eth1-private-key",
		Usage:    "The private key of the validator wallet",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
		EnvVars:  []string{"ETH1_PRIVATE_KEY"},
	}
	Web3SignerUrlFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "web3-signer-url",
		Usage:    "The url of the web3 signer",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	PayoutRecipientFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "payout-recipient",
		Usage:    "The address of the payout recipient, optional would then default to the registration fee recepient address",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	BeaconNodeUrlFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "beacon-node-url",
		Usage:    "The url of the beacon node",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	ExecutionNodeUrlFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "execution-node-url",
		Usage:    "The url of the execution node",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	ExclusionListFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "exclusion-list",
		Usage:    "The list of addresses to exclude from either the Proposer Registration or Native Delegation",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	MaxGasPriceFlag = &cli.Uint64Flag{
		Name:     ModuleName + "." + "max-gas-price",
		Usage:    "The maximum gas price to use for transactions, in Gwei",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
		Value:    10,
	}
	RegistrationOnlyFlag = &cli.BoolFlag{
		Name:     ModuleName + "." + "registration-only",
		Usage:    "Only register the validators in the proposer registry, do not natively delegate",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	ListenAddressFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "listen-address",
		Usage:    "The address to listen on for incoming requests",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	ClaimThresholdFlag = &cli.Float64Flag{
		Name:     ModuleName + "." + "claim-threshold",
		Usage:    "The threshold for claiming rewards, in KETH",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	K2LendingContractAddressFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "k2-lending-contract-address",
		Usage:    "The address of the K2 lending contract to override the internal configuration",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	K2NodeOperatorContractAddressFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "k2-node-operator-contract-address",
		Usage:    "The address of the K2 node operator contract to override the internal configuration",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	ProposerRegistryContractAddressFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "proposer-registry-contract-address",
		Usage:    "The address of the proposer registry contract to override the internal configuration",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	SignatureSwapperUrlFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "signature-swapper-url",
		Usage:    "The url of the signature swapper to override the internal configuration",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
	BalanceVerificationUrlFlag = &cli.StringFlag{
		Name:     ModuleName + "." + "balance-verification-url",
		Usage:    "The url of the balance verification service to override the internal configuration",
		Category: strings.ReplaceAll(strings.ToUpper(ModuleName), "_", " "),
	}
)
View Source
var K2ConfigConstants = map[uint64]K2Config{
	1: {
		K2LendingContractAddress:        common.HexToAddress("0x7D1e9f343a57bD58436b50Ad9935c128a6cF97DB"),
		K2NodeOperatorContractAddress:   common.HexToAddress("0x8eeC404Ef2d4756C972658629400a39359099EF6"),
		ProposerRegistryContractAddress: common.HexToAddress("0xF7F6D8F8b76E94379034d333f4B5FE1694A32D87"),
		SignatureSwapperUrl: &url.URL{
			Scheme: "https",
			Host:   "signature-swapper.ponrelay.com",
		},
		BalanceVerificationUrl: &url.URL{
			Scheme: "https",
			Host:   "verify-effective-balance.restaking.cloud",
		},
	},
	5: {
		K2LendingContractAddress:        common.HexToAddress("0xEEc98aBa34AB03EC1533D37F5256651b43E32d05"),
		K2NodeOperatorContractAddress:   common.HexToAddress("0x10b37A1A3e3114fe479B2cf962dB8806c941d2Dc"),
		ProposerRegistryContractAddress: common.HexToAddress("0x1643ec804d944Da97d90c013cBaCD1358Cce1bAF"),
		SignatureSwapperUrl: &url.URL{
			Scheme: "https",
			Host:   "goerli-signature-swapper.ponrelay.com",
		},
		BalanceVerificationUrl: &url.URL{
			Scheme: "https",
			Host:   "verify-effective-balance-goerli.restaking.cloud",
		},
	},
	17000: {
		K2LendingContractAddress:        common.HexToAddress("0x44cc5A6f4958A04C42C4ceA497ab7A5e5d809f31"),
		K2NodeOperatorContractAddress:   common.HexToAddress("0xc905e03Af4a5A1711b39228C121d2aF2BbAaBdEe"),
		ProposerRegistryContractAddress: common.HexToAddress("0x33a12a1cdc00EE02976fE41509A4A053b9DC5555"),
		SignatureSwapperUrl: &url.URL{
			Scheme: "https",
			Host:   "holesky-signature-swapper.ponrelay.com",
		},
		BalanceVerificationUrl: &url.URL{
			Scheme: "https",
			Host:   "verify-effective-balance-holesky.restaking.cloud",
		},
	},
}

A mapping of chain IDs to their respective K2 known configurations

View Source
var K2ConfigDefaults = K2Config{
	ValidatorWalletPrivateKey:       nil,
	ValidatorWalletAddress:          common.Address{},
	Web3SignerUrl:                   nil,
	SignatureSwapperUrl:             nil,
	BeaconNodeUrl:                   nil,
	ExecutionNodeUrl:                nil,
	K2LendingContractAddress:        common.Address{},
	K2NodeOperatorContractAddress:   common.Address{},
	ProposerRegistryContractAddress: common.Address{},
	BalanceVerificationUrl:          nil,
	PayoutRecipient:                 common.Address{},
	ExclusionListFile:               "",
	MaxGasPrice:                     0,
	RegistrationOnly:                false,
	ListenAddress:                   &url.URL{Scheme: "http", Host: "localhost:10000"},
	ClaimThreshold:                  0.0,
}

Functions

func NewCommand

func NewCommand() *cli.Command

Types

type K2Config

type K2Config struct {
	ValidatorWalletPrivateKey       *ecdsa.PrivateKey
	ValidatorWalletAddress          common.Address
	Web3SignerUrl                   *url.URL
	SignatureSwapperUrl             *url.URL
	BeaconNodeUrl                   *url.URL
	ExecutionNodeUrl                *url.URL
	K2LendingContractAddress        common.Address
	K2NodeOperatorContractAddress   common.Address
	ProposerRegistryContractAddress common.Address
	BalanceVerificationUrl          *url.URL       // for effective balance reporting for verifiable signatures to claim rewards
	PayoutRecipient                 common.Address // to override the payout recipient for all validators
	ExclusionListFile               string         // to exclude validators from registration or native delegation
	MaxGasPrice                     uint64
	RegistrationOnly                bool
	ListenAddress                   *url.URL
	ClaimThreshold                  float64 // To only claim rewards if the validator has earned more than this threshold (in KETH)
}

Jump to

Keyboard shortcuts

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