2020-04-29 21:32:39 +00:00
// Package flags contains all configuration runtime flags for
// the validator service.
2019-07-23 13:58:20 +00:00
package flags
2015-07-28 22:16:16 +00:00
import (
2022-08-19 16:36:49 +00:00
"fmt"
2020-07-01 21:30:01 +00:00
"path/filepath"
"runtime"
2020-07-22 03:45:52 +00:00
"time"
2020-07-01 21:30:01 +00:00
2024-02-15 05:46:47 +00:00
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/io/file"
2020-05-31 06:44:34 +00:00
"github.com/urfave/cli/v2"
2018-01-13 22:31:28 +00:00
)
2020-07-29 01:20:13 +00:00
const (
2020-10-15 22:31:52 +00:00
// WalletDefaultDirName for accounts.
2020-07-29 01:20:13 +00:00
WalletDefaultDirName = "prysm-wallet-v2"
2020-10-29 21:38:47 +00:00
// DefaultGatewayHost for the validator client.
DefaultGatewayHost = "127.0.0.1"
2020-07-29 01:20:13 +00:00
)
2015-07-28 22:16:16 +00:00
var (
2020-11-09 08:26:52 +00:00
// DisableAccountMetricsFlag disables the prometheus metrics for validator accounts, default false.
2020-05-19 13:44:54 +00:00
DisableAccountMetricsFlag = & cli . BoolFlag {
2020-05-20 15:23:22 +00:00
Name : "disable-account-metrics" ,
2024-01-02 18:02:28 +00:00
Usage : ` Disables prometheus metrics for validator accounts . Operators with high volumes
of validating keys may wish to disable granular prometheus metrics as it increases
the data cardinality . ` ,
2020-04-19 08:36:19 +00:00
}
2018-08-01 22:08:44 +00:00
// BeaconRPCProviderFlag defines a beacon node RPC endpoint.
2020-03-19 21:46:44 +00:00
BeaconRPCProviderFlag = & cli . StringFlag {
2018-08-01 22:08:44 +00:00
Name : "beacon-rpc-provider" ,
2024-01-02 18:02:28 +00:00
Usage : "Beacon node RPC provider endpoint." ,
2020-06-15 16:52:15 +00:00
Value : "127.0.0.1:4000" ,
2018-08-01 22:08:44 +00:00
}
2020-09-04 19:03:18 +00:00
// BeaconRPCGatewayProviderFlag defines a beacon node JSON-RPC endpoint.
BeaconRPCGatewayProviderFlag = & cli . StringFlag {
Name : "beacon-rpc-gateway-provider" ,
2024-01-02 18:02:28 +00:00
Usage : "Beacon node RPC gateway provider endpoint." ,
2020-09-04 19:03:18 +00:00
Value : "127.0.0.1:3500" ,
}
2022-11-11 17:33:48 +00:00
// BeaconRESTApiProviderFlag defines a beacon node REST API endpoint.
BeaconRESTApiProviderFlag = & cli . StringFlag {
Name : "beacon-rest-api-provider" ,
2024-01-02 18:02:28 +00:00
Usage : "Beacon node REST API provider endpoint." ,
2022-11-11 17:33:48 +00:00
Value : "http://127.0.0.1:3500" ,
}
2018-08-08 22:43:25 +00:00
// CertFlag defines a flag for the node's TLS certificate.
2020-03-19 21:46:44 +00:00
CertFlag = & cli . StringFlag {
2018-08-08 22:43:25 +00:00
Name : "tls-cert" ,
Usage : "Certificate for secure gRPC. Pass this and the tls-key flag in order to use gRPC securely." ,
}
2020-09-30 20:55:56 +00:00
// EnableRPCFlag enables controlling the validator client via gRPC (without web UI).
EnableRPCFlag = & cli . BoolFlag {
Name : "rpc" ,
2024-01-02 18:02:28 +00:00
Usage : "Enables the RPC server for the validator client (without Web UI)." ,
2020-09-30 20:55:56 +00:00
Value : false ,
}
2020-08-14 02:49:57 +00:00
// RPCHost defines the host on which the RPC server should listen.
RPCHost = & cli . StringFlag {
Name : "rpc-host" ,
2024-01-02 18:02:28 +00:00
Usage : "Host on which the RPC server should listen." ,
2020-08-14 02:49:57 +00:00
Value : "127.0.0.1" ,
}
// RPCPort defines a validator client RPC port to open.
RPCPort = & cli . IntFlag {
Name : "rpc-port" ,
2024-01-02 18:02:28 +00:00
Usage : "RPC port exposed by a validator client." ,
2020-08-14 02:49:57 +00:00
Value : 7000 ,
}
2020-05-20 15:23:22 +00:00
// SlasherRPCProviderFlag defines a slasher node RPC endpoint.
SlasherRPCProviderFlag = & cli . StringFlag {
Name : "slasher-rpc-provider" ,
2024-01-02 18:02:28 +00:00
Usage : "Slasher node RPC provider endpoint." ,
2020-06-15 16:52:15 +00:00
Value : "127.0.0.1:4002" ,
2020-05-20 15:23:22 +00:00
}
// SlasherCertFlag defines a flag for the slasher node's TLS certificate.
SlasherCertFlag = & cli . StringFlag {
Name : "slasher-tls-cert" ,
Usage : "Certificate for secure slasher gRPC. Pass this and the tls-key flag in order to use gRPC securely." ,
}
2019-04-27 03:56:11 +00:00
// DisablePenaltyRewardLogFlag defines the ability to not log reward/penalty information during deployment
2020-03-19 21:46:44 +00:00
DisablePenaltyRewardLogFlag = & cli . BoolFlag {
2019-04-27 03:56:11 +00:00
Name : "disable-rewards-penalties-logging" ,
2024-01-02 18:02:28 +00:00
Usage : "Disables reward/penalty logging during cluster deployment." ,
2019-04-27 03:56:11 +00:00
}
2019-12-07 19:13:56 +00:00
// GraffitiFlag defines the graffiti value included in proposed blocks
2020-03-19 21:46:44 +00:00
GraffitiFlag = & cli . StringFlag {
2019-12-09 14:31:53 +00:00
Name : "graffiti" ,
2024-01-02 18:02:28 +00:00
Usage : "String to include in proposed blocks." ,
2019-12-07 19:13:56 +00:00
}
2020-02-24 18:00:22 +00:00
// GrpcRetriesFlag defines the number of times to retry a failed gRPC request.
2020-03-19 21:46:44 +00:00
GrpcRetriesFlag = & cli . UintFlag {
2020-02-24 18:00:22 +00:00
Name : "grpc-retries" ,
2024-01-02 18:02:28 +00:00
Usage : "Number of attempts to retry gRPC requests." ,
2020-02-24 18:00:22 +00:00
Value : 5 ,
}
2020-07-22 03:45:52 +00:00
// GrpcRetryDelayFlag defines the interval to retry a failed gRPC request.
GrpcRetryDelayFlag = & cli . DurationFlag {
Name : "grpc-retry-delay" ,
2024-01-02 18:02:28 +00:00
Usage : "Amount of time between gRPC retry requests." ,
2020-07-22 03:45:52 +00:00
Value : 1 * time . Second ,
}
2020-03-25 16:29:04 +00:00
// GrpcHeadersFlag defines a list of headers to send with all gRPC requests.
GrpcHeadersFlag = & cli . StringFlag {
Name : "grpc-headers" ,
2024-01-02 18:02:28 +00:00
Usage : ` Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls .
Example : -- grpc - headers = key = value ` ,
2020-03-25 16:29:04 +00:00
}
2020-08-14 02:49:57 +00:00
// GRPCGatewayHost specifies a gRPC gateway host for the validator client.
GRPCGatewayHost = & cli . StringFlag {
Name : "grpc-gateway-host" ,
2024-01-02 18:02:28 +00:00
Usage : "Host on which the gateway server runs on." ,
2020-10-29 21:38:47 +00:00
Value : DefaultGatewayHost ,
2020-08-14 02:49:57 +00:00
}
// GRPCGatewayPort enables a gRPC gateway to be exposed for the validator client.
GRPCGatewayPort = & cli . IntFlag {
Name : "grpc-gateway-port" ,
2024-01-02 18:02:28 +00:00
Usage : "Enables gRPC gateway for JSON requests." ,
2020-08-14 02:49:57 +00:00
Value : 7500 ,
}
2020-09-04 19:03:18 +00:00
// GPRCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway.
GPRCGatewayCorsDomain = & cli . StringFlag {
Name : "grpc-gateway-corsdomain" ,
2024-01-02 18:02:28 +00:00
Usage : ` Comma separated list of domains from which to accept cross origin requests ( browser enforced ) .
This flag has no effect if not used with -- grpc - gateway - port .
` ,
2022-02-09 17:18:49 +00:00
Value : "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000" }
2020-04-19 08:36:19 +00:00
// MonitoringPortFlag defines the http port used to serve prometheus metrics.
2020-07-08 08:21:06 +00:00
MonitoringPortFlag = & cli . IntFlag {
2020-04-19 08:36:19 +00:00
Name : "monitoring-port" ,
2024-01-02 18:02:28 +00:00
Usage : "Port used to listening and respond metrics for Prometheus." ,
2020-04-19 08:36:19 +00:00
Value : 8081 ,
}
2020-10-15 22:31:52 +00:00
// WalletDirFlag defines the path to a wallet directory for Prysm accounts.
2020-07-01 21:30:01 +00:00
WalletDirFlag = & cli . StringFlag {
Name : "wallet-dir" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a wallet directory on-disk for Prysm validator accounts." ,
2020-07-29 01:20:13 +00:00
Value : filepath . Join ( DefaultValidatorDir ( ) , WalletDefaultDirName ) ,
2020-07-01 21:30:01 +00:00
}
2020-08-20 19:14:03 +00:00
// AccountPasswordFileFlag is path to a file containing a password for a validator account.
2020-07-29 01:20:13 +00:00
AccountPasswordFileFlag = & cli . StringFlag {
Name : "account-password-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a plain-text, .txt file containing a password for a validator account." ,
2020-07-01 21:30:01 +00:00
}
2020-07-29 01:20:13 +00:00
// WalletPasswordFileFlag is the path to a file containing your wallet password.
WalletPasswordFileFlag = & cli . StringFlag {
Name : "wallet-password-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a plain-text, .txt file containing your wallet password." ,
2020-07-14 23:00:58 +00:00
}
2020-10-27 20:51:29 +00:00
// Mnemonic25thWordFileFlag defines a path to a file containing a "25th" word mnemonic passphrase for advanced users.
Mnemonic25thWordFileFlag = & cli . StringFlag {
Name : "mnemonic-25th-word-file" ,
2024-01-02 18:02:28 +00:00
Usage : "(Advanced) Path to a plain-text, `.txt` file containing a 25th word passphrase for your mnemonic for HD wallets." ,
2020-10-27 20:51:29 +00:00
}
// SkipMnemonic25thWordCheckFlag allows for skipping a check for mnemonic 25th word passphrases for HD wallets.
SkipMnemonic25thWordCheckFlag = & cli . StringFlag {
Name : "skip-mnemonic-25th-word-check" ,
2024-01-02 18:02:28 +00:00
Usage : "Allows for skipping the check for a mnemonic 25th word passphrase for HD wallets." ,
2020-10-27 20:51:29 +00:00
}
2020-08-11 16:32:05 +00:00
// ImportPrivateKeyFileFlag allows for directly importing a private key hex string as an account.
ImportPrivateKeyFileFlag = & cli . StringFlag {
Name : "import-private-key-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a plain-text, .txt file containing a hex string representation of a private key to import." ,
2020-08-11 16:32:05 +00:00
}
2020-07-22 02:41:39 +00:00
// MnemonicFileFlag is used to enter a file to mnemonic phrase for new wallet creation, non-interactively.
MnemonicFileFlag = & cli . StringFlag {
Name : "mnemonic-file" ,
Usage : "File to retrieve mnemonic for non-interactively passing a mnemonic phrase into wallet recover." ,
}
2022-10-26 21:04:00 +00:00
// MnemonicLanguageFlag is used to specify the language of the mnemonic.
MnemonicLanguageFlag = & cli . StringFlag {
Name : "mnemonic-language" ,
2024-01-02 18:02:28 +00:00
Usage : "Allows specifying mnemonic language. Supported languages are: english|chinese_traditional|chinese_simplified|czech|french|japanese|korean|italian|spanish." ,
2022-10-26 21:04:00 +00:00
}
2024-02-15 19:49:50 +00:00
2020-10-15 22:31:52 +00:00
// ShowPrivateKeysFlag for accounts.
2020-10-15 16:08:52 +00:00
ShowPrivateKeysFlag = & cli . BoolFlag {
Name : "show-private-keys" ,
2024-01-02 18:02:28 +00:00
Usage : "Displays the private keys for validator accounts." ,
2020-07-08 19:21:54 +00:00
Value : false ,
}
2021-02-26 15:00:05 +00:00
// ListValidatorIndices for accounts.
ListValidatorIndices = & cli . BoolFlag {
Name : "list-validator-indices" ,
2024-01-02 18:02:28 +00:00
Usage : "Lists validator indices." ,
2021-02-26 15:00:05 +00:00
Value : false ,
}
2020-07-27 14:03:30 +00:00
// NumAccountsFlag defines the amount of accounts to generate for derived wallets.
2020-10-11 15:26:59 +00:00
NumAccountsFlag = & cli . IntFlag {
2020-07-27 14:03:30 +00:00
Name : "num-accounts" ,
2024-01-02 18:02:28 +00:00
Usage : "Number of accounts to generate for derived wallets." ,
2020-07-27 14:03:30 +00:00
Value : 1 ,
}
2020-08-11 23:15:06 +00:00
// DeletePublicKeysFlag defines a comma-separated list of hex string public keys
// for accounts which a user desires to delete from their wallet.
DeletePublicKeysFlag = & cli . StringFlag {
Name : "delete-public-keys" ,
2024-01-02 18:02:28 +00:00
Usage : "Comma separated list of public key hex strings to specify which validator accounts to delete." ,
2020-08-11 23:15:06 +00:00
Value : "" ,
}
// BackupPublicKeysFlag defines a comma-separated list of hex string public keys
// for accounts which a user desires to backup from their wallet.
BackupPublicKeysFlag = & cli . StringFlag {
Name : "backup-public-keys" ,
2024-01-02 18:02:28 +00:00
Usage : "Comma separated list of public key hex strings to specify which validator accounts to backup." ,
2020-08-11 23:15:06 +00:00
Value : "" ,
}
2020-08-20 17:53:09 +00:00
// VoluntaryExitPublicKeysFlag defines a comma-separated list of hex string public keys
// for accounts on which a user wants to perform a voluntary exit.
VoluntaryExitPublicKeysFlag = & cli . StringFlag {
2020-09-09 18:29:17 +00:00
Name : "public-keys" ,
2024-01-02 18:02:28 +00:00
Usage : "Comma separated list of public key hex strings to specify on which validator accounts to perform " +
"a voluntary exit." ,
2020-08-20 17:53:09 +00:00
Value : "" ,
}
2021-02-11 16:50:16 +00:00
// ExitAllFlag allows stakers to select all validating keys for exit. This will still require the staker
2021-09-17 21:55:24 +00:00
// to confirm a userprompt for this action given it is a dangerous one.
2021-02-11 16:50:16 +00:00
ExitAllFlag = & cli . BoolFlag {
Name : "exit-all" ,
2024-01-02 18:02:28 +00:00
Usage : "Exits all validators. This will still require the staker to confirm a userprompt for the action." ,
2021-02-11 16:50:16 +00:00
}
2022-10-27 15:24:41 +00:00
// ForceExitFlag to exit without displaying the confirmation prompt.
ForceExitFlag = & cli . BoolFlag {
Name : "force-exit" ,
2024-01-02 18:02:28 +00:00
Usage : "Exits without displaying the confirmation prompt." ,
2022-10-27 15:24:41 +00:00
}
2023-04-17 18:01:13 +00:00
VoluntaryExitJSONOutputPath = & cli . StringFlag {
Name : "exit-json-output-dir" ,
2024-01-02 18:02:28 +00:00
Usage : "Output directory to write voluntary exits as individual unencrypted JSON " +
2023-04-17 18:01:13 +00:00
"files. If this flag is provided, voluntary exits will be written to the provided " +
"directory and will not be broadcasted." ,
}
2020-08-11 23:15:06 +00:00
// BackupPasswordFile for encrypting accounts a user wishes to back up.
BackupPasswordFile = & cli . StringFlag {
Name : "backup-password-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a plain-text, .txt file containing the desired password for your backed up accounts." ,
2020-08-11 23:15:06 +00:00
Value : "" ,
}
2020-07-23 03:10:23 +00:00
// BackupDirFlag defines the path for the zip backup of the wallet will be created.
BackupDirFlag = & cli . StringFlag {
Name : "backup-dir" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a directory where accounts will be backed up into a zip file." ,
2020-07-13 21:37:18 +00:00
Value : DefaultValidatorDir ( ) ,
}
2021-01-22 23:12:22 +00:00
// SlashingProtectionJSONFileFlag is used to enter the file path of the slashing protection JSON.
SlashingProtectionJSONFileFlag = & cli . StringFlag {
Name : "slashing-protection-json-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to an EIP-3076 compliant JSON file containing a user's slashing protection history." ,
2021-01-22 23:12:22 +00:00
}
2020-07-28 14:18:22 +00:00
// KeysDirFlag defines the path for a directory where keystores to be imported at stored.
KeysDirFlag = & cli . StringFlag {
Name : "keys-dir" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a directory where keystores to be imported are stored." ,
2020-07-28 14:18:22 +00:00
}
2023-03-09 03:21:12 +00:00
2020-07-16 05:08:16 +00:00
// RemoteSignerCertPathFlag defines the path to a client.crt file for a wallet to connect to
// a secure signer via TLS and gRPC.
RemoteSignerCertPathFlag = & cli . StringFlag {
Name : "remote-signer-crt-path" ,
2024-01-02 18:02:28 +00:00
Usage : "/path/to/client.crt for establishing a secure, TLS gRPC connection to a remote signer server." ,
2020-07-16 05:08:16 +00:00
Value : "" ,
}
// RemoteSignerKeyPathFlag defines the path to a client.key file for a wallet to connect to
// a secure signer via TLS and gRPC.
RemoteSignerKeyPathFlag = & cli . StringFlag {
Name : "remote-signer-key-path" ,
2024-01-02 18:02:28 +00:00
Usage : "/path/to/client.key for establishing a secure, TLS gRPC connection to a remote signer server." ,
2020-07-16 05:08:16 +00:00
Value : "" ,
}
// RemoteSignerCACertPathFlag defines the path to a ca.crt file for a wallet to connect to
// a secure signer via TLS and gRPC.
RemoteSignerCACertPathFlag = & cli . StringFlag {
Name : "remote-signer-ca-crt-path" ,
2024-01-02 18:02:28 +00:00
Usage : "/path/to/ca.crt for establishing a secure, TLS gRPC connection to a remote signer server." ,
2020-07-16 05:08:16 +00:00
Value : "" ,
}
2022-01-31 16:44:17 +00:00
// Web3SignerURLFlag defines the URL for a web3signer to connect to.
// example:--validators-external-signer-url=http://localhost:9000
// web3signer documentation can be found in Consensys' web3signer project docs
Web3SignerURLFlag = & cli . StringFlag {
Name : "validators-external-signer-url" ,
2024-01-02 18:02:28 +00:00
Usage : "URL for consensys' web3signer software to use with the Prysm validator client." ,
2022-01-31 16:44:17 +00:00
Value : "" ,
}
// Web3SignerPublicValidatorKeysFlag defines a comma-separated list of hex string public keys or external url for web3signer to use for validator signing.
// example with external url: --validators-external-signer-public-keys= https://web3signer.com/api/v1/eth2/publicKeys
// example with public key: --validators-external-signer-public-keys=0xa99a...e44c,0xb89b...4a0b
// web3signer documentation can be found in Consensys' web3signer project docs```
2022-07-14 16:34:59 +00:00
Web3SignerPublicValidatorKeysFlag = & cli . StringSliceFlag {
2022-01-31 16:44:17 +00:00
Name : "validators-external-signer-public-keys" ,
2024-01-02 18:02:28 +00:00
Usage : "Comma separated list of public keys OR an external url endpoint for the validator to retrieve public keys from for usage with web3signer." ,
2022-01-31 16:44:17 +00:00
}
2020-07-17 08:21:16 +00:00
// KeymanagerKindFlag defines the kind of keymanager desired by a user during wallet creation.
KeymanagerKindFlag = & cli . StringFlag {
Name : "keymanager-kind" ,
2024-01-02 18:02:28 +00:00
Usage : "Kind of keymanager, either imported, derived, or remote, specified during wallet creation." ,
2020-07-17 08:21:16 +00:00
Value : "" ,
}
2021-09-17 21:55:24 +00:00
// SkipDepositConfirmationFlag skips the y/n confirmation userprompt for sending a deposit to the deposit contract.
2020-08-24 19:19:21 +00:00
SkipDepositConfirmationFlag = & cli . BoolFlag {
Name : "skip-deposit-confirmation" ,
2024-01-02 18:02:28 +00:00
Usage : "Skips the y/n confirmation userprompt for sending a deposit to the deposit contract." ,
2020-08-24 19:19:21 +00:00
Value : false ,
}
2020-09-03 15:11:17 +00:00
// EnableWebFlag enables controlling the validator client via the Prysm web ui. This is a work in progress.
EnableWebFlag = & cli . BoolFlag {
Name : "web" ,
2024-01-02 18:02:28 +00:00
Usage : "(Work in progress): Enables the web portal for the validator client." ,
2020-09-03 15:11:17 +00:00
Value : false ,
}
2021-01-22 23:12:22 +00:00
// SlashingProtectionExportDirFlag allows specifying the outpt directory
// for a validator's slashing protection history.
SlashingProtectionExportDirFlag = & cli . StringFlag {
Name : "slashing-protection-export-dir" ,
2024-01-02 18:02:28 +00:00
Usage : "Allows users to specify the output directory to export their slashing protection EIP-3076 standard JSON File." ,
2021-01-22 23:12:22 +00:00
Value : "" ,
}
2020-12-04 23:15:12 +00:00
// GraffitiFileFlag specifies the file path to load graffiti values.
GraffitiFileFlag = & cli . StringFlag {
Name : "graffiti-file" ,
2024-01-02 18:02:28 +00:00
Usage : "Path to a YAML file with graffiti values." ,
2020-12-04 23:15:12 +00:00
}
2022-06-06 19:32:41 +00:00
// ProposerSettingsFlag defines the path or URL to a file with proposer config.
ProposerSettingsFlag = & cli . StringFlag {
2024-01-02 18:02:28 +00:00
Name : "proposer-settings-file" ,
Usage : ` Sets path to a YAML or JSON file containing validator settings used when proposing blocks such as
fee recipient and gas limit . File format found in docs . ` ,
2022-06-06 19:32:41 +00:00
Value : "" ,
}
// ProposerSettingsURLFlag defines the path or URL to a file with proposer config.
ProposerSettingsURLFlag = & cli . StringFlag {
2024-01-02 18:02:28 +00:00
Name : "proposer-settings-url" ,
Usage : ` Sets URL to a REST endpoint containing validator settings used when proposing blocks such as
fee recipient and gas limit . File format found in docs ` ,
2022-03-21 18:48:02 +00:00
Value : "" ,
}
// SuggestedFeeRecipientFlag defines the address of the fee recipient.
SuggestedFeeRecipientFlag = & cli . StringFlag {
2022-06-06 19:32:41 +00:00
Name : "suggested-fee-recipient" ,
2024-01-02 18:02:28 +00:00
Usage : ` Sets ALL validators ' mapping to a suggested eth address to receive gas fees when proposing a block .
Note that this is only a suggestion when integrating with a Builder API , which may choose to specify
a different fee recipient as payment for the blocks it builds . For additional setting overrides use the
-- ` + ProposerSettingsFlag . Name + " or --" + ProposerSettingsURLFlag . Name + " flags." ,
2022-06-06 19:32:41 +00:00
Value : params . BeaconConfig ( ) . EthBurnAddressHex ,
2022-03-21 18:48:02 +00:00
}
2022-07-06 18:42:21 +00:00
2022-07-19 13:38:33 +00:00
// EnableBuilderFlag enables the periodic validator registration API calls that will update the custom builder with validator settings.
EnableBuilderFlag = & cli . BoolFlag {
2024-01-02 18:02:28 +00:00
Name : "enable-builder" ,
Usage : ` Enables builder validator registration APIs for the validator client to update settings
such as fee recipient and gas limit . This flag is not required if using proposer
settings config file . ` ,
2022-08-22 16:05:15 +00:00
Value : false ,
Aliases : [ ] string { "enable-validator-registration" } ,
2022-07-06 18:42:21 +00:00
}
2022-07-29 22:20:56 +00:00
// BuilderGasLimitFlag defines the gas limit for the builder to use for constructing a payload.
2022-08-19 16:36:49 +00:00
BuilderGasLimitFlag = & cli . StringFlag {
2022-07-29 22:20:56 +00:00
Name : "suggested-gas-limit" ,
2024-01-02 18:02:28 +00:00
Usage : "Sets gas limit for the builder to use for constructing a payload for all the validators." ,
2022-08-19 16:36:49 +00:00
Value : fmt . Sprint ( params . BeaconConfig ( ) . DefaultBuilderGasLimit ) ,
2022-07-29 22:20:56 +00:00
}
2023-11-28 00:23:48 +00:00
2024-01-02 09:52:14 +00:00
// ValidatorsRegistrationBatchSizeFlag sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching.
ValidatorsRegistrationBatchSizeFlag = & cli . IntFlag {
Name : "validators-registration-batch-size" ,
2023-11-28 00:23:48 +00:00
Usage : "Sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching." ,
Value : 0 ,
}
2024-02-05 15:43:51 +00:00
// EnableDistributed enables the usage of prysm validator client in a Distributed Validator Cluster.
EnableDistributed = & cli . BoolFlag {
Name : "distributed" ,
Usage : "To enable the use of prysm validator client in Distributed Validator Cluster" ,
Value : false ,
}
2015-07-28 22:16:16 +00:00
)
2020-07-01 21:30:01 +00:00
// DefaultValidatorDir returns OS-specific default validator directory.
func DefaultValidatorDir ( ) string {
// Try to place the data folder in the user's home dir
2021-09-17 21:55:24 +00:00
home := file . HomeDir ( )
2020-07-01 21:30:01 +00:00
if home != "" {
if runtime . GOOS == "darwin" {
return filepath . Join ( home , "Library" , "Eth2Validators" )
} else if runtime . GOOS == "windows" {
2020-12-15 20:01:51 +00:00
return filepath . Join ( home , "AppData" , "Local" , "Eth2Validators" )
2020-07-01 21:30:01 +00:00
} else {
return filepath . Join ( home , ".eth2validators" )
}
}
// As we cannot guess a stable location, return empty and handle later
return ""
}