I have created a private ethereum based blockchain and I would like to set the max/total supply and not sure where to do this or how to do this during the genesis block creation.
(I'm sure this has been asked before, but I can't find it. If someone else does, feel free to flag as a duplicate.)
You can't do this by just setting a value anywhere, I'm afraid. What you have to do is control the issuance rate over time through block rewards.
To control the issuance rate you have a couple of options:
Statically define the points at which you want the issuance rate to reduce, giving you a series of stepped reductions. e.g. "At block 100,000, reduce the issuance rate to 2 ETH per block mined, and decrease the number of considered uncle blocks."
Create a function to linearly (or otherwise) decrease the block reward on a per-block basis. (
AccumulateRewards()might be a good place to start looking into this.)
To get the above ideas to fit with your desired eventual total supply, you'd need to do the maths beforehand.
(Caveat: I haven't done either of the above myself. Others might have different strategies for how they've done what you're asking.)
A different strategy would be to decrease issuance rates by increasing block time. This has the effect of increasing transaction time, so might be something you don't want to consider. If at any point you do, then there are various questions about the Difficulty Bomb: i.e. an increase in difficulty leading to an increase in block time leading to a decrease in issuance rate.