-
Notifications
You must be signed in to change notification settings - Fork 1
More configurable init #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -50,10 +50,18 @@ else | |||||
| echo "GENESIS_MIX_HASH environment variable is not set, using existing value in genesis file" | ||||||
| fi | ||||||
|
|
||||||
| ENABLE_PREIMAGES=${ENABLE_PREIMAGES:-true} | ||||||
|
|
||||||
| # Build preimages flag for init if enabled | ||||||
| INIT_PREIMAGES_FLAG="" | ||||||
| if [ "$ENABLE_PREIMAGES" = "true" ]; then | ||||||
| INIT_PREIMAGES_FLAG="--cache.preimages" | ||||||
| fi | ||||||
|
|
||||||
| # Check if the data directory is empty | ||||||
| if [ ! "$(ls -A /root/ethereum)" ]; then | ||||||
| echo "Initializing new blockchain..." | ||||||
| geth init --cache.preimages --state.scheme=hash --datadir /root/ethereum "/$GENESIS_FILE" | ||||||
| geth init $INIT_PREIMAGES_FLAG --state.scheme=hash --datadir /root/ethereum "/$GENESIS_FILE" | ||||||
| else | ||||||
| echo "Blockchain already initialized." | ||||||
| fi | ||||||
|
|
@@ -67,13 +75,36 @@ CACHE_SIZE=${CACHE_SIZE:-25000} | |||||
| # Set default auth RPC port if not provided | ||||||
| AUTH_RPC_PORT=${AUTH_RPC_PORT:-8551} | ||||||
|
|
||||||
| GC_MODE=${GC_MODE:-archive} | ||||||
|
|
||||||
| STATE_HISTORY=${STATE_HISTORY:-0} | ||||||
| TX_HISTORY=${TX_HISTORY:-0} | ||||||
|
|
||||||
| CACHE_GC=${CACHE_GC:-25} | ||||||
| CACHE_TRIE=${CACHE_TRIE:-15} | ||||||
|
|
||||||
|
|
||||||
|
||||||
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $PREIMAGES_FLAG should be quoted to prevent word splitting and pathname expansion. Use "$PREIMAGES_FLAG" instead.
| $PREIMAGES_FLAG \ | |
| "$PREIMAGES_FLAG" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $INIT_PREIMAGES_FLAG should be quoted to prevent word splitting and pathname expansion. Use "$INIT_PREIMAGES_FLAG" instead.