mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
adding configs for aura api
This commit is contained in:
parent
c3796278d6
commit
5c2696495c
3 changed files with 8 additions and 4 deletions
|
|
@ -136,6 +136,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
|
||||||
utils.FakePoWFlag,
|
utils.FakePoWFlag,
|
||||||
utils.TestnetFlag,
|
utils.TestnetFlag,
|
||||||
utils.RinkebyFlag,
|
utils.RinkebyFlag,
|
||||||
|
utils.GoerliFlag,
|
||||||
},
|
},
|
||||||
Category: "BLOCKCHAIN COMMANDS",
|
Category: "BLOCKCHAIN COMMANDS",
|
||||||
Description: `
|
Description: `
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common/fdlimit"
|
"github.com/ethereum/go-ethereum/common/fdlimit"
|
||||||
"github.com/ethereum/go-ethereum/consensus"
|
"github.com/ethereum/go-ethereum/consensus"
|
||||||
"github.com/ethereum/go-ethereum/consensus/clique"
|
"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/consensus/ethash"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
|
|
@ -144,7 +145,7 @@ var (
|
||||||
Name: "dev",
|
Name: "dev",
|
||||||
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
|
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
|
||||||
}
|
}
|
||||||
GoerliFLag = cli.BoolFlag{
|
GoerliFlag = cli.BoolFlag{
|
||||||
Name: "goerli",
|
Name: "goerli",
|
||||||
Usage: "Goerli network: pre-configured proof-of-authority test network",
|
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
|
var engine consensus.Engine
|
||||||
if config.Clique != nil {
|
if config.Clique != nil {
|
||||||
engine = clique.New(config.Clique, chainDb)
|
engine = clique.New(config.Clique, chainDb)
|
||||||
|
} else if config.Aura != nil {
|
||||||
|
engine = aura.New(config.Aura, chainDb)
|
||||||
} else {
|
} else {
|
||||||
engine = ethash.NewFaker()
|
engine = ethash.NewFaker()
|
||||||
if !ctx.GlobalBool(FakePoWFlag.Name) {
|
if !ctx.GlobalBool(FakePoWFlag.Name) {
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ func New(config *params.CliqueConfig, db ethdb.Database) *Clique {
|
||||||
recents, _ := lru.NewARC(inmemorySnapshots)
|
recents, _ := lru.NewARC(inmemorySnapshots)
|
||||||
signatures, _ := lru.NewARC(inmemorySignatures)
|
signatures, _ := lru.NewARC(inmemorySignatures)
|
||||||
|
|
||||||
return &Clique{
|
return &Aura{
|
||||||
config: &conf,
|
config: &conf,
|
||||||
db: db,
|
db: db,
|
||||||
recents: recents,
|
recents: recents,
|
||||||
|
|
@ -693,9 +693,9 @@ func (c *Aura) Close() error {
|
||||||
// controlling the signer voting.
|
// controlling the signer voting.
|
||||||
func (c *Aura) APIs(chain consensus.ChainReader) []rpc.API {
|
func (c *Aura) APIs(chain consensus.ChainReader) []rpc.API {
|
||||||
return []rpc.API{{
|
return []rpc.API{{
|
||||||
Namespace: "clique",
|
Namespace: "aura",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: &API{chain: chain, clique: c},
|
Service: &API{chain: chain, aura: c},
|
||||||
Public: false,
|
Public: false,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue