Skip to content

clients: only output full genesis file at high log levels #927

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

Merged
merged 2 commits into from
Oct 24, 2023
Merged
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
16 changes: 13 additions & 3 deletions clients/besu/besu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,19 @@ esac
FLAGS="--logging=$LOG --data-storage-format=BONSAI"

# Configure the chain.
jq -f /mapper.jq /genesis.json > /besugenesis.json
echo -n "Genesis: "; cat /besugenesis.json
FLAGS="$FLAGS --genesis-file=/besugenesis.json "
mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json
FLAGS="$FLAGS --genesis-file=/genesis.json "

# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
else
echo "Supplied genesis state:"
cat /genesis.json
fi


# Enable experimental 'berlin' hard-fork features if configured.
#if [ -n "$HIVE_FORK_BERLIN" ]; then
Expand Down
11 changes: 8 additions & 3 deletions clients/erigon/erigon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ fi
mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json

# Dump genesis
echo "Supplied genesis state:"
cat /genesis.json
# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
else
echo "Supplied genesis state:"
cat /genesis.json
fi

echo "Command flags till now:"
echo $FLAGS
Expand Down
13 changes: 8 additions & 5 deletions clients/ethereumjs/ethereumjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ set -e
ethereumjs="node /ethereumjs-monorepo/packages/client/dist/bin/cli.js"
FLAGS="--gethGenesis ./genesis.json --rpc --rpcEngine --saveReceipts --rpcAddr 0.0.0.0 --rpcEngineAddr 0.0.0.0 --rpcEnginePort 8551 --ws false --logLevel debug --rpcDebug --isSingleNode"


# Configure the chain.
mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json

# Dump genesis
echo "Supplied genesis state:"
cat /genesis.json
# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
else
echo "Supplied genesis state:"
cat /genesis.json
fi

# Import clique signing key.
if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
Expand All @@ -75,7 +79,6 @@ if [ "$HIVE_TERMINAL_TOTAL_DIFFICULTY" != "" ]; then
FLAGS="$FLAGS --jwt-secret ./jwtsecret"
fi


# Load the test chain if present
echo "Loading initial blockchain..."
if [ -f /chain.rlp ]; then
Expand Down
11 changes: 8 additions & 3 deletions clients/go-ethereum/geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ fi
mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json

# Dump genesis
echo "Supplied genesis state:"
cat /genesis.json
# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
else
echo "Supplied genesis state:"
cat /genesis.json
fi

# Initialize the local testchain with the genesis state
echo "Initializing database with genesis state..."
Expand Down
11 changes: 9 additions & 2 deletions clients/nethermind/nethermind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ fi

# Generate the genesis and chainspec file.
mkdir -p /chainspec
echo "Supplied genesis state:"
jq -f /mapper.jq /genesis.json > /chainspec/test.json
jq . /chainspec/test.json

# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.accounts[] | select(.balance == "0x123450000000000000000" or has("builtin")))' /chainspec/test.json
else
echo "Supplied genesis state:"
cat /chainspec/test.json
fi

# Generate the config file.
mkdir /configs
Expand Down
14 changes: 11 additions & 3 deletions clients/nimbus-el/nimbus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,19 @@ if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
fi
fi

# Configure the genesis chain and use it as start block and dump it to stdout
echo "Supplied genesis state:"
jq -f /mapper.jq /genesis.json | tee /genesis-start.json
# Configure the chain.
jq -f /mapper.jq /genesis.json > /genesis-start.json
FLAGS="$FLAGS --custom-network:/genesis-start.json"

# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.genesis.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis-start.json
else
echo "Supplied genesis state:"
cat /genesis-start.json
fi

# Don't immediately abort, some imports are meant to fail
set +e

Expand Down
11 changes: 8 additions & 3 deletions clients/reth/reth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ FLAGS="$FLAGS --datadir /reth-hive-datadir"
mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json

# Dump genesis
echo "Supplied genesis state:"
cat /genesis.json
# Dump genesis.
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
else
echo "Supplied genesis state:"
cat /genesis.json
fi

echo "Command flags till now:"
echo $FLAGS
Expand Down