Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Epic/aura consensus #24

Draft
wants to merge 135 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
44a07e2
Added aura dir
Sep 14, 2020
95b105f
Adding cli lukso flag and auto-config of lukso node
Sep 15, 2020
da077f7
Change signature from clique to aura in aura consensus
Sep 15, 2020
c34c6ca
Initiate aura
Sep 15, 2020
bdb0ffb
Added difficulty retrival from Aura config
Sep 15, 2020
28e940c
Changed in verify header and added authorities array in AuraConfig
Sep 15, 2020
70d36a5
Fixed type of difficulty and changed prepare and seal function in aura
Sep 15, 2020
455e3e2
Added aura engine in MakeChain method for supporting different flag c…
Sep 15, 2020
deed825
Added signer checking in Seal and VerifySeal method.
Sep 15, 2020
3fd5b6b
Added aura genesis and init script
Sep 15, 2020
76714f2
Fixed new block signing problem
Sep 15, 2020
870aa8a
Sigle node produces block successfully. But multi-node cannot sync bl…
Sep 16, 2020
a0414b0
Avoid Difficulty validation
Sep 16, 2020
ee22ce2
Found the reason for the header mismatch
Sep 16, 2020
8add52c
Solved genesis mismatch problem
Sep 17, 2020
09d9eb3
Removed extra debug log
Sep 17, 2020
76e8985
Fix comments
Sep 18, 2020
064f1aa
Change genesis.json file
Sep 18, 2020
03dc309
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
0a91be4
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
3724e6f
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
8f166f4
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
d2ffcd2
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
0eba12b
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
2574e3e
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
95362be
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
4cc75bc
Provided (matching?) parity and geth basic configs?
eddubbs Sep 15, 2020
e8fee1e
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
9bb4446
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
2b5d286
Provided (matching?) parity and geth basic configs?
eddubbs Sep 16, 2020
34f43b5
Provided (matching?) parity and geth basic configs?
mxmar Sep 21, 2020
9b2e077
- merged with Atif;
mxmar Sep 22, 2020
46aaf5d
- merged with Atif;
mxmar Sep 23, 2020
fa0b8de
Debug mix digest with test from empty string
eddubbs Sep 24, 2020
47a6eb6
Debug mix digest with test from empty string
eddubbs Sep 24, 2020
0832567
Unstable state but I do not want to loose changes
eddubbs Sep 24, 2020
dfdb59d
- fixed "genesis"->"seal"->"authorityRound";
mxmar Sep 24, 2020
ed02334
This is mess, but fetch it
eddubbs Sep 24, 2020
8c4aff9
Error: Header in aura block is nil
eddubbs Sep 25, 2020
9597dff
- testing block header parser;
mxmar Sep 25, 2020
8b54cb7
- TestBlockEncodingAuraHeader;
mxmar Sep 25, 2020
5ea9f5b
- TestBlockEncodingAuraHeader;
mxmar Sep 25, 2020
ef54757
- TestBlockEncodingAura added;
mxmar Sep 25, 2020
d9bdf4f
I've got working header
eddubbs Sep 25, 2020
d0ef569
Header and block is decoding
eddubbs Sep 25, 2020
e96ab4d
Merge branch 'debug/mix-digest' of github.com:lukso-network/go-ethere…
eddubbs Sep 25, 2020
221261a
Message number 4
eddubbs Sep 25, 2020
b800e20
Hashes for block and header match
eddubbs Sep 26, 2020
b3dc8ea
Added test for encoding block latest from aura to aura header
eddubbs Sep 27, 2020
5b0de62
Working parsing from json, but not from message 0x7
eddubbs Sep 27, 2020
fefceb6
0x7 working
eddubbs Sep 27, 2020
46585ed
Both json marshaling and rlp decoding from 0x7 works
eddubbs Sep 27, 2020
dfe6b87
Fixed msg 0x04
eddubbs Sep 27, 2020
098f91a
Fixed msg 0x04
eddubbs Sep 27, 2020
653482d
Fixed msg 0x04
eddubbs Sep 27, 2020
3b8a7f2
Added test for incoming block 1
eddubbs Sep 28, 2020
e9bc003
Added test for incoming block 1.
eddubbs Sep 28, 2020
534d559
Added test for incoming block 1.
eddubbs Sep 28, 2020
fa9863e
- TestAuraGenesisBlock added;
mxmar Sep 28, 2020
b8765b6
Merge remote-tracking branch 'origin/debug/mix-digest' into debug/mix…
mxmar Sep 28, 2020
7a5915c
Added test for incoming block 1.
eddubbs Sep 28, 2020
d59d104
Merge branch 'debug/mix-digest' of github.com:lukso-network/go-ethere…
eddubbs Sep 28, 2020
ec25576
Added test for incoming block 1.
eddubbs Sep 28, 2020
7de7497
Added test for incoming block 1.
eddubbs Sep 28, 2020
84dbfb8
Added test for incoming block 1.
eddubbs Sep 28, 2020
d3c5315
feature/16/implement-synchronization-with-l15
Sep 28, 2020
9dd94d1
feature/16/implement-synchronization-with-l15
Sep 28, 2020
afa9f6a
Added test for signing block
Sep 29, 2020
882bf72
Resolving problem with creating hash for block signature
patred20 Oct 2, 2020
7e3004d
- TestAura_VerifySeal added;
mxmar Oct 5, 2020
ac5d876
- TestAura_VerifySeal added;
mxmar Oct 5, 2020
6272d54
- TestAura_VerifySeal passes;
mxmar Oct 5, 2020
2b59d87
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 5, 2020
397ff47
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 5, 2020
9ee28ed
Fixed step calculation expression
patred20 Oct 5, 2020
30de7e3
- TestAura_VerifySeal passes but not everytime;
mxmar Oct 6, 2020
332b4d3
- ReadHeaderRLP modified for testing/debug purpose;
mxmar Oct 6, 2020
2ad24e1
Merge pull request #22 from lukso-network/feature/16/implement-synchr…
blazejkrzak Oct 7, 2020
3b8e05a
- Merge conflicts resolving;
mxmar Oct 7, 2020
7983e8f
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
713013a
- Merge conflicts resolving;
mxmar Oct 7, 2020
ae105ee
Merge pull request #20 from lukso-network/feature/2/genesis-with-aura…
blazejkrzak Oct 7, 2020
2ea4659
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
1f922e6
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
2143d33
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
8a4b153
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
b104bf8
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
3610e34
Feature: 18 switch extradata to signer
blazejkrzak Oct 7, 2020
a955c0e
Merge epic into feature 18
blazejkrzak Oct 7, 2020
6ad26be
Merge pull request #21 from lukso-network/feature/18/switch-from-extr…
blazejkrzak Oct 7, 2020
eafc6e1
Test mining for aura before implementation
blazejkrzak Oct 9, 2020
914cff3
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
533b38a
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
2762abb
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
d388019
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
3b65337
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
2894540
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
46f36d7
Feature: 23 test geth as validator
blazejkrzak Oct 12, 2020
323b2d3
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
3092f6e
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
7cbdcf2
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
76aea04
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
e7368ea
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
62898e1
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
c7800eb
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
f3c8e2c
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
70fdf5b
Feature: 23 test geth as validator
blazejkrzak Oct 13, 2020
fd638bd
Feature: 23 test geth as validator
blazejkrzak Oct 14, 2020
d285294
Feature: 23 test geth as validator
blazejkrzak Oct 14, 2020
680bc80
Feature: 23 test geth as validator
blazejkrzak Oct 16, 2020
6683219
Feature: 23 test geth as validator
blazejkrzak Oct 16, 2020
10f3ce4
Feature: 23 test geth as validator
blazejkrzak Oct 19, 2020
fd27445
Feature: 23 test geth as validator
blazejkrzak Oct 19, 2020
630f546
Feature: 23 test geth as validator
blazejkrzak Oct 20, 2020
45f24bf
Feature: 23 test geth as validator
blazejkrzak Oct 20, 2020
bd1e7e2
Merge pull request #28 from lukso-network/feature/23/test-geth-as-val…
blazejkrzak Oct 21, 2020
ce19823
Feature: 26 stress testing aura port
blazejkrzak Oct 24, 2020
fe62945
Feature: 26 stress testing aura port
blazejkrzak Oct 24, 2020
da93317
Merge pull request #29 from lukso-network/feature/26/stress-testing-a…
blazejkrzak Oct 24, 2020
803f85a
Feature: 04 puppeth integration
blazejkrzak Oct 24, 2020
0a20355
Feature: 04 puppeth integration
blazejkrzak Oct 24, 2020
55220bc
Feature: 04 puppeth integration
blazejkrzak Oct 29, 2020
3280983
Feature: 04 puppeth integration
blazejkrzak Oct 30, 2020
f32b341
Feature: 04 puppeth integration
blazejkrzak Oct 30, 2020
5f370c0
Feature: 04 puppeth integration
blazejkrzak Nov 4, 2020
7da6eac
Feature: 04 puppeth integration
blazejkrzak Nov 4, 2020
9c8d22b
Feature: 04 puppeth integration
blazejkrzak Nov 5, 2020
b64f831
Merge pull request #32 from lukso-network/feature/04/puppeth-integration
blazejkrzak Nov 5, 2020
f0e35c7
Fix: Panic from parity sync
blazejkrzak Nov 9, 2020
fc2fe05
Merge pull request #37 from lukso-network/fix/panic-from-parity
blazejkrzak Nov 18, 2020
e4112a3
This is fix for invalid header from cache that led to desynchronizati…
blazejkrzak Nov 18, 2020
8c68e04
Merge pull request #39 from lukso-network/fix/35/invalid-header-from-…
blazejkrzak Nov 18, 2020
189c518
Fixed invalid header delivery and wrong difficulty
patred20 Nov 25, 2020
c1a90f7
Refactored nested if
patred20 Nov 27, 2020
f000343
Merge pull request #42 from lukso-network/fix/invalid-headers-from-geth
blazejkrzak Nov 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
MimetypeDataWithValidator = "data/validator"
MimetypeTypedData = "data/typed"
MimetypeClique = "application/x-clique-header"
MimetypeAura = "application/x-aura-header"
MimetypeTextPlain = "text/plain"
)

