Skip to content

Config file support for relays + builder aliases. Defaults for mainnet and hoodi#76

Merged
metachris merged 4 commits intomainfrom
config
Dec 16, 2025
Merged

Config file support for relays + builder aliases. Defaults for mainnet and hoodi#76
metachris merged 4 commits intomainfrom
config

Conversation

@metachris
Copy link
Contributor

@metachris metachris commented Dec 16, 2025

This pull request migrates the relay URLs and builder addresses configuration from hardcoded Go files to external YAML config files, improving flexibility and maintainability. It introduces a new configuration loading mechanism, updates the CLI to support custom config files, and refactors related variables to be populated from the config at runtime. The changes also add sample config files for mainnet and Hoodi networks.

Configuration management improvements:

  • Introduced a new vars/config.go file with a Config struct and LoadConfig function to load relay URLs, builder addresses, and genesis timestamp from a YAML config file. The config is loaded at startup and populates package-level variables for backwards compatibility.
  • Refactored vars/relays.go and vars/builder_addresses.go to remove hardcoded relay URLs and builder addresses, making them populated from the loaded config file instead. [1] [2]
  • Updated vars/vars.go to set the Genesis variable from the config file rather than an environment variable or hardcoded value.

CLI and usage documentation updates:

  • Modified cmd/root.go to add a --config flag and support the CONFIG_FILE environment variable, defaulting to config-mainnet.yaml if unspecified. The config file is loaded before running any command.
  • Updated README.md to document the new config file system, including usage examples for specifying custom config files.

New configuration files:

  • Added config-mainnet.yaml and config-hoodi.yaml as example configuration files for mainnet and Hoodi networks, respectively. These files define relay URLs, genesis timestamps, and builder addresses in YAML format. [1] [2]

Dependency management:

  • Added gopkg.in/yaml.v3 as a direct dependency in go.mod for YAML parsing, and removed it from the indirect dependencies list. [1] [2]

@metachris metachris changed the title config Config file support for relays + builder aliases. Defaults for mainnet and hoodi Dec 16, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces configuration file support for relay URLs and builder addresses, migrating them from hardcoded Go variables to YAML files. The changes enable network-specific configurations with default support for mainnet and hoodi testnet.

Key Changes:

  • Replaced hardcoded relay URLs and builder addresses with YAML-based configuration
  • Added config loader with support for CLI flag and environment variable
  • Created default configurations for mainnet and hoodi networks

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vars/vars.go Changed Genesis from environment variable to config file value
vars/relays.go Converted hardcoded relay URLs to config-populated variables
vars/config.go Added new config loader with YAML parsing and variable population
vars/builder_addresses.go Converted hardcoded builder addresses to config-populated variable
go.mod Moved yaml.v3 dependency from indirect to direct
config-mainnet.yaml Added mainnet configuration with relay URLs and builder addresses
config-hoodi.yaml Added hoodi testnet configuration
cmd/root.go Added config file flag and loading in PersistentPreRunE
README.md Updated documentation to reference config files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@metachris metachris merged commit 9f24302 into main Dec 16, 2025
2 checks passed
@metachris metachris deleted the config branch December 16, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments