eth2.0-specs/tests/core/pyspec/eth2spec/config
protolambda 48e1ef193a
update docs with config usage
2021-05-18 21:31:27 +02:00
..
README.md update docs with config usage 2021-05-18 21:31:27 +02:00
__init__.py merge in dev (v0.10) and fix reorg/lint issues 2020-01-13 18:55:21 +01:00
config_util.py config as dataclass 2021-05-18 12:48:42 +02:00

README.md

Eth2 config util

For configuration, see Configs documentation.

Usage:

from eth2spec.config import config_util
from eth2spec.phase0 import mainnet as spec
from pathlib import Path

# To load the default configurations
config_util.load_defaults(Path("eth2.0-specs/configs"))  # change path to point to equivalent of specs `configs` dir.
# After loading the defaults, a config can be chosen: 'mainnet', 'minimal', or custom network config (by file path)
spec.config = spec.Configuration(**config_util.load_config_file(Path('mytestnet.yaml')))

Note: previously the testnet config files included both preset and runtime-configuration data. The new config loader is compatible with this: all config vars are loaded from the file, but those that have become presets will be ignored.