Coder Social home page Coder Social logo

ethpandaops / ethereum-genesis-generator Goto Github PK

View Code? Open in Web Editor NEW
61.0 5.0 54.0 2.13 MB

Create a ethereum execution and consensus layer testnet genesis and expose it via a webserver for testing purposes

License: MIT License

Dockerfile 1.29% Shell 6.98% Python 91.73%

ethereum-genesis-generator's Introduction

ethereum-genesis-generator

Create a ethereum consensus/execution layer testnet genesis and optionally expose it via a web server for testing purposes.

Examples

You can provide your own configuration directory. Have a look at the example in config-example.

# Create the output directory
mkdir output

# Overwriting the config files and generating the EL and CL genesis
docker run --rm -it -u $UID -v $PWD/output:/data \
  -v $PWD/config/values.env:/config/values.env \
  ethpandaops/ethereum-genesis-generator:latest all

# Just creating the EL genesis
docker run --rm -it -u $UID -v $PWD/output:/data \
  -v $PWD/config/values.env:/config/values.env \
  ethpandaops/ethereum-genesis-generator:latest el

# Just creating the CL genesis
docker run --rm -it -u $UID -v $PWD/output:/data \
  -v $PWD/config/values.env:/config/values.env \
  ethpandaops/ethereum-genesis-generator:latest cl

Environment variables

Name Default Description
SERVER_ENABLED false Enable a web server that will serve the generated files
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 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:

curl -H "Content-Type: application/json" --data-raw '{ "jsonrpc":"2.0","method":"eth_getBlockByNumber", "params":[ "latest", true ], "id":1 }' localhost:8545

Release line explanation

v1 -> bellatrix genesis state v2 -> capella genesis state v3 -> deneb genesis state verkle-gen -> verkle genesis state

Available tools within the image

Name Source
eth2-testnet-genesis https://github.com/protolambda/eth2-testnet-genesis
eth2-val-tools https://github.com/protolambda/eth2-val-tools
zcli https://github.com/protolambda/zcli
el-gen apps/el-gen

ethereum-genesis-generator's People

Contributors

asdacap avatar barnabasbusa avatar dapplion avatar lyfsn avatar mieubrisse avatar moshe-blox avatar parithosh avatar pk910 avatar roysc avatar savid avatar skylenet avatar zah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ethereum-genesis-generator's Issues

Can't serve as a server

Logs:

+ exec python3 -m SimpleHTTPServer 8000
/apps/el-gen/.venv/bin/python3: No module named SimpleHTTPServer

Enable deneb genesis

In order to be able to shadowfork networks that have went through Deneb, we need to be able to generate a CL genesis which supports deneb at genesis.

Getting Zero Trie Root Hash

we are using branch v3.0.3, docker image v3.0.3 and go-ethereum latest version but after initializing genesis file, we got Zero Trie Root Hash error and different genesis hash. is this version still in development? thanks

ERROR[04-29|02:53:36.215] Zero trie root hash!
ERROR[04-29|02:53:36.215] Head block is not reachable
INFO [04-29|02:53:36.293] Successfully wrote genesis state         database=lightchaindata hash=53929c..343f8a

Deposit Contract Block Hash
0x03033636026cd9099ac88fe23fd30f4440e9d2efd3035ebb05739bcf50056573

Logs

