How to create a genesis block (I'm starting an alt-chia)

Use your farmer and pool public key that should receive the prefarm and generate the puzzle hash with for example this tool:
https://www.chiaexplorer.com/tools/address-puzzlehash-converter

However, you should really consider not using a pre-farm as this will lower the acceptance of your fork in the community.

yes sir,this can generate GENESIS_PRE_FARM_POOL_PUZZLE_HASH and GENESIS_PRE_FARM_FARMER_PUZZLE_HASH,how about genesis challenge generate ?just random?

I would say this is random, every block in a block chain needs a hash that links it with the previous block and the first block (genesis block) need such a value too.

To mitigate some attacks like replay attack on other hard forks, you are advised to use a own genesis value for every hard fork!

On linux you would simply do something like:

$ dd if=/dev/urandom bs=1M count=1 2>/dev/null | sha256sum
c9fd4939f88dd9a171578e71ec98fb2c34d5bd9b4a832b1a8437f738f2c37f40

yes,i see, thank you very much,i will test it

Here are the proof that it’s really a sha256 value:

Honestly, it is very hard for anyone to help troubleshoot this because they need to know very specifically each and every step you took in setting all this up. Step by step, what did you do, what did you edit, what order did you start everything up, how you are adding IPs and such. Is your fork on github so we can see and so on.

You could be trying to solve one issue but in all reality it is another entirely. So share as much details as possible as to how you did everything to get to this point.

1 Like

yes,it is hard to say my detail operation,
first I fork chia,
chage port in config,
change GENESIS challenge and two PUZZLE_HASH,
build and run(three client, unbutun and win,all service start in unbutun include timelord)
genesis block hadn’t auto generate ,the height is still zero,status is Not Synced.

Start by making your constants like flax:

you can change
“MIN_PLOT_SIZE”: 32, # 32 for mainnet

to a lower plot value, then create a lot of small sized plots for testing.
remember that the plot filter is 1/512 so you need a good amount of plots to get at least a few to pass filter.

aren’t you trying to get a testnet running :slight_smile:

I’m saying flax is the fork with least amount changed… their constants have the correct values… if you copy theirs, you eliminate any issues due to bad constant values.

you should really understand what each constant value does, but this will give you a quick path to getting a fork up.

thank you sir ,i will try to used flax code,may be it works

hi,sir,i used flax code,but look the same.
i fork flax code,and change port,
no change to genesis challenge and prefarm puzzle hash.
used two client(linux run all service,win run client)
but no genesis block auto generate,so where am i wrong?

two fullnode add each other

Full nodes can be timelords or farmers, or they can just perform the roles of a full node. This entails broadcasting proofs of space and time, creating blocks, maintaining a mempool of pending transactions, storing the historical blockchain, and uploading blocks to other full nodes as well as wallets (light clients).

Are you running the 3 timelord VDFs ?

yes,linux start all service

am i ask a question? the first block(genesis block) is auto generate? or generate by function in code then broadcast
by the way,i had not run testnet,i change the mainnet port

Check if the farmer: creates a proof of Space
Check if the timelord: creates a proof of Time
by checking if the challenge chain advances

I can’t debug this for you… open the logs check out the block verification part (header and block content), there are many things that can abort block creation

the debug log like this

your turn to debug this… if you can’t read the code or figure this out… a fork is simply not for you.

1 Like

Yes
1 you need change this 60 to 600 seconds.
2 you need prepare more than 100 100G (10T)plots to boot up.
3 if you not have enough plots, you can change the NUMBER_ZERO_BITS_PLOT_FILTER value to 1 in default_constants.py file.

this steps base on you work before.

you will get your genesis block in half hour.

Good luck.