[Ethereum] Ethereum private network performance

go-ethereumprivate-blockchain

We are using private ethereum network(1 node). We have a couple transaction per second. But mining is too slow. It takes about 10-60 seconds for every transaction. Could you provide some advice settings for genesis or maybe geth start options?

Best Answer

When you create a new test network, you define a genesis block in a JSON file. In that JSON file you can set difficulty. If you set difficulty very low, the blocks will be discovered very fast for the first 100 or so blocks.

However, the difficulty is automatically adjusted such that a new block is found on average every 13 seconds. So a fasst computer will just increase the difficulty, it will, in the long run, not mine faster. You may need to change the source code of Geth and recompile in order to change the 13 second average. Maybe you could lower it to for example 2 seconds? Alternatively, you can start a new genesis block with low difficulty every time you need to test something and then make a new genesis block when the difficulty becomes too high for your patience.

On a mid range laptop a starting difficulty of 0x400 will mine a new block once every second or so.

Do not increase the numbers of threads you use for mining. You will just use more power and you will not find blocks faster since the difficulty adjusts automatically.

Related Topic