Expand Down
1 change: 1 addition & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.RinkebyFlag,
utils.TxLookupLimitFlag,
utils.GoerliFlag,
utils.LuksoFlag,
patred20 marked this conversation as resolved.
Show resolved Hide resolved
utils.YoloV1Flag,
utils.LegacyTestnetFlag,
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func remoteConsole(ctx *cli.Context) error {
path = filepath.Join(path, "goerli")
} else if ctx.GlobalBool(utils.YoloV1Flag.Name) {
path = filepath.Join(path, "yolo-v1")
} else if ctx.GlobalBool(utils.LuksoFlag.Name) {
patred20 marked this conversation as resolved.
Show resolved Hide resolved
path = filepath.Join(path, "lukso")
}
}
endpoint = fmt.Sprintf("%s/geth.ipc", path)
Expand Down
79 changes: 79 additions & 0 deletions cmd/geth/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,61 @@ var customGenesisTests = []struct {
},
}

var customAuraGenesisTests = []struct {
genesis string
query string
result string
}{
// Aura Genesis file with specific chain configurations to test
{
genesis: `
{
"name": "AuthorityRound",
"engine": {
"authorityRound": {
"params": {
"stepDuration": "5",
"validators" : {
"list": [
"0x70ad1a5fba52e27173d23ad87ad97c9bbe249abf",
"0xafe443af9d1504de4c2d486356c421c160fdd7b1"
]
}
}
}
},
"params": {
"gasLimitBoundDivisor": "0x400",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x2323"
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x20000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x222222"
},
"accounts": {
"0x0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0x0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }
}
}`,
query: "eth.getBlock(0).hash",
result: "0x2778716827366f0a5479d7a907800d183c57382fa7142b84fbb71db143cf788c",
},
}

