From 5c2696495c786227173d85bb7d570d014b336ddc Mon Sep 17 00:00:00 2001 From: priom Date: Sat, 8 Sep 2018 07:33:01 -0400 Subject: [PATCH] adding configs for aura api --- cmd/geth/chaincmd.go | 1 + cmd/utils/flags.go | 5 ++++- consensus/aura/aura.go | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 87548865be..44a9f5641d 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -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: ` diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 14d53a7b3b..eaaa5bb6a2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -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) { diff --git a/consensus/aura/aura.go b/consensus/aura/aura.go index 584f2723de..9901337efa 100644 --- a/consensus/aura/aura.go +++ b/consensus/aura/aura.go @@ -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, }} } \ No newline at end of file