Conversation
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
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} | ||
|
|
||
|
|
There was a problem hiding this comment.
[nitpick] Remove the extra blank line to maintain consistent spacing in the script.
No description provided.