diff --git a/README.md b/README.md index e79c13c..6586a77 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config-example/values.env b/config-example/values.env index 5b72e43..615fd3c 100644 --- a/config-example/values.env +++ b/config-example/values.env @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 0f7202f..9f09a35 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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