// Tests that initializing Geth with a custom genesis block and chain definitions
// work properly.
func TestCustomGenesis(t *testing.T) {
Expand All @@ -92,3 +147,27 @@ func TestCustomGenesis(t *testing.T) {
geth.ExpectExit()
}
}

// Tests that initializing Geth with a custom aura genesis block and chain definitions
// work properly.
func TestAuraGenesisBlock(t *testing.T) {
for i, tt := range customAuraGenesisTests {
// Create a temporary data directory to use and inspect later
datadir := tmpdir(t)
defer os.RemoveAll(datadir)

// Initialize the data directory with the custom genesis block
json := filepath.Join(datadir, "genesis.json")
if err := ioutil.WriteFile(json, []byte(tt.genesis), 0600); err != nil {
t.Fatalf("test %d: failed to write aura genesis file: %v", i, err)
}
runGeth(t, "--nousb", "--datadir", datadir, "init", json).WaitExit()
// Query the custom genesis block
geth := runGeth(t, "--nousb",
"--datadir", datadir, "--maxpeers", "0", "--port", "0",
"--nodiscover", "--nat", "none", "--ipcdisable",
"--exec", tt.query, "console")
geth.ExpectRegexp(tt.result)
geth.ExpectExit()
}
}
6 changes: 5 additions & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ var (
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.LuksoFlag,
patred20 marked this conversation as resolved.
Show resolved Hide resolved
utils.YoloV1Flag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
Expand Down Expand Up @@ -295,6 +296,9 @@ func prepare(ctx *cli.Context) {
case ctx.GlobalIsSet(utils.GoerliFlag.Name):
log.Info("Starting Geth on Görli testnet...")

case ctx.GlobalIsSet(utils.LuksoFlag.Name):
log.Info("Starting Geth on Lukso testnet...")
patred20 marked this conversation as resolved.
Show resolved Hide resolved

case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
log.Info("Starting Geth in ephemeral dev mode...")

Expand All @@ -304,7 +308,7 @@ func prepare(ctx *cli.Context) {
// If we're a full node on mainnet without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name) && !ctx.GlobalIsSet(utils.RopstenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
if !ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name) && !ctx.GlobalIsSet(utils.RopstenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.LuksoFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
patred20 marked this conversation as resolved.
Show resolved Hide resolved
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.SmartCardDaemonPathFlag,
utils.NetworkIdFlag,
utils.GoerliFlag,
utils.LuksoFlag,
utils.RinkebyFlag,
utils.YoloV1Flag,
utils.RopstenFlag,
Expand Down
36 changes: 22 additions & 14 deletions cmd/puppeth/module_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

// nodeDockerfile is the Dockerfile required to run an Ethereum node.
var nodeDockerfile = `
FROM ethereum/client-go:latest
FROM {{.DockerImage}}

ADD genesis.json /genesis.json
{{if .Unlock}}
Expand Down Expand Up @@ -82,7 +82,14 @@ services:
// deployNode deploys a new Ethereum node container to a remote machine via SSH,
// docker and docker-compose. If an instance with the specified network name
// already exists there, it will be overwritten!
func deployNode(client *sshClient, network string, bootnodes []string, config *nodeInfos, nocache bool) ([]byte, error) {
func deployNode(
client *sshClient,
network string,
bootnodes []string,
config *nodeInfos,
nocache bool,
dockerImage string,
) ([]byte, error) {
kind := "sealnode"
if config.keyJSON == "" && config.etherbase == "" {
kind = "bootnode"
Expand All @@ -98,18 +105,19 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
}
dockerfile := new(bytes.Buffer)
template.Must(template.New("").Parse(nodeDockerfile)).Execute(dockerfile, map[string]interface{}{
"NetworkID": config.network,
"Port": config.port,
"IP": client.address,
"Peers": config.peersTotal,
"LightFlag": lightFlag,
"Bootnodes": strings.Join(bootnodes, ","),
"Ethstats": config.ethstats,
"Etherbase": config.etherbase,
"GasTarget": uint64(1000000 * config.gasTarget),
"GasLimit": uint64(1000000 * config.gasLimit),
"GasPrice": uint64(1000000000 * config.gasPrice),
"Unlock": config.keyJSON != "",
"DockerImage": dockerImage,
"NetworkID": config.network,
"Port": config.port,
"IP": client.address,
"Peers": config.peersTotal,
"LightFlag": lightFlag,
"Bootnodes": strings.Join(bootnodes, ","),
"Ethstats": config.ethstats,
"Etherbase": config.etherbase,
"GasTarget": uint64(1000000 * config.gasTarget),
"GasLimit": uint64(1000000 * config.gasLimit),
"GasPrice": uint64(1000000000 * config.gasPrice),
"Unlock": config.keyJSON != "",
})
files[filepath.Join(workdir, "Dockerfile")] = dockerfile.Bytes()

Expand Down
46 changes: 37 additions & 9 deletions cmd/puppeth/wizard_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ 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. Aura - proof-of-authority")

readSigners := func() (signers []common.Address) {
for {
if address := w.readAddress(); address != nil {
signers = append(signers, *address)
continue
}
if len(signers) > 0 {
break
}
}

return
}

choice := w.read()
switch {
Expand All @@ -83,15 +98,8 @@ func (w *wizard) makeGenesis() {
fmt.Println("Which accounts are allowed to seal? (mandatory at least one)")

var signers []common.Address
for {
if address := w.readAddress(); address != nil {
signers = append(signers, *address)
continue
}
if len(signers) > 0 {
break
}
}
signers = readSigners()

// Sort the signers and embed into the extra-data section
for i := 0; i < len(signers); i++ {
for j := i + 1; j < len(signers); j++ {
Expand All @@ -104,7 +112,27 @@ func (w *wizard) makeGenesis() {
for i, signer := range signers {
copy(genesis.ExtraData[32+i*common.AddressLength:], signer[:])
}
case "3" == choice:
genesis.Difficulty = big.NewInt(1)
genesis.Config.Aura = &params.AuraConfig{
Period: 5,
Epoch: 30000,
}
fmt.Println()
fmt.Println("How many seconds should round take? (default = 5)")
genesis.Config.Aura.Period = uint64(w.readDefaultInt(5))

// We also need the initial list of signers
fmt.Println()
fmt.Println("Which accounts are allowed to seal? (mandatory at least one)")

signers := readSigners()
auraConfig := genesis.Config.Aura
auraConfig.Authorities = make([]common.Address, len(signers))

for i, signer := range signers {
genesis.Config.Aura.Authorities[i] = signer
}
default:
log.Crit("Invalid consensus engine choice", "choice", choice)
}
Expand Down
11 changes: 9 additions & 2 deletions cmd/puppeth/wizard_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ func (w *wizard) deployNode(boot bool) {
fmt.Printf("What address should the miner use? (default = %s)\n", infos.etherbase)
infos.etherbase = w.readDefaultAddress(common.HexToAddress(infos.etherbase)).Hex()
}
} else if w.conf.Genesis.Config.Clique != nil {
}
if w.conf.Genesis.Config.Clique != nil || w.conf.Genesis.Config.Aura != nil {
// If a previous signer was already set, offer to reuse it
if infos.keyJSON != "" {
if key, err := keystore.DecryptKey([]byte(infos.keyJSON), infos.keyPass); err != nil {
Expand Down Expand Up @@ -167,7 +168,13 @@ func (w *wizard) deployNode(boot bool) {
fmt.Printf("Should the node be built from scratch (y/n)? (default = no)\n")
nocache = w.readDefaultYesNo(false)
}
if out, err := deployNode(client, w.network, w.conf.bootnodes, infos, nocache); err != nil {

dockerImage := "ethereum/client-go:latest"
fmt.Println()
fmt.Printf("Please provide geth docker image you would like to use (y/n)? (default = %s)\n", dockerImage)
dockerImage = w.readDefaultString(dockerImage)

if out, err := deployNode(client, w.network, w.conf.bootnodes, infos, nocache, dockerImage); err != nil {
log.Error("Failed to deploy Ethereum node container", "err", err)
if len(out) > 0 {
fmt.Printf("%s\n", out)
Expand Down
26 changes: 25 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package utils
import (
"crypto/ecdsa"
"fmt"
"github.com/ethereum/go-ethereum/consensus/aura"
"io"
"io/ioutil"
"math/big"
Expand Down Expand Up @@ -135,6 +136,10 @@ var (
Name: "goerli",
Usage: "Görli network: pre-configured proof-of-authority test network",
}
LuksoFlag = cli.BoolFlag{
Name: "luksoAura",
Usage: "Lukso aura network: pre-configured proof-of-authority(Aura) test network",
}
YoloV1Flag = cli.BoolFlag{
Name: "yolov1",
Usage: "YOLOv1 network: pre-configured proof-of-authority shortlived test network.",
Expand Down Expand Up @@ -744,6 +749,9 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.GlobalBool(GoerliFlag.Name) {
return filepath.Join(path, "goerli")
}
if ctx.GlobalBool(LuksoFlag.Name) {
return filepath.Join(path, "lukso")
}
if ctx.GlobalBool(YoloV1Flag.Name) {
return filepath.Join(path, "yolo-v1")
}
Expand Down Expand Up @@ -803,6 +811,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.GlobalBool(LuksoFlag.Name):
urls = params.LuksoBootnodes
case ctx.GlobalBool(YoloV1Flag.Name):
urls = params.YoloV1Bootnodes
case cfg.BootstrapNodes != nil:
Expand Down Expand Up @@ -839,6 +849,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.GlobalBool(LuksoFlag.Name):
urls = params.LuksoBootnodes
case ctx.GlobalBool(YoloV1Flag.Name):
urls = params.YoloV1Bootnodes
case cfg.BootstrapNodesV5 != nil:
Expand Down Expand Up @@ -1270,6 +1282,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli")
case ctx.GlobalBool(LuksoFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "lukso")
case ctx.GlobalBool(YoloV1Flag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "yolo-v1")
}
Expand Down Expand Up @@ -1484,7 +1498,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV1Flag)
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, LuksoFlag, YoloV1Flag)
CheckExclusive(ctx, LegacyLightServFlag, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
CheckExclusive(ctx, GCModeFlag, "archive", TxLookupLimitFlag)
Expand Down Expand Up @@ -1604,6 +1618,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
}
cfg.Genesis = core.DefaultGoerliGenesisBlock()
setDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
case ctx.GlobalBool(LuksoFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 5
}
cfg.Genesis = core.DefaultLuksoGenesisBlock()
setDNSDiscoveryDefaults(cfg, params.LuksoGenesisHash)
case ctx.GlobalBool(YoloV1Flag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 133519467574833 // "yolov1"
Expand Down Expand Up @@ -1792,6 +1812,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(GoerliFlag.Name):
genesis = core.DefaultGoerliGenesisBlock()
case ctx.GlobalBool(LuksoFlag.Name):
genesis = core.DefaultLuksoGenesisBlock()
case ctx.GlobalBool(YoloV1Flag.Name):
genesis = core.DefaultYoloV1GenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
Expand All @@ -1811,6 +1833,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readOnly bool) (chain *core.B
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) {
Expand Down
Loading