Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support read Genesis from env for custom chain #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ export ETH_NODE_URI="http://localhost:8545"
# export ETH_NODE_BACKUP_URI="https://mainnet.infura.io/v3/API_KEY" # optional

# Beacon node is required for bid collection
# export BEACON_URI="http://localhost:3500"
# export BEACON_URI="http://localhost:3500"

# Genesis time is used to calculate slot numbers, if use devnet/custom chain, set this
# export GENESIS="1606824023"
4 changes: 3 additions & 1 deletion vars/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ package vars
import (
"os"

"github.com/flashbots/go-utils/cli"

relaycommon "github.com/flashbots/mev-boost-relay/common"
)

var (
Version = "dev" // is set during build process
LogDebug = os.Getenv("DEBUG") != ""
LogJSON = os.Getenv("LOG_JSON") != ""
Genesis = 1_606_824_023
Genesis = cli.GetEnvInt("GENESIS", 1_606_824_023)

DefaultBeaconURI = relaycommon.GetEnv("BEACON_URI", "http://localhost:3500")
DefaultPostgresDSN = relaycommon.GetEnv("POSTGRES_DSN", "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable")
Expand Down
Loading