Skip to content

Conversation

@RogerPodacter
Copy link
Member

No description provided.

@RogerPodacter RogerPodacter merged commit cd96e6d into ethscriptions Sep 25, 2025
2 checks passed
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 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"
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
--cache.preimages \
--cache.gc $CACHE_GC \
--cache.trie $CACHE_TRIE \
$PREIMAGES_FLAG \
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
$PREIMAGES_FLAG \
"$PREIMAGES_FLAG" \

Copilot uses AI. Check for mistakes.
CACHE_GC=${CACHE_GC:-25}
CACHE_TRIE=${CACHE_TRIE:-15}


Copy link

Copilot AI Sep 25, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
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.

2 participants