adding configs for aura api

This commit is contained in:
priom 2018-09-08 07:33:01 -04:00
parent c3796278d6
commit 5c2696495c
3 changed files with 8 additions and 4 deletions

View file

@ -136,6 +136,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.FakePoWFlag,
utils.TestnetFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `

View file

@ -34,6 +34,7 @@ import (
"github.com/ethereum/go-ethereum/common/fdlimit"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/clique"
"github.com/ethereum/go-ethereum/consensus/aura"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
@ -144,7 +145,7 @@ var (
Name: "dev",
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
}
GoerliFLag = cli.BoolFlag{
GoerliFlag = cli.BoolFlag{
Name: "goerli",
Usage: "Goerli network: pre-configured proof-of-authority test network",
}
@ -1368,6 +1369,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
var engine consensus.Engine
if config.Clique != nil {
engine = clique.New(config.Clique, chainDb)
} else if config.Aura != nil {
engine = aura.New(config.Aura, chainDb)
} else {
engine = ethash.NewFaker()
if !ctx.GlobalBool(FakePoWFlag.Name) {

View file

@ -218,7 +218,7 @@ func New(config *params.CliqueConfig, db ethdb.Database) *Clique {
recents, _ := lru.NewARC(inmemorySnapshots)
signatures, _ := lru.NewARC(inmemorySignatures)
return &Clique{
return &Aura{
config: &conf,
db: db,
recents: recents,
@ -693,9 +693,9 @@ func (c *Aura) Close() error {
// controlling the signer voting.
func (c *Aura) APIs(chain consensus.ChainReader) []rpc.API {
return []rpc.API{{
Namespace: "clique",
Namespace: "aura",
Version: "1.0",
Service: &API{chain: chain, clique: c},
Service: &API{chain: chain, aura: c},
Public: false,
}}
}