INFO [04-29|02:53:36.178] Maximum peer count                       ETH=50 total=50
INFO [04-29|02:53:36.180] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [04-29|02:53:36.182] Set global gas cap                       cap=50,000,000
INFO [04-29|02:53:36.182] Initializing the KZG library             backend=gokzg
INFO [04-29|02:53:36.196] Defaulting to pebble as the backing database
INFO [04-29|02:53:36.196] Allocated cache and file handles         database=/root/testnet/gethdata/geth/chaindata cache=16.00MiB handles=16
INFO [04-29|02:53:36.215] Opened ancient database                  database=/root/testnet/gethdata/geth/chaindata/ancient/chain readonly=false
INFO [04-29|02:53:36.215] State schema set to default              scheme=path
ERROR[04-29|02:53:36.215] Zero trie root hash!
ERROR[04-29|02:53:36.215] Head block is not reachable
INFO [04-29|02:53:36.221] Opened ancient database                  database=/root/testnet/gethdata/geth/chaindata/ancient/state readonly=false
INFO [04-29|02:53:36.221] Writing custom genesis block
INFO [04-29|02:53:36.249] Successfully wrote genesis state         database=chaindata hash=53929c..343f8a
INFO [04-29|02:53:36.249] Defaulting to pebble as the backing database
INFO [04-29|02:53:36.249] Allocated cache and file handles         database=/root/testnet/gethdata/geth/lightchaindata cache=16.00MiB handles=16
INFO [04-29|02:53:36.259] Opened ancient database                  database=/root/testnet/gethdata/geth/lightchaindata/ancient/chain readonly=false
INFO [04-29|02:53:36.259] State schema set to default              scheme=path
ERROR[04-29|02:53:36.259] Zero trie root hash!
ERROR[04-29|02:53:36.259] Head block is not reachable
INFO [04-29|02:53:36.266] Opened ancient database                  database=/root/testnet/gethdata/geth/lightchaindata/ancient/state readonly=false
INFO [04-29|02:53:36.266] Writing custom genesis block
INFO [04-29|02:53:36.293] Successfully wrote genesis state         database=lightchaindata hash=53929c..343f8a

Create Bootnodes & ENR

I see in values.env there is

export BEACON_STATIC_ENR=

and what I understand before getting enr must have genesis.json and initialize it with datadir. or how can I get the bootnode so that it can be entered into values.env?

i made my own public blockchain sir.

issue with decoding the eth1 config

issue with decoding the eth1 config file in the Go code. it seems that this number is being interpreted as the value for the cancunTime field of type uint64 in the ChainConfig struct.

zrnt version: v0.30.0
failed to decode eth1 config file: json: cannot unmarshal number 7083549724304467820220 into Go struct field ChainConfig.config.cancunTime of type uint64

failed to decode eth1 config file: EOF

Running:

docker run --rm --platform linux/x86_64 -it -u $UID -v $PWD/output:/data \
  -v $PWD/config-example:/config \
  ethpandaops/ethereum-genesis-generator:latest all

Getting:

Traceback (most recent call last):
  File "/apps/el-gen/genesis_geth.py", line 53, in <module>
    "shanghaiTime": int(data['genesis_timestamp']) + int(data['genesis_delay']) + (int(data['capella_fork_epoch']) * 32 * int(data['slot_duration_in_seconds'])),
                                                                                       ~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'capella_fork_epoch'

So I have added capella_fork_epoch to my envs and fixed it.

Next I am getting is:

+ genesis_args+=(--eth1-config /data/custom_config_data/genesis.json)
+ /usr/local/bin/eth2-testnet-genesis bellatrix --config /data/custom_config_data/config.yaml --additional-validators /data/all.txt --mnemonics '' --tranches-dir /data/custom_config_data/tranches --state-output /data/custom_config_data/genesis.ssz --eth1-config /data/custom_config_data/genesis.json
zrnt version: v0.30.0
failed to decode eth1 config file: EOF

My all.txt looks like this:

version https://git-lfs.github.com/spec/v1
oid sha256:ba977b5b1da180914c934623fce187860e1b54cff939e6208533b2cb5f589e07
size 239541186

https://raw.githubusercontent.com/eth-clients/holesky/main/public-keys/all.txt

I also tried to run without passing my own configs.

What am I missing?

Faucet ETH Sepolia testnet

Hi @parithosh
Sorry for bothering you. I am migrating my dapp from goerli to sepolia network and am building infrastructure with sepolia testnet so that users can use it, I plan to make a faucet that provides free sepolia ETH so that the community can test most conveniently for users.
Can you give me 12k ETH so I can distribute it to the community.
My wallet address is: 0x8B3AbB8061B8F33bA988FB74489E5AC501DDaF05
I will be very grateful to you!
Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.