Ethereum Mining – How to Make Ethereum Mining Difficulty Static for a Private Chain?

difficultygo-ethereumminingprivate-blockchaintestnets

I have implemented private chain in ethereum but its difficulty level increases by time as a result the mining process slows down. Is it possible to make the difficulty static or disable it in testnet.

Best Answer

Modify the CalcDifficulty in Geth to return a static number, then rebuild Geth. Example:

func CalcDifficulty(config *ChainConfig, time, parentTime uint64, parentNumber, parentDiff *big.Int) *big.Int {
    return big.NewInt(0x4000)
}

Source: Answer to Is it possible to change the block target time?

Related Topic