Skip to content

Commit

Permalink
Merge pull request #93 from ethpandaops/verkle-sf-from-file
Browse files Browse the repository at this point in the history
verkle sf from file
  • Loading branch information
parithosh authored Jan 31, 2024
2 parents 796f565 + 25e00d5 commit 490dd91
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ SERVER_PORT | 8000 | Web server port

Besides that, you can also use ENV vars in your configuration files. One way of doing this is via the [values.env](config-example/values.env) configuration file. These will be replaced during runtime.

### Shadow Fork
If shadow fork from file is the preferred option, then please ensure the latest block `json` response is collected along with
transactions. This can be done with the below call for example:
```sh
curl -H "Content-Type: application/json" --data-raw '{ "jsonrpc":"2.0","method":"eth_getBlockByNumber", "params":[ "latest", true ], "id":1 }' localhost:8545
```

### Available tools within the image

Name | Source
Expand Down
1 change: 1 addition & 0 deletions config-example/values.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export WITHDRAWAL_TYPE="0x00"
export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134
export BEACON_STATIC_ENR="enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk"
#export SHADOW_FORK_RPC="http://docker.for.mac.localhost:8545"
#export SHADOW_FORK_FILE="/config/el/latest_block.json"
export GENESIS_TIMESTAMP=0
export GENESIS_DELAY=60
export MAX_CHURN=8
Expand Down
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ gen_cl_config(){
if [[ $WITHDRAWAL_TYPE == "0x01" ]]; then
genesis_args+=(--eth1-withdrawal-address $WITHDRAWAL_ADDRESS)
fi
if [[ $SHADOW_FORK_RPC != "" ]]; then
if [[ $SHADOW_FORK_FILE != "" ]]; then
genesis_args+=(--shadow-fork-block-file=$SHADOW_FORK_FILE --eth1-config "")
elif [[ $SHADOW_FORK_RPC != "" ]]; then
genesis_args+=(--shadow-fork-eth1-rpc=$SHADOW_FORK_RPC --eth1-config "")
else
genesis_args+=(--eth1-config /data/custom_config_data/genesis.json)
fi
/usr/local/bin/eth2-testnet-genesis "${genesis_args[@]}"
echo -n "0x0000000000000000000000000000000000000000000000000000000000000000" > /data/custom_config_data/genesis_validators_root.txt
/usr/local/bin/zcli pretty capella BeaconState /data/custom_config_data/genesis.ssz > /data/custom_config_data/parsedBeaconState.json
echo "Genesis block number: $(jq -r '.latest_execution_payload_header.block_number' /data/custom_config_data/parsedBeaconState.json)"
echo "Genesis block hash: $(jq -r '.latest_execution_payload_header.block_hash' /data/custom_config_data/parsedBeaconState.json)"
jq -r '.eth1_data.block_hash' /data/custom_config_data/parsedBeaconState.json | tr -d '\n' > /data/custom_config_data/deposit_contract_block_hash.txt
jq -r '.genesis_validators_root' /data/custom_config_data/parsedBeaconState.json | tr -d '\n' > /data/custom_config_data/genesis_validators_root.txt
else
echo "cl genesis already exists. skipping generation..."
fi
Expand Down

0 comments on commit 490dd91

Please sign in to comment.