-
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
Conversation
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.
Pull Request Overview
This PR makes the Geth initialization script more configurable by adding environment variable support for various cache and performance settings, allowing users to customize their node configuration without modifying the script directly.
Key changes:
- Added environment variables for preimages, garbage collection mode, history settings, and cache configurations
- Made preimage caching optional through the ENABLE_PREIMAGES variable
- Added configuration logging to show startup parameters
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 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" |
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 $INIT_PREIMAGES_FLAG should be quoted to prevent word splitting and pathname expansion. Use "$INIT_PREIMAGES_FLAG" instead.
| geth init $INIT_PREIMAGES_FLAG --state.scheme=hash --datadir /root/ethereum "/$GENESIS_FILE" | |
| geth init "$INIT_PREIMAGES_FLAG" --state.scheme=hash --datadir /root/ethereum "/$GENESIS_FILE" |
| --cache.preimages \ | ||
| --cache.gc $CACHE_GC \ | ||
| --cache.trie $CACHE_TRIE \ | ||
| $PREIMAGES_FLAG \ |
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" \ |
| 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.
[nitpick] Remove the extra blank line to maintain consistent spacing in the script.
No description provided.