config

package
v0.0.0-...-ded9150 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	/* Required Flags */
	ConfigFileFlag = cli.StringFlag{
		Name:     "config",
		Required: true,
		Usage:    "Load configuration from `FILE`",
	}
	SFFLDeploymentFileFlag = cli.StringFlag{
		Name:     "nffl-deployment",
		Required: true,
		Usage:    "Load SFFL contract addresses from `FILE`",
	}
	EcdsaPrivateKeyFlag = cli.StringFlag{
		Name:     "ecdsa-private-key",
		Usage:    "Ethereum private key",
		Required: true,
		EnvVar:   "ECDSA_PRIVATE_KEY",
	}
)
View Source
var Flags []cli.Flag

Flags contains the list of configuration options available to the binary.

Functions

func CompileRollupsInfo

func CompileRollupsInfo(configRaw *ConfigRaw) map[uint32]RollupInfo

Types

type Config

type Config struct {
	EcdsaPrivateKey *ecdsa.PrivateKey `json:"-"`
	BlsPrivateKey   *bls.PrivateKey   `json:"-"`
	// we need the url for the eigensdk currently... eventually standardize api so as to
	// only take an ethclient or an rpcUrl (and build the ethclient at each constructor site)
	EthHttpRpcUrl                  string                `json:"ethHttpRpcUrl"`
	EthWsRpcUrl                    string                `json:"ethWsRpcUrl"`
	RollupsInfo                    map[uint32]RollupInfo `json:"rollupsInfo"`
	OperatorStateRetrieverAddr     common.Address        `json:"operatorStateRetrieverAddr"`
	SFFLRegistryCoordinatorAddr    common.Address        `json:"sfflRegistryCoordinatorAddr"`
	AggregatorServerIpPortAddr     string                `json:"aggregatorServerIpPortAddr"`
	AggregatorRestServerIpPortAddr string                `json:"aggregatorRestServerIpPortAddr"`
	AggregatorDatabasePath         string                `json:"aggregatorDatabasePath"`
	AggregatorCheckpointInterval   time.Duration         `json:"aggregatorCheckpointInterval"`
	RegisterOperatorOnStartup      bool                  `json:"registerOperatorOnStartup"`
	AggregatorAddress              common.Address        `json:"aggregatorAddress"`

	// metrics related
	EnableMetrics        bool   `json:"enableMetrics"`
	MetricsIpPortAddress string `json:"metricsIpPortAddress"`
}

Config contains all of the configuration information for SFFL aggregators and challengers. Operators use a separate config. (see config-files/operator.anvil.yaml)

func NewConfig

func NewConfig(ctx *cli.Context, configRaw ConfigRaw, logger sdklogging.Logger) (*Config, error)

NewConfig parses config file to read from from flags or environment variables Note: This config is shared by challenger and aggregator and so we put in the core. Operator has a different config and is meant to be used by the operator CLI.

type ConfigRaw

type ConfigRaw struct {
	Environment                    sdklogging.LogLevel `yaml:"environment"`
	EthRpcUrl                      string              `yaml:"eth_rpc_url"`
	EthWsUrl                       string              `yaml:"eth_ws_url"`
	AggregatorServerIpPortAddr     string              `yaml:"aggregator_server_ip_port_address"`
	AggregatorRestServerIpPortAddr string              `yaml:"aggregator_rest_server_ip_port_address"`
	AggregatorDatabasePath         string              `yaml:"aggregator_database_path"`
	AggregatorCheckpointInterval   uint32              `yaml:"aggregator_checkpoint_interval"`
	RegisterOperatorOnStartup      bool                `yaml:"register_operator_on_startup"`
	RollupIdsToRpcUrls             map[uint32]string   `yaml:"rollup_ids_to_rpc_urls"`
	RollupIdsToRegistryAddresses   map[uint32]string   `yaml:"rollup_ids_to_registry_addresses"`

	EnableMetrics        bool   `yaml:"enable_metrics"`
	MetricsIpPortAddress string `yaml:"metrics_ip_port_address"`
}

These are read from ConfigFileFlag

func NewConfigRaw

func NewConfigRaw(ctx *cli.Context) (*ConfigRaw, error)

type RollupInfo

type RollupInfo struct {
	SFFLRegistryRollupAddr common.Address
	RpcUrl                 string
}

type SFFLContractsRaw

type SFFLContractsRaw struct {
	RegistryCoordinatorAddr    string `json:"registryCoordinator"`
	OperatorStateRetrieverAddr string `json:"operatorStateRetriever"`
}

type SFFLDeploymentRaw

type SFFLDeploymentRaw struct {
	Addresses SFFLContractsRaw `json:"addresses"`
}

These are read from SFFLDeploymentFileFlag

Jump to

Keyboard shortcuts

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