I am creating a private Ethereum blockchain for the sake of transactions management and storage. I don't care about the consensus part, so I changed the difficulty in the genesis file to 0x1
.
I also edited the consensus.go
file located under the consensus/ethash/
directory, and built a custom geth binary to limit the growth of difficulty but with no luck. Here's what I changed exactly, I changed the CalcDifficulty()
method implementation with the following:
func (ethash *Ethash) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int {
return big.NewInt(1)
}
The problem is that with every block, the difficulty is increased by one. I tried to change the return value to return big.NewInt(0)
but I got an error saying panic: division by zero
I just want to limit the difficulty to 0x1
regardless of how many blocks the chain has.