We have a private network with geth 1.4.18 clients. We have 3 miners (each owned and managed by a different company) and a number of sync-only nodes. Now we would like to upgrade the network to 1.5.5. Since 1.5.5 includes the last hard fork, how do we smoothly switch the miners to the new consensus? Can we set a target block for the hard fork like it was done in the mainnet? Or do we have to simultaneously stop all nodes, upgrade and restart after all companies have upgraded?
2 Answers
while all the nodes are under your control you don't need to set a block you need to just stop(mining) wait for the all nodes to be synced and afterward update them.
-
Ok, I'll try it. However, if they wouldn't be under my control (for instance different companies in within the private network are maintaining the nodes), would it be possible to configure geth to switch to the new protocol from a specific block number in the future?– ivicaaDec 18, 2016 at 22:15
-
I did that built the new updated geth, but when I start geth,
eth.blockNumber
starts from 0. I am using the same data directory I had before. May 20, 2018 at 12:16
Without changing geth's code, it is not possible to reconfigure target blocks for feature activations (EIPs, ...). The configuration is fixed via constants in the code (see ChainConfig). A custom configuration can be provided in genesis specification file, however, this is only applicable when setting up a new chain.
Hence, currently the only way to make a hard fork in a private network is to ensure that all participants shutdown/upgrade/restart in a predefined time slot.
-
1That is possible but can you guide me a step by step process. I mean how do I May 12, 2018 at 3:24
-
I changed geth's code, But How can I retain the previous blocks? May 20, 2018 at 12:17
-