config

package
v0.0.2-RC28 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagYes is the flag for yes.
	FlagYes = "yes"
	// FlagCfg is the flag for cfg.
	FlagCfg = "cfg"
	// FlagNetwork is the flag for the network name. Valid values: ["testnet", "mainnet", "custom"].
	FlagNetwork = "network"
	// FlagCustomNetwork is the flag for the custom network file. This is required if --network=custom
	FlagCustomNetwork = "custom-network-file"
	// FlagKeyStorePath is the path of the key store file containing the private key of the account going to sing and approve the tokens
	FlagKeyStorePath = "key-store-path"
	// FlagPassword is the password needed to decrypt the key store
	FlagPassword = "password"
	// FlagMigrations is the flag for migrations.
	FlagMigrations = "migrations"
	// FlagDocumentationFileType is the flag for the choose which file generate json-schema
	FlagDocumentationFileType = "config-file"
)
View Source
const DefaultValues = `` /* 1664-byte string literal not displayed */

DefaultValues is the default configuration

Variables

This section is empty.

Functions

func LoadGenesisFileAsString

func LoadGenesisFileAsString(cfgPath string) (string, error)

LoadGenesisFileAsString loads the genesis file as a string

Types

type Config

type Config struct {
	// Configuration of the etherman (client for access L1)
	Etherman etherman.Config
	// Configuration for ethereum transaction manager
	EthTxManager ethtxmanager.Config
	// Configuration of the aggregator service
	Aggregator aggregator.Config `mapstructure:"Aggregator"`
	// Configuration of the genesis of the network. This is used to known the initial state of the network
	NetworkConfig NetworkConfig
	// Configuration of the metrics service, basically is where is going to publish the metrics
	Metrics metrics.Config
	// Configuration of the event database connection
	EventLog event.Config
}

Config represents the configuration of the entire Hermez Node The file is TOML format You could find some examples:

  • `config/environments/local/local.node.config.toml`: running a permisionless node
  • `config/environments/mainnet/node.config.toml`
  • `config/environments/public/node.config.toml`
  • `test/config/test.node.config.toml`: configuration for a trusted node used in CI

func Default

func Default() (*Config, error)

Default parses the default configuration values.

func Load

func Load(ctx *cli.Context, loadNetworkConfig bool) (*Config, error)

Load loads the configuration

type GenesisFromJSON

type GenesisFromJSON struct {
	// L1: root hash of the genesis block
	Root string `json:"root"`
	// L1: block number of the genesis block
	GenesisBlockNum uint64 `json:"genesisBlockNumber"`
	// L2:  List of states contracts used to populate merkle tree at initial state
	Genesis []genesisAccountFromJSON `json:"genesis"`
	// L1: configuration of the network
	L1Config etherman.L1Config
}

GenesisFromJSON is the config file for network_custom

type NetworkConfig

type NetworkConfig struct {
	// L1: Configuration related to L1
	L1Config etherman.L1Config `json:"l1Config"`
	// L1: Genesis of the rollup, first block number and root
	Genesis state.Genesis
}

NetworkConfig is the configuration struct for the different environments

func LoadGenesisFromJSONString

func LoadGenesisFromJSONString(jsonStr string) (NetworkConfig, error)

LoadGenesisFromJSONString loads the genesis file from JSON string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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