mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
add v2 config into genesis wizard (#273)
This commit is contained in:
parent
3e0505a0c7
commit
767dfde1da
2 changed files with 27 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ func (c config) servers() []string {
|
|||
func (c config) flush() {
|
||||
os.MkdirAll(filepath.Dir(c.path), 0755)
|
||||
|
||||
out, _ := json.MarshalIndent(c, "", " ")
|
||||
out, _ := json.MarshalIndent(c.Genesis, "", " ")
|
||||
if err := ioutil.WriteFile(c.path, out, 0644); err != nil {
|
||||
log.Warn("Failed to save puppeth configs", "file", c.path, "err", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,15 +116,41 @@ func (w *wizard) makeGenesis() {
|
|||
Period: 15,
|
||||
Epoch: 30000,
|
||||
Reward: 0,
|
||||
V2: ¶ms.V2{
|
||||
SwitchBlock: big.NewInt(0),
|
||||
CurrentConfig: ¶ms.V2Config{},
|
||||
AllConfigs: make(map[uint64]*params.V2Config),
|
||||
},
|
||||
}
|
||||
fmt.Println()
|
||||
fmt.Println("How many seconds should blocks take? (default = 2)")
|
||||
genesis.Config.XDPoS.Period = uint64(w.readDefaultInt(2))
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.WaitPeriod = int(genesis.Config.XDPoS.Period)
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.MinePeriod = int(genesis.Config.XDPoS.Period)
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("How many Ethers should be rewarded to masternode? (default = 10)")
|
||||
genesis.Config.XDPoS.Reward = uint64(w.readDefaultInt(10))
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("Which block number start v2 consesus? (default = 0)")
|
||||
genesis.Config.XDPoS.V2.SwitchBlock = w.readDefaultBigInt(genesis.Config.XDPoS.V2.SwitchBlock)
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.SwitchRound = 0
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("How long is the v2 timeout period? (default = 10)")
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.TimeoutPeriod = w.readDefaultInt(10)
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("How many v2 timeout reach to send Synchronize message? (default = 3)")
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.TimeoutSyncThreshold = w.readDefaultInt(3)
|
||||
|
||||
fmt.Println()
|
||||
fmt.Printf("How many v2 vote collection to generate a QC, should be two thirds of masternodes? (default = %d)\n", common.MaxMasternodesV2/3*2+1)
|
||||
genesis.Config.XDPoS.V2.CurrentConfig.CertThreshold = w.readDefaultInt(common.MaxMasternodesV2)/3*2 + 1
|
||||
|
||||
genesis.Config.XDPoS.V2.AllConfigs[0] = genesis.Config.XDPoS.V2.CurrentConfig
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("Who own the first masternodes? (mandatory)")
|
||||
owner := *w.readAddress()
|
||||
|
|
|
|||
Loading…
Reference in a new issue