mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
cmd/puppeth: figure out consensus engine for eccpow
This commit is contained in:
parent
7b0bd8bb76
commit
b1853568f5
2 changed files with 20 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ func (w *wizard) makeGenesis() {
|
|||
fmt.Println("Which consensus engine to use? (default = clique)")
|
||||
fmt.Println(" 1. Ethash - proof-of-work")
|
||||
fmt.Println(" 2. Clique - proof-of-authority")
|
||||
fmt.Println(" 3. EccPoW - proof-of-work with LDPC")
|
||||
|
||||
choice := w.read()
|
||||
switch {
|
||||
|
|
@ -103,6 +104,10 @@ func (w *wizard) makeGenesis() {
|
|||
for i, signer := range signers {
|
||||
copy(genesis.ExtraData[32+i*common.AddressLength:], signer[:])
|
||||
}
|
||||
case choice == "3":
|
||||
// In case of eccpow, we're pretty much done
|
||||
genesis.Config.Eccpow = new(params.EccpowConfig)
|
||||
genesis.ExtraData = make([]byte, 32)
|
||||
|
||||
default:
|
||||
log.Crit("Invalid consensus engine choice", "choice", choice)
|
||||
|
|
|
|||
|
|
@ -146,6 +146,21 @@ func (w *wizard) deployNode(boot bool) {
|
|||
return
|
||||
}
|
||||
}
|
||||
} else if w.conf.Genesis.Config.Eccpow != nil {
|
||||
// Eccpow based miners only need an etherbase to mine against
|
||||
fmt.Println()
|
||||
if infos.etherbase == "" {
|
||||
fmt.Printf("What address should the miner use?\n")
|
||||
for {
|
||||
if address := w.readAddress(); address != nil {
|
||||
infos.etherbase = address.Hex()
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("What address should the miner use? (default = %s)\n", infos.etherbase)
|
||||
infos.etherbase = w.readDefaultAddress(common.HexToAddress(infos.etherbase)).Hex()
|
||||
}
|
||||
}
|
||||
// Establish the gas dynamics to be enforced by the signer
|
||||
fmt.Println()
|
||||
|
|
|
|||
Loading…
Reference in a new issue