From e8e428e70689bf6bb7950976aeae3b78481ad459 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 07:52:29 -0500 Subject: [PATCH 01/30] init dev config files --- core/config/dev_morden.json | 117 +++++++++++++++++++++++ core/config/dev_morden_bootnodes.json | 19 ++++ core/config/dev_morden_genesis.json | 13 +++ core/config/dev_morden_genesis_alloc.csv | 5 + core/config/morden_genesis.json | 2 +- 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 core/config/dev_morden.json create mode 100644 core/config/dev_morden_bootnodes.json create mode 100644 core/config/dev_morden_genesis.json create mode 100644 core/config/dev_morden_genesis_alloc.csv diff --git a/core/config/dev_morden.json b/core/config/dev_morden.json new file mode 100644 index 000000000..3226dff3b --- /dev/null +++ b/core/config/dev_morden.json @@ -0,0 +1,117 @@ +{ + "identity": "morden", + "name": "Morden Testnet", + "state": { + "startingNonce": 1048576 + }, + "network": 2, + "consensus": "ethash", + "chainConfig": { + "forks": [ + { + "name": "Homestead", + "block": 494000, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "difficulty", + "options": { + "type": "homestead" + } + }, + { + "id": "gastable", + "options": { + "type": "homestead" + } + } + ] + }, + { + "name": "GasReprice", + "block": 1783000, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "gastable", + "options": { + "type": "eip150" + } + } + ] + }, + { + "name": "The DAO Hard Fork", + "block": 1885000, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [] + }, + { + "name": "Diehard", + "block": 1915000, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "eip155", + "options": { + "chainID": 62 + } + }, + { + "id": "gastable", + "options": { + "type": "eip160" + } + }, + { + "id": "difficulty", + "options": { + "length": 2000000, + "type": "ecip1010" + } + } + ] + }, + { + "name": "Gotham", + "block": 2000000, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "reward", + "options": { + "era": 2000000, + "type": "ecip1017" + } + } + ] + }, + { + "name": "Defuse Difficulty Bomb", + "block": 2300000, + "features": [ + { + "id": "difficulty", + "options": { + "type": "defused" + } + } + ] + } + ], + "badHashes": [ + { + "Block": 383792, + "Hash": "0x9690db54968a760704d99b8118bf79d565711669cefad24b51b5b1013d827808" + }, + { + "Block": 1915277, + "Hash": "0x3bef9997340acebc85b84948d849ceeff74384ddf512a20676d424e972a3c3c4" + } + ] + }, + "include" : [ + "morden_genesis.json", + "morden_bootnodes.json" + ] +} diff --git a/core/config/dev_morden_bootnodes.json b/core/config/dev_morden_bootnodes.json new file mode 100644 index 000000000..0a5a9b1de --- /dev/null +++ b/core/config/dev_morden_bootnodes.json @@ -0,0 +1,19 @@ +{ + "bootstrap": [ + "enode://1fac84e8fe252d63764563f4f526323393b52aaaf832693f7a8a1637f6920311d7d04a7cb91945273e6c644d5c3b01a6bf8a172ae653c918e1bf8eb79e7e6baf@94.152.212.32:40404", + "enode://21101a9597b79e933e17bc94ef3506fe99a137808907aa8fefa67eea4b789792ad11fb391f38b00087f8800a2d3dff011572b62a31232133dd1591ac2d1502c8@104.198.71.200:30403", + "enode://30a1fd71f28aa6f66fe662af9ecc75f0a6980f06b71598f2b19d3dda04223fc0e53b47e40c9171d5014e9f5b59d9954de125782da592f5d95ea39066e2591d5d@104.237.131.102:30304", + "enode://3666177e0e2e56bebaef318c8ba4aed3d05ce788df1eb0e48b79fce40fcf3445feb4ccc4ce2fd4aadc3c146858e276bdef1cb63437215f17e6e5dd8c41403427@144.202.23.122:30303", + "enode://3666177e0e2e56bebaef318c8ba4aed3d05ce788df1eb0e48b79fce40fcf3445feb4ccc4ce2fd4aadc3c146858e276bdef1cb63437215f17e6e5dd8c41403427@45.76.16.230:30303", + "enode://78d8897b376e549c2b47664e4c81fd023b089d0a417275731760739b7f98dd639d632bb7b75e92606c7d6abbbe96f69f06d85e0a41a143f1f0a3c55ff2b1d732@144.202.101.214:30303", + "enode://7909d51011d8a153351169f21d3a7bbedb3be1e17d38c1f2fad06504dd5aa07a00f00845835d535fe702bf379c4d7209a51f4d1b723e0ca8b8732bd21fba3b30@139.162.133.42:30303", + "enode://a088dfb2f5305be9232e8071c5535f13718a4017e247a0b35074b807d43d99e022880c27302cdb5b1e98ad34c083dbbb483f2b17bdc66149bad037154d6ace96@139.162.127.72:30303", + "enode://a329e2399e6d72009690faa15a82ae13ef2015bc5e72ffb22f92ea83cf3bfc9ce45d43c38b3c2289c148939d3911e9d1a9e940f41698dba54508b59489072b2a@5.135.157.4:30303", + "enode://afdc6076b9bf3e7d3d01442d6841071e84c76c73a7016cb4f35c0437df219db38565766234448f1592a07ba5295a867f0ce87b359bf50311ed0b830a2361392d@104.154.136.117:30403", + "enode://d79b12fc48a494ba7053bbc30cbe510060ebb3a2ce9bb4f88076303e97e31e2af263c61e797af0af20419b7268b2bfb2d2f196b57242a454035ecb6001cc69a2@94.23.49.75:30303", + "enode://f4a1805a51cfdf5afdddf0b43b8d4b687657497311797464046dce65388b9e5a538b55bdb23ae4eac54485a81d47adad48731294efc9d73fbc9f297f625aec70@198.27.80.32:30303", + "enode://f570df80b5589dfb0a7657adb62b93dc55e76d491694d8965c6382964e6f397ae0b8c3548ef0a108151f3b1485c75769ff203df2db7ace385ee98fdb2766ba3b@86.8.233.254:30303", + "enode://fb28713820e718066a2f5df6250ae9d07cff22f672dbf26be6c75d088f821a9ad230138ba492c533a80407d054b1436ef18e951bb65e6901553516c8dffe8ff0@104.155.176.151:30304", + "enode://fd008499e9c4662f384b3cff23438879d31ced24e2d19504c6389bc6da6c882f9c2f8dbed972f7058d7650337f54e4ba17bb49c7d11882dd1731d26a6e62e3cb@35.187.57.94:30304" + ] +} diff --git a/core/config/dev_morden_genesis.json b/core/config/dev_morden_genesis.json new file mode 100644 index 000000000..70af7ca08 --- /dev/null +++ b/core/config/dev_morden_genesis.json @@ -0,0 +1,13 @@ +{ + "genesis": { + "nonce": "0x00006d6f7264656e", + "timestamp": "", + "parentHash": "", + "extraData": "", + "gasLimit": "0x2FEFD8", + "difficulty": "0x020000", + "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", + "coinbase": "", + "alloc_file": "morden_genesis_alloc.csv" + } +} diff --git a/core/config/dev_morden_genesis_alloc.csv b/core/config/dev_morden_genesis_alloc.csv new file mode 100644 index 000000000..174d288e0 --- /dev/null +++ b/core/config/dev_morden_genesis_alloc.csv @@ -0,0 +1,5 @@ +"0000000000000000000000000000000000000001","1" +"0000000000000000000000000000000000000002","1" +"0000000000000000000000000000000000000003","1" +"0000000000000000000000000000000000000004","1" +"102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c","1606938044258990275541962092341162602522202993782792835301376" diff --git a/core/config/morden_genesis.json b/core/config/morden_genesis.json index f937d0b8c..70af7ca08 100644 --- a/core/config/morden_genesis.json +++ b/core/config/morden_genesis.json @@ -8,6 +8,6 @@ "difficulty": "0x020000", "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", "coinbase": "", - "alloc_file": "morden_genesis_alloc.csv" + "alloc_file": "morden_genesis_alloc.csv" } } From 3f98091656a3b7815990aa378ce8ffc3a321ba98 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 07:55:13 -0500 Subject: [PATCH 02/30] Fork blocks -> 0, set dev_ file names in config files --- core/config/dev_morden.json | 32 +++++++++--------------- core/config/dev_morden_bootnodes.json | 15 ----------- core/config/dev_morden_genesis.json | 2 +- core/config/dev_morden_genesis_alloc.csv | 5 ---- 4 files changed, 13 insertions(+), 41 deletions(-) diff --git a/core/config/dev_morden.json b/core/config/dev_morden.json index 3226dff3b..5b1fac163 100644 --- a/core/config/dev_morden.json +++ b/core/config/dev_morden.json @@ -1,16 +1,16 @@ { - "identity": "morden", - "name": "Morden Testnet", + "identity": "EZDEV", + "name": "EZDEV Client", "state": { "startingNonce": 1048576 }, - "network": 2, - "consensus": "ethash", + "network": 69, + "consensus": "ethash-test", "chainConfig": { "forks": [ { "name": "Homestead", - "block": 494000, + "block": 0, "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "features": [ { @@ -29,7 +29,7 @@ }, { "name": "GasReprice", - "block": 1783000, + "block": 0, "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "features": [ { @@ -42,13 +42,13 @@ }, { "name": "The DAO Hard Fork", - "block": 1885000, + "block": 0, "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "features": [] }, { "name": "Diehard", - "block": 1915000, + "block": 0, "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "features": [ { @@ -74,7 +74,7 @@ }, { "name": "Gotham", - "block": 2000000, + "block": 0, "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "features": [ { @@ -88,7 +88,7 @@ }, { "name": "Defuse Difficulty Bomb", - "block": 2300000, + "block": 0, "features": [ { "id": "difficulty", @@ -100,18 +100,10 @@ } ], "badHashes": [ - { - "Block": 383792, - "Hash": "0x9690db54968a760704d99b8118bf79d565711669cefad24b51b5b1013d827808" - }, - { - "Block": 1915277, - "Hash": "0x3bef9997340acebc85b84948d849ceeff74384ddf512a20676d424e972a3c3c4" - } ] }, "include" : [ - "morden_genesis.json", - "morden_bootnodes.json" + "dev_genesis.json", + "dev_bootnodes.json" ] } diff --git a/core/config/dev_morden_bootnodes.json b/core/config/dev_morden_bootnodes.json index 0a5a9b1de..ad24da1ba 100644 --- a/core/config/dev_morden_bootnodes.json +++ b/core/config/dev_morden_bootnodes.json @@ -1,19 +1,4 @@ { "bootstrap": [ - "enode://1fac84e8fe252d63764563f4f526323393b52aaaf832693f7a8a1637f6920311d7d04a7cb91945273e6c644d5c3b01a6bf8a172ae653c918e1bf8eb79e7e6baf@94.152.212.32:40404", - "enode://21101a9597b79e933e17bc94ef3506fe99a137808907aa8fefa67eea4b789792ad11fb391f38b00087f8800a2d3dff011572b62a31232133dd1591ac2d1502c8@104.198.71.200:30403", - "enode://30a1fd71f28aa6f66fe662af9ecc75f0a6980f06b71598f2b19d3dda04223fc0e53b47e40c9171d5014e9f5b59d9954de125782da592f5d95ea39066e2591d5d@104.237.131.102:30304", - "enode://3666177e0e2e56bebaef318c8ba4aed3d05ce788df1eb0e48b79fce40fcf3445feb4ccc4ce2fd4aadc3c146858e276bdef1cb63437215f17e6e5dd8c41403427@144.202.23.122:30303", - "enode://3666177e0e2e56bebaef318c8ba4aed3d05ce788df1eb0e48b79fce40fcf3445feb4ccc4ce2fd4aadc3c146858e276bdef1cb63437215f17e6e5dd8c41403427@45.76.16.230:30303", - "enode://78d8897b376e549c2b47664e4c81fd023b089d0a417275731760739b7f98dd639d632bb7b75e92606c7d6abbbe96f69f06d85e0a41a143f1f0a3c55ff2b1d732@144.202.101.214:30303", - "enode://7909d51011d8a153351169f21d3a7bbedb3be1e17d38c1f2fad06504dd5aa07a00f00845835d535fe702bf379c4d7209a51f4d1b723e0ca8b8732bd21fba3b30@139.162.133.42:30303", - "enode://a088dfb2f5305be9232e8071c5535f13718a4017e247a0b35074b807d43d99e022880c27302cdb5b1e98ad34c083dbbb483f2b17bdc66149bad037154d6ace96@139.162.127.72:30303", - "enode://a329e2399e6d72009690faa15a82ae13ef2015bc5e72ffb22f92ea83cf3bfc9ce45d43c38b3c2289c148939d3911e9d1a9e940f41698dba54508b59489072b2a@5.135.157.4:30303", - "enode://afdc6076b9bf3e7d3d01442d6841071e84c76c73a7016cb4f35c0437df219db38565766234448f1592a07ba5295a867f0ce87b359bf50311ed0b830a2361392d@104.154.136.117:30403", - "enode://d79b12fc48a494ba7053bbc30cbe510060ebb3a2ce9bb4f88076303e97e31e2af263c61e797af0af20419b7268b2bfb2d2f196b57242a454035ecb6001cc69a2@94.23.49.75:30303", - "enode://f4a1805a51cfdf5afdddf0b43b8d4b687657497311797464046dce65388b9e5a538b55bdb23ae4eac54485a81d47adad48731294efc9d73fbc9f297f625aec70@198.27.80.32:30303", - "enode://f570df80b5589dfb0a7657adb62b93dc55e76d491694d8965c6382964e6f397ae0b8c3548ef0a108151f3b1485c75769ff203df2db7ace385ee98fdb2766ba3b@86.8.233.254:30303", - "enode://fb28713820e718066a2f5df6250ae9d07cff22f672dbf26be6c75d088f821a9ad230138ba492c533a80407d054b1436ef18e951bb65e6901553516c8dffe8ff0@104.155.176.151:30304", - "enode://fd008499e9c4662f384b3cff23438879d31ced24e2d19504c6389bc6da6c882f9c2f8dbed972f7058d7650337f54e4ba17bb49c7d11882dd1731d26a6e62e3cb@35.187.57.94:30304" ] } diff --git a/core/config/dev_morden_genesis.json b/core/config/dev_morden_genesis.json index 70af7ca08..87a2b816f 100644 --- a/core/config/dev_morden_genesis.json +++ b/core/config/dev_morden_genesis.json @@ -8,6 +8,6 @@ "difficulty": "0x020000", "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", "coinbase": "", - "alloc_file": "morden_genesis_alloc.csv" + "alloc_file": "dev_genesis_alloc.csv" } } diff --git a/core/config/dev_morden_genesis_alloc.csv b/core/config/dev_morden_genesis_alloc.csv index 174d288e0..e69de29bb 100644 --- a/core/config/dev_morden_genesis_alloc.csv +++ b/core/config/dev_morden_genesis_alloc.csv @@ -1,5 +0,0 @@ -"0000000000000000000000000000000000000001","1" -"0000000000000000000000000000000000000002","1" -"0000000000000000000000000000000000000003","1" -"0000000000000000000000000000000000000004","1" -"102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c","1606938044258990275541962092341162602522202993782792835301376" From 5646f08bd98d825d55761209dfc0989ecda32a49 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 10:56:08 -0500 Subject: [PATCH 03/30] init basic feature functionality --- cmd/geth/cmd.go | 9 +- cmd/geth/ezdev.go | 85 +++ cmd/geth/flag.go | 30 +- cmd/geth/flags.go | 4 + cmd/geth/log_context.go | 5 +- cmd/geth/main.go | 58 +- core/assets/assets.go | 664 +++++++++++++++++- core/config/dev.json | 109 +++ ...rden_bootnodes.json => dev_bootnodes.json} | 0 ...v_morden_genesis.json => dev_genesis.json} | 0 ...enesis_alloc.csv => dev_genesis_alloc.csv} | 0 core/defaults.go | 5 + eth/backend.go | 4 +- 13 files changed, 935 insertions(+), 38 deletions(-) create mode 100644 cmd/geth/ezdev.go create mode 100644 core/config/dev.json rename core/config/{dev_morden_bootnodes.json => dev_bootnodes.json} (100%) rename core/config/{dev_morden_genesis.json => dev_genesis.json} (100%) rename core/config/{dev_morden_genesis_alloc.csv => dev_genesis_alloc.csv} (100%) diff --git a/cmd/geth/cmd.go b/cmd/geth/cmd.go index a980b5a79..1e15db64d 100644 --- a/cmd/geth/cmd.go +++ b/cmd/geth/cmd.go @@ -31,6 +31,8 @@ import ( "syscall" "time" + "math" + "github.com/ethereumproject/ethash" "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core" @@ -44,7 +46,6 @@ import ( "github.com/ethereumproject/go-ethereum/pow" "github.com/ethereumproject/go-ethereum/rlp" "gopkg.in/urfave/cli.v1" - "math" ) const ( @@ -637,7 +638,7 @@ func rollback(ctx *cli.Context) error { func dumpChainConfig(ctx *cli.Context) error { chainIdentity := mustMakeChainIdentity(ctx) - if !(core.ChainIdentitiesMain[chainIdentity] || core.ChainIdentitiesMorden[chainIdentity]) { + if !(core.ChainIdentitiesMain[chainIdentity] || core.ChainIdentitiesMorden[chainIdentity] || chainIdentity == "ezdev") { glog.Fatal("Dump config should only be used with default chain configurations (mainnet or morden).") } @@ -696,6 +697,10 @@ func dumpChainConfig(ctx *cli.Context) error { Bootstrap: nodes, } + if ctx.GlobalBool(EZDevModeFlag.Name) { + currentConfig = core.DefaultConfigEZDev + } + if writeError := currentConfig.WriteToJSONFile(chainConfigFilePath); writeError != nil { glog.Fatalf("An error occurred while writing chain configuration: %v", writeError) return writeError diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go new file mode 100644 index 000000000..5ea6d95b8 --- /dev/null +++ b/cmd/geth/ezdev.go @@ -0,0 +1,85 @@ +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "math" + "math/big" + "os" + "path/filepath" + + "github.com/ethereumproject/go-ethereum/core" + "github.com/ethereumproject/go-ethereum/logger" + "github.com/ethereumproject/go-ethereum/logger/glog" + "gopkg.in/urfave/cli.v1" +) + +func setCTXDefault(ctx *cli.Context, name, val string) { + if !ctx.GlobalIsSet(aliasableName(name, ctx)) { + ctx.GlobalSet(name, val) + } +} + +func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { + glog.Errorln("Initializing EZDEV...") + + // set flag config defaults + // copy dev.json, dev_genesis.json, dev_genesis_allow.csv to datadir/ezdev/{ chain, dev_genesis, dev_genesis_alloc }.json/csv, + // init 10 accounts with password 'foo' + // add these accounts to genesis alloc csv + setCTXDefault(ctx, NoDiscoverFlag.Name, "true") + setCTXDefault(ctx, LightKDFFlag.Name, "true") + + cc := core.DefaultConfigEZDev + cc.Include = []string{"dev_genesis.json"} + + cg := cc.Genesis + cc.Genesis = nil + + cg.AllocFile = "dev_genesis_alloc.csv" + + // marshal and write config json + if err := cc.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { + return err + } + // marshal and write dev_genesis.json + genC, err := json.MarshalIndent(struct { + Genesis *core.GenesisDump `json:"genesis"` + }{cg}, "", " ") + if err != nil { + return fmt.Errorf("Could not marshal json from chain config: %v", err) + } + if err := ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis.json"), genC, 0644); err != nil { + return err + } + + // make some accounts + accman := MakeAccountManager(ctx) + data := []byte{} + bal := big.NewInt(math.MaxInt16).String() + if len(accman.Accounts()) == 0 { + glog.D(logger.Warn).Infoln("No existing EZDEV accounts found, creating 10") + password := "foo" + // accounts := []accounts.Account{} + for i := 0; i < 10; i++ { + acc, err := accman.NewAccount(password) + if err != nil { + return err + } + // accounts = append(accounts, acc) + d := fmt.Sprintf("%s,%v\n", acc.Address.Hex(), bal) + glog.D(logger.Warn).Infoln(acc.Address.Hex(), acc.File) + data = append(data, []byte(d)...) + } + } else { + glog.D(logger.Warn).Infoln("Found existing keyfiles, using: ") + for _, acc := range accman.Accounts() { + d := fmt.Sprintf("%s,%v\n", acc.Address.Hex(), bal) + glog.D(logger.Warn).Infoln(acc.Address.Hex(), acc.File) + data = append(data, []byte(d)...) + } + } + ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis_alloc.csv"), data, os.ModePerm) + return nil +} diff --git a/cmd/geth/flag.go b/cmd/geth/flag.go index d8dfc4e2e..e0c1dee9c 100644 --- a/cmd/geth/flag.go +++ b/cmd/geth/flag.go @@ -130,6 +130,8 @@ func copyChainConfigFileToChainDataDir(ctx *cli.Context, identity, configFilePat return nil } +// var localChainId string + // getChainIdentity parses --chain and --testnet (legacy) flags. // It will fatal if finds notok value. // It returns one of valid strings: ["mainnet", "morden", or --chain="flaggedCustom"] @@ -137,7 +139,9 @@ func mustMakeChainIdentity(ctx *cli.Context) (identity string) { if id := core.GetCacheChainIdentity(); id != "" { return id - } + } // else if localChainId != "" { + // return localChainId + // } if ctx.GlobalIsSet(aliasableName(TestNetFlag.Name, ctx)) && ctx.GlobalIsSet(aliasableName(ChainIdentityFlag.Name, ctx)) { glog.Fatalf(`%v: used redundant/conflicting flags: --%v, --%v @@ -146,6 +150,8 @@ func mustMakeChainIdentity(ctx *cli.Context) (identity string) { } defer func() { + glog.Error("chain set identity", identity) + // localChainId = identity core.SetCacheChainIdentity(identity) }() @@ -197,6 +203,9 @@ func mustMakeChainIdentity(ctx *cli.Context) (identity string) { } // glog.V(logger.Debug).Infof("No existing file at --%v: '%v'. Using literal chain identity.", aliasableName(ChainIdentityFlag.Name, ctx), chainFlagVal) identity = chainFlagVal + + glog.Error("parse chain identity", identity) + return identity } else if ctx.GlobalIsSet(aliasableName(ChainIdentityFlag.Name, ctx)) { glog.Fatalf("%v: %v: chainID empty", ErrInvalidFlag, core.ErrInvalidChainID) @@ -249,6 +258,7 @@ func MustMakeChainDataDir(ctx *cli.Context) string { } rp = af } + glog.Error("chain data dir", rp) return rp } @@ -483,6 +493,17 @@ func MakeSystemNode(version string, ctx *cli.Context) *node.Node { config := mustMakeSufficientChainConfig(ctx) logChainConfiguration(ctx, config) + // if reflect.DeepEqual(core.DefaultConfigEZDev, config) { + // if err := setupEZDev(ctx, config); err != nil { + // log.Fatal(err) + // } + // } + if ctx.GlobalBool(EZDevModeFlag.Name) { + if err := setupEZDev(ctx, config); err != nil { + log.Fatal(err) + } + } + // Configure the Ethereum service ethConf := mustMakeEthConf(ctx, config) @@ -691,6 +712,13 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig state.StartingNonce = state.DefaultTestnetStartingNonce // (2**20) } return config + } else if ctx.GlobalBool(EZDevModeFlag.Name) { + glog.Errorln("setting EZDEV suffconf...") + c := core.DefaultConfigEZDev + if c.State != nil { + state.StartingNonce = c.State.StartingNonce + } + return c } // Returns surely valid suff chain config. diff --git a/cmd/geth/flags.go b/cmd/geth/flags.go index f71bb5749..e18974fb6 100644 --- a/cmd/geth/flags.go +++ b/cmd/geth/flags.go @@ -66,6 +66,10 @@ var ( Name: "dev", Usage: "Developer mode: pre-configured private network with several debugging flags", } + EZDevModeFlag = cli.BoolFlag{ + Name: "ezdev", + Usage: "EZ Developer mode: pre-configured private network, automining, default accounts", + } NodeNameFlag = cli.StringFlag{ Name: "identity,name", Usage: "Custom node name", diff --git a/cmd/geth/log_context.go b/cmd/geth/log_context.go index dd4e382f6..5a4fcb96b 100644 --- a/cmd/geth/log_context.go +++ b/cmd/geth/log_context.go @@ -12,10 +12,11 @@ import ( "os" "path/filepath" + "net" + "github.com/ethereumproject/go-ethereum/logger" "github.com/ethereumproject/go-ethereum/logger/glog" "github.com/ethereumproject/go-ethereum/p2p/discover" - "net" ) const defaultStatusLog = "sync=60s" @@ -54,7 +55,7 @@ func setupLogging(ctx *cli.Context) error { glog.SetToStderr(true) } } else { - logDir = filepath.Join(MustMakeChainDataDir(ctx), glog.DefaultLogDirName) + logDir = filepath.Join(mustMakeDataDir(ctx), mustMakeChainIdentity(ctx), glog.DefaultLogDirName) } // Allow to-file logging to be disabled diff --git a/cmd/geth/main.go b/cmd/geth/main.go index cbc50482d..e70f8790f 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -189,6 +189,7 @@ func makeCLIApp() (app *cli.App) { PreloadJSFlag, WhisperEnabledFlag, DevModeFlag, + EZDevModeFlag, TestNetFlag, NetworkIdFlag, RPCCORSDomainFlag, @@ -263,21 +264,6 @@ func makeCLIApp() (app *cli.App) { if err := handleIfDataDirSchemaMigrations(ctx); err != nil { return err } - - if err := setupLogRotation(ctx); err != nil { - return err - } - - // Handle parsing and applying log verbosity, severities, and default configurations from context. - if err := setupLogging(ctx); err != nil { - return err - } - - // Handle parsing and applying log rotation configs from context. - if err := setupLogRotation(ctx); err != nil { - return err - } - if s := ctx.String("metrics"); s != "" { go metrics.CollectToFile(s) } @@ -292,10 +278,50 @@ func makeCLIApp() (app *cli.App) { // Set morden chain by default for dev mode. if ctx.GlobalBool(aliasableName(DevModeFlag.Name, ctx)) { if !ctx.GlobalIsSet(aliasableName(ChainIdentityFlag.Name, ctx)) { - if e := ctx.Set(aliasableName(ChainIdentityFlag.Name, ctx), "morden"); e != nil { + if e := ctx.GlobalSet(ChainIdentityFlag.Name, "morden"); e != nil { return fmt.Errorf("failed to set chain value: %v", e) + } else { + core.SetCacheChainIdentity("morden") + } + } + + // if mustMakeChainIdentity(ctx) != "morden" { + // log.Fatal("--dev not morden") + // } + } + + if ctx.GlobalBool(aliasableName(EZDevModeFlag.Name, ctx)) { + log.Println("setting ezdev...") + setCTXDefault := func(ctx *cli.Context, name, val string) { + if !ctx.GlobalIsSet(aliasableName(name, ctx)) { + if err := ctx.GlobalSet(name, val); err != nil { + log.Fatal(err) + } + if err := ctx.Set(name, val); err != nil { + log.Fatal(err) + } } } + setCTXDefault(ctx, ChainIdentityFlag.Name, "ezdev") + if ctx.GlobalString(ChainIdentityFlag.Name) != "ezdev" { + log.Fatal("ez != ez") + } + if ctx.String(ChainIdentityFlag.Name) != "ezdev" { + log.Fatal("ez != ez ng") + } + // This is what's really doing work here. The ctx package is either very weird or buggy, and + // values that I expect to be set are not actually, sometimes. + core.SetCacheChainIdentity("ezdev") + } + + // Handle parsing and applying log verbosity, severities, and default configurations from context. + if err := setupLogging(ctx); err != nil { + return err + } + + // Handle parsing and applying log rotation configs from context. + if err := setupLogRotation(ctx); err != nil { + return err } if port := ctx.GlobalInt(PprofFlag.Name); port != 0 { diff --git a/core/assets/assets.go b/core/assets/assets.go index 062823155..71322b68b 100644 --- a/core/assets/assets.go +++ b/core/assets/assets.go @@ -137,7 +137,641 @@ var DEFAULTS *FileSystem func init() { DEFAULTS = &FileSystem{ files: map[string]File{ - "/core/config/mainnet.json": File{ + "/core/config/dev.json": File{ + data: []byte{ + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x65, 0x7a, 0x64, 0x65, 0x76, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x45, 0x5a, 0x44, 0x45, 0x56, 0x20, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x20, 0x31, + 0x38, 0x31, 0x38, 0x31, 0x38, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x22, 0x3a, 0x20, 0x36, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x22, 0x3a, + 0x20, 0x22, 0x65, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2d, 0x74, 0x65, 0x73, + 0x74, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x3a, 0x20, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x6f, + 0x72, 0x6b, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x48, + 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x22, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, + 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, + 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, + 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x68, + 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x22, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, + 0x22, 0x3a, 0x20, 0x22, 0x67, 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, + 0x61, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x47, 0x61, 0x73, 0x52, 0x65, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x67, 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x3a, 0x20, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x22, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x54, + 0x68, 0x65, 0x20, 0x44, 0x41, 0x4f, 0x20, 0x48, 0x61, 0x72, 0x64, 0x20, + 0x46, 0x6f, 0x72, 0x6b, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x5d, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x65, 0x68, 0x61, 0x72, + 0x64, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, 0x73, + 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, + 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x22, + 0x3a, 0x20, 0x36, 0x32, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x67, + 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x65, 0x69, 0x70, 0x31, 0x36, 0x30, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x22, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x65, 0x63, 0x69, 0x70, 0x31, 0x30, 0x31, 0x30, + 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, + 0x20, 0x22, 0x47, 0x6f, 0x74, 0x68, 0x61, 0x6d, 0x22, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, + 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, + 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, + 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, + 0x72, 0x61, 0x22, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x3a, 0x20, 0x22, 0x65, 0x63, 0x69, 0x70, 0x31, 0x30, 0x31, 0x37, 0x22, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, + 0x22, 0x44, 0x65, 0x66, 0x75, 0x73, 0x65, 0x20, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x20, 0x42, 0x6f, 0x6d, 0x62, 0x22, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x65, 0x66, 0x75, + 0x73, 0x65, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x61, 0x64, + 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x2c, 0x0a, 0x09, 0x22, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x22, 0x20, 0x3a, 0x20, 0x5b, 0x0a, 0x09, 0x09, 0x22, 0x64, 0x65, + 0x76, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x64, 0x65, 0x76, 0x5f, + 0x62, 0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a, + }, + fi: FileInfo{ + name: "dev.json", + size: 3333, + modTime: time.Unix(0, 1542806932597996283), + isDir: false, + }, + }, "/core/config/dev_bootnodes.json": File{ + data: []byte{ + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6f, 0x6f, 0x74, 0x73, + 0x74, 0x72, 0x61, 0x70, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x5d, 0x0a, 0x7d, 0x0a, + }, + fi: FileInfo{ + name: "dev_bootnodes.json", + size: 29, + modTime: time.Unix(0, 1542804869874439286), + isDir: false, + }, + }, "/core/config/dev_genesis.json": File{ + data: []byte{ + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x20, + 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x36, 0x64, 0x36, 0x66, 0x37, + 0x32, 0x36, 0x34, 0x36, 0x35, 0x36, 0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x78, + 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x20, 0x22, 0x22, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x67, + 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x30, + 0x78, 0x32, 0x46, 0x45, 0x46, 0x44, 0x38, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, + 0x32, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x69, 0x78, 0x68, 0x61, 0x73, 0x68, + 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x34, 0x37, 0x35, + 0x37, 0x32, 0x36, 0x31, 0x36, 0x63, 0x36, 0x35, 0x37, 0x38, 0x37, 0x33, + 0x36, 0x35, 0x36, 0x34, 0x36, 0x63, 0x36, 0x35, 0x37, 0x38, 0x22, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x61, 0x6c, + 0x6c, 0x6f, 0x63, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x64, 0x65, 0x76, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, + 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x2e, 0x63, 0x73, 0x76, 0x22, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x7d, 0x0a, + }, + fi: FileInfo{ + name: "dev_genesis.json", + size: 367, + modTime: time.Unix(0, 1542804879163228409), + isDir: false, + }, + }, "/core/config/dev_genesis_alloc.csv": File{ + data: []byte{}, + fi: FileInfo{ + name: "dev_genesis_alloc.csv", + size: 0, + modTime: time.Unix(0, 1542804884724147473), + isDir: false, + }, + }, "/core/config/dev_morden.json": File{ + data: []byte{ + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x45, 0x5a, 0x44, 0x45, 0x56, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x45, 0x5a, 0x44, 0x45, 0x56, 0x20, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x20, 0x31, + 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x22, 0x3a, 0x20, 0x36, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x22, + 0x3a, 0x20, 0x22, 0x65, 0x74, 0x68, 0x61, 0x73, 0x68, 0x2d, 0x74, 0x65, + 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x3a, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, + 0x6f, 0x72, 0x6b, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x48, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x22, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, + 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, + 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, + 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x22, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, + 0x64, 0x22, 0x3a, 0x20, 0x22, 0x67, 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, + 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, + 0x65, 0x61, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x47, 0x61, 0x73, 0x52, 0x65, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, + 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, + 0x3a, 0x20, 0x22, 0x67, 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x22, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x54, 0x68, 0x65, 0x20, 0x44, 0x41, 0x4f, 0x20, 0x48, 0x61, 0x72, 0x64, + 0x20, 0x46, 0x6f, 0x72, 0x6b, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x5d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x65, 0x68, 0x61, + 0x72, 0x64, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x22, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x3a, 0x20, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, + 0x20, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x22, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, + 0x22, 0x3a, 0x20, 0x36, 0x32, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, + 0x67, 0x61, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, + 0x22, 0x65, 0x69, 0x70, 0x31, 0x36, 0x30, 0x22, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, + 0x3a, 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x22, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x65, 0x63, 0x69, 0x70, 0x31, 0x30, 0x31, + 0x30, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x3a, 0x20, 0x22, 0x47, 0x6f, 0x74, 0x68, 0x61, 0x6d, 0x22, 0x2c, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, + 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x20, + 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, + 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x22, 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x65, 0x72, 0x61, 0x22, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x65, 0x63, 0x69, 0x70, 0x31, 0x30, 0x31, 0x37, + 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, + 0x20, 0x22, 0x44, 0x65, 0x66, 0x75, 0x73, 0x65, 0x20, 0x44, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x20, 0x42, 0x6f, 0x6d, 0x62, + 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x22, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x69, 0x64, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x65, 0x66, + 0x75, 0x73, 0x65, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x62, 0x61, + 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x09, 0x22, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x22, 0x20, 0x3a, 0x20, 0x5b, 0x0a, 0x09, 0x09, 0x22, 0x64, + 0x65, 0x76, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x64, 0x65, 0x76, + 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x22, 0x0a, 0x09, 0x5d, 0x0a, 0x7d, 0x0a, + }, + fi: FileInfo{ + name: "dev_morden.json", + size: 3334, + modTime: time.Unix(0, 1542804976294380277), + isDir: false, + }, + }, "/core/config/mainnet.json": File{ data: []byte{ 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x22, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x6e, @@ -435,7 +1069,7 @@ func init() { fi: FileInfo{ name: "mainnet.json", size: 3503, - modTime: time.Unix(0, 1525956628000000000), + modTime: time.Unix(0, 1542628808031091302), isDir: false, }, }, "/core/config/mainnet_bootnodes.json": File{ @@ -587,7 +1221,7 @@ func init() { fi: FileInfo{ name: "mainnet_bootnodes.json", size: 1715, - modTime: time.Unix(0, 1525956628000000000), + modTime: time.Unix(0, 1542628808031091302), isDir: false, }, }, "/core/config/mainnet_genesis.json": File{ @@ -623,7 +1257,7 @@ func init() { fi: FileInfo{ name: "mainnet_genesis.json", size: 313, - modTime: time.Unix(0, 1527228759000000000), + modTime: time.Unix(0, 1542628808031091302), isDir: false, }, }, "/core/config/mainnet_genesis_alloc.csv": File{ @@ -50741,7 +51375,7 @@ func init() { fi: FileInfo{ name: "mainnet_genesis_alloc.csv", size: 601300, - modTime: time.Unix(0, 1525956628000000000), + modTime: time.Unix(0, 1542628808035091339), isDir: false, }, }, "/core/config/morden.json": File{ @@ -51057,7 +51691,7 @@ func init() { fi: FileInfo{ name: "morden.json", size: 3682, - modTime: time.Unix(0, 1525956628000000000), + modTime: time.Unix(0, 1542804509848743892), isDir: false, }, }, "/core/config/morden_bootnodes.json": File{ @@ -51279,7 +51913,7 @@ func init() { fi: FileInfo{ name: "morden_bootnodes.json", size: 2552, - modTime: time.Unix(0, 1527231057000000000), + modTime: time.Unix(0, 1542628808035091339), isDir: false, }, }, "/core/config/morden_genesis.json": File{ @@ -51310,16 +51944,16 @@ func init() { 0x36, 0x35, 0x36, 0x34, 0x36, 0x63, 0x36, 0x35, 0x37, 0x38, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x22, 0x2c, - 0x0a, 0x09, 0x09, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e, - 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x61, 0x6c, 0x6c, - 0x6f, 0x63, 0x2e, 0x63, 0x73, 0x76, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x7d, 0x0a, 0x7d, 0x0a, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x61, 0x6c, + 0x6c, 0x6f, 0x63, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x3a, 0x20, 0x22, + 0x6d, 0x6f, 0x72, 0x64, 0x65, 0x6e, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x2e, 0x63, 0x73, 0x76, + 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x7d, 0x0a, }, fi: FileInfo{ name: "morden_genesis.json", - size: 364, - modTime: time.Unix(0, 1525956628000000000), + size: 370, + modTime: time.Unix(0, 1542804654704999359), isDir: false, }, }, "/core/config/morden_genesis_alloc.csv": File{ @@ -51353,7 +51987,7 @@ func init() { fi: FileInfo{ name: "morden_genesis_alloc.csv", size: 295, - modTime: time.Unix(0, 1525956628000000000), + modTime: time.Unix(0, 1542628808035091339), isDir: false, }, }, diff --git a/core/config/dev.json b/core/config/dev.json new file mode 100644 index 000000000..f6b56967d --- /dev/null +++ b/core/config/dev.json @@ -0,0 +1,109 @@ +{ + "identity": "ezdev", + "name": "EZDEV Client", + "state": { + "startingNonce": 181818 + }, + "network": 69, + "consensus": "ethash-test", + "chainConfig": { + "forks": [ + { + "name": "Homestead", + "block": 0, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "difficulty", + "options": { + "type": "homestead" + } + }, + { + "id": "gastable", + "options": { + "type": "homestead" + } + } + ] + }, + { + "name": "GasReprice", + "block": 0, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "gastable", + "options": { + "type": "eip150" + } + } + ] + }, + { + "name": "The DAO Hard Fork", + "block": 0, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [] + }, + { + "name": "Diehard", + "block": 0, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "eip155", + "options": { + "chainID": 62 + } + }, + { + "id": "gastable", + "options": { + "type": "eip160" + } + }, + { + "id": "difficulty", + "options": { + "length": 2000000, + "type": "ecip1010" + } + } + ] + }, + { + "name": "Gotham", + "block": 0, + "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "features": [ + { + "id": "reward", + "options": { + "era": 2000000, + "type": "ecip1017" + } + } + ] + }, + { + "name": "Defuse Difficulty Bomb", + "block": 0, + "features": [ + { + "id": "difficulty", + "options": { + "type": "defused" + } + } + ] + } + ], + "badHashes": [ + ] + }, + "include" : [ + "dev_genesis.json", + "dev_bootnodes.json" + ] +} diff --git a/core/config/dev_morden_bootnodes.json b/core/config/dev_bootnodes.json similarity index 100% rename from core/config/dev_morden_bootnodes.json rename to core/config/dev_bootnodes.json diff --git a/core/config/dev_morden_genesis.json b/core/config/dev_genesis.json similarity index 100% rename from core/config/dev_morden_genesis.json rename to core/config/dev_genesis.json diff --git a/core/config/dev_morden_genesis_alloc.csv b/core/config/dev_genesis_alloc.csv similarity index 100% rename from core/config/dev_morden_genesis_alloc.csv rename to core/config/dev_genesis_alloc.csv diff --git a/core/defaults.go b/core/defaults.go index 940fe9a3f..e05d1ba08 100644 --- a/core/defaults.go +++ b/core/defaults.go @@ -7,6 +7,7 @@ import ( var ( DefaultConfigMainnet *SufficientChainConfig DefaultConfigMorden *SufficientChainConfig + DefaultConfigEZDev *SufficientChainConfig ) func init() { @@ -21,4 +22,8 @@ func init() { if err != nil { glog.Fatal("Error parsing morden defaults from JSON:", err) } + DefaultConfigEZDev, err = parseExternalChainConfig("/core/config/dev.json", assetsOpen) + if err != nil { + glog.Fatal("Error parsing ezdev defaults from JSON:", err) + } } diff --git a/eth/backend.go b/eth/backend.go index 01a20cdb1..c9548876e 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -258,8 +258,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { if err != nil { return nil, err } - glog.V(logger.Info).Infof("Successfully wrote default ethereum mainnet genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) - glog.D(logger.Warn).Infof("Wrote mainnet genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) + glog.V(logger.Info).Infof("Successfully wrote genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) + glog.D(logger.Warn).Infof("Wrote genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) } // Log genesis block information. From 1613926ef9a9175aab4b1275980faa75ec740252 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 12:22:12 -0500 Subject: [PATCH 04/30] setup and parse genesis alloc acc:bals --- cmd/geth/ezdev.go | 58 ++++++++++++------- core/config.go | 2 + eth/backend.go | 4 +- ...--28722756b2ae432fea34c46655683d04d3d63d97 | 1 + ...--9c9d64bc74d229de27b0d001541ad1c79fe59258 | 1 + ...--61dc4c92f9687cbd242e433fa43f144990e34441 | 1 + ...--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 | 1 + ...--2ddf073d4ac988f825285c9f897843ffe071165d | 1 + ...--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 | 1 + ...--396279cdb403d2b2d66dca18cda4797e39f4701d | 1 + ...--181625ff8566de18404882e596a6207135aecbc8 | 1 + ...--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 | 1 + ...--ff188023fcc81a4b558fda87ddff41ee5bf984c6 | 1 + 13 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 create mode 100644 keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 create mode 100644 keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 create mode 100644 keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 create mode 100644 keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d create mode 100644 keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 create mode 100644 keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d create mode 100644 keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 create mode 100644 keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 create mode 100644 keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index 5ea6d95b8..2923e5c2d 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -4,10 +4,9 @@ import ( "encoding/json" "fmt" "io/ioutil" - "math" - "math/big" "os" "path/filepath" + "strings" "github.com/ethereumproject/go-ethereum/core" "github.com/ethereumproject/go-ethereum/logger" @@ -34,30 +33,18 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { cc := core.DefaultConfigEZDev cc.Include = []string{"dev_genesis.json"} - cg := cc.Genesis - cc.Genesis = nil + var cg *core.GenesisDump + cg = cc.Genesis + // Set original genesis to nil so no conflict between GenesisAlloc field and present Genesis obj. + cc.Genesis = nil cg.AllocFile = "dev_genesis_alloc.csv" - // marshal and write config json - if err := cc.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { - return err - } - // marshal and write dev_genesis.json - genC, err := json.MarshalIndent(struct { - Genesis *core.GenesisDump `json:"genesis"` - }{cg}, "", " ") - if err != nil { - return fmt.Errorf("Could not marshal json from chain config: %v", err) - } - if err := ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis.json"), genC, 0644); err != nil { - return err - } - + // cc.Genesis = cg // make some accounts accman := MakeAccountManager(ctx) data := []byte{} - bal := big.NewInt(math.MaxInt16).String() + bal := "10000000000000000000000000000000" if len(accman.Accounts()) == 0 { glog.D(logger.Warn).Infoln("No existing EZDEV accounts found, creating 10") password := "foo" @@ -68,8 +55,13 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { return err } // accounts = append(accounts, acc) - d := fmt.Sprintf("%s,%v\n", acc.Address.Hex(), bal) + d := fmt.Sprintf(`"%s","%v" +`, strings.TrimLeft(acc.Address.Hex(), "0x"), bal) glog.D(logger.Warn).Infoln(acc.Address.Hex(), acc.File) + // b, ok := new(big.Int).SetString(bal, 10) + // if !ok { + // panic("not ok set string", b, bal) + // } data = append(data, []byte(d)...) } } else { @@ -80,6 +72,30 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { data = append(data, []byte(d)...) } } + + // marshal and write config json + if err := cc.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { + return err + } + // marshal and write dev_genesis.json + genC, err := json.MarshalIndent(struct { + Genesis *core.GenesisDump `json:"genesis"` + }{cg}, "", " ") + if err != nil { + return fmt.Errorf("Could not marshal json from chain config: %v", err) + } + if err := ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis.json"), genC, 0644); err != nil { + return err + } + + // write alloc file ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis_alloc.csv"), data, os.ModePerm) + + ccc, err = core.ReadExternalChainConfigFromFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")) + if err != nil { + panic(err) + } + cc.Genesis = ccc.Genesis + return nil } diff --git a/core/config.go b/core/config.go index 3d8e705a0..d56a3108d 100644 --- a/core/config.go +++ b/core/config.go @@ -493,7 +493,9 @@ func resolvePath(path, parentOrAdjacentPath string) string { } func parseAllocationFile(config *SufficientChainConfig, open func(string) (io.ReadCloser, error), currentFile string) error { + glog.Errorln(" ** parsing alloc file") if config.Genesis == nil || config.Genesis.AllocFile == "" { + glog.Errorln(" ** returning ") return nil } diff --git a/eth/backend.go b/eth/backend.go index c9548876e..2e790aee2 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -258,8 +258,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { if err != nil { return nil, err } - glog.V(logger.Info).Infof("Successfully wrote genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) - glog.D(logger.Warn).Infof("Wrote genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) + glog.V(logger.Info).Infof("Successfully wrote mainnet genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) + glog.D(logger.Warn).Infof("Wrote mainnet genesis block: %s", logger.ColorGreen(genesis.Hash().Hex())) } // Log genesis block information. diff --git a/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 b/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 new file mode 100644 index 000000000..01a3d1200 --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 @@ -0,0 +1 @@ +{"id":"89959609-c024-4833-be72-5239d2000923","address":"28722756b2ae432fea34c46655683d04d3d63d97","crypto":{"cipher":"aes-128-ctr","ciphertext":"6d992c38a73ff3bf72c606a54bc9cb24d82e0d9ed6709d70f5ee4bee2da1a0cd","cipherparams":{"iv":"9fe13dea23b97e69d0b30360d775605d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"02b64a6104e0768cc75840c4e15c0c3ecedad0281850a855e92cb20657e68a8d"},"mac":"52cafc01a87fc4fc90c65ad8c5eb973b0a9cbd78a79c40bd92dc0354daaf1d80"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 b/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 new file mode 100644 index 000000000..7b7b46ac9 --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 @@ -0,0 +1 @@ +{"id":"62f9db96-dd1b-425c-98dd-f0a538e0fcff","address":"9c9d64bc74d229de27b0d001541ad1c79fe59258","crypto":{"cipher":"aes-128-ctr","ciphertext":"fbfb50981bfe4208bbc749cfcd0441f5eeb917915d0ff9e55fadf89fdc1969a2","cipherparams":{"iv":"32d8cebf9c62b80e45532ef7e42912c3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"73c9428059b79dac962eedc5455f4a58db38a0bb76589180711a17498f84c3be"},"mac":"ee740ef0a6eacb3434fa65ac9f7491dab2e8c36abb6c0ba724bdb9e29487567f"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 b/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 new file mode 100644 index 000000000..6ebe4fff4 --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 @@ -0,0 +1 @@ +{"id":"6add4abd-7264-4cf2-b30f-30b88cf39ca0","address":"61dc4c92f9687cbd242e433fa43f144990e34441","crypto":{"cipher":"aes-128-ctr","ciphertext":"d0ec57e0f33c423dbf9c76a87af3ee073c24da250b185f3db00df969bc4bcdc8","cipherparams":{"iv":"65627b28ca4df3cbd7f261d319d22903"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"726b73434266ea8c8210b7e77d0e9fff624468cc43bbc6c1f72934eb9d78ea03"},"mac":"096612683bc953fb366d3c5ab8c90bbb19a37fa30c4a02f4417b440300769aa0"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 b/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 new file mode 100644 index 000000000..398e860ea --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 @@ -0,0 +1 @@ +{"id":"d744543e-60ef-4d72-94d7-4613346448e0","address":"eacd611878cdc721cd27f83df76f7a47f2d7a6f7","crypto":{"cipher":"aes-128-ctr","ciphertext":"881623c4e13407a24b0f364750470a35ddff8327a2ad3a401866929c6086e597","cipherparams":{"iv":"2497222d17e3b5b3563645446aa96a73"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"57cfd8bad3828f78124f20e00f4b5e02e553633a9fd2becc1f01c8e01d4a545b"},"mac":"0ff39d0721d1325a26a146c042eef321d4f7556ba105c8464f2ec835d15ca9c0"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d b/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d new file mode 100644 index 000000000..b33ceb3af --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d @@ -0,0 +1 @@ +{"id":"10034918-8a6e-4ac9-b4aa-790d41ee54e2","address":"2ddf073d4ac988f825285c9f897843ffe071165d","crypto":{"cipher":"aes-128-ctr","ciphertext":"26bf52d6c4d4626666fd5ea1f191636613ceb3ce5b933c7a3b0d6e96b73623a8","cipherparams":{"iv":"2e794734af2b8ad6626a4b882f2cfff1"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"fb86c0ad2cd2f74870b765b3c03b037ed3415a9a05ec0dcd4fd62b7e99238ebe"},"mac":"c406a70a451f5912e9f48f1be0b6abf9cd1751aa4b8e843a02b4afa468c35caa"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 b/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 new file mode 100644 index 000000000..46c300835 --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 @@ -0,0 +1 @@ +{"id":"d98c023b-8ff6-41c1-a044-6aaf62baea70","address":"1941813f4a7ba0e5f99a9e92a51fc3e0219de098","crypto":{"cipher":"aes-128-ctr","ciphertext":"c86935b02960341d5b15ef222072a5fe14002ff69139178fef4afc9c9bd5cbc2","cipherparams":{"iv":"22aba9fa6583b20074a6380efa4315d6"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"dbc1a28094beabd9f7a9fa491d34f7e2ead57ba9d7dc0245795ff347c93246fb"},"mac":"06cad0b309c7ceaf385cdd314350adf3c1090259ff9e85fa5a77a35bd4c440de"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d b/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d new file mode 100644 index 000000000..77311be52 --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d @@ -0,0 +1 @@ +{"id":"9a857e71-a15b-422a-8f24-dd3d002eefda","address":"396279cdb403d2b2d66dca18cda4797e39f4701d","crypto":{"cipher":"aes-128-ctr","ciphertext":"78441bc396277b5994b94938e640b9bdf7ab0d4b83b1eff69bf36c2604c4304e","cipherparams":{"iv":"3d3f84b8cffc447c49e1e60e9f89e058"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"be75502ec0053d5dfdc5943ca4ba2cb4755d0cbec0daf1b4a314b5271ab8d50e"},"mac":"86bced0fa4373623c8548c9283ea37ef3e9170f5f09a50d33f01fb78dc1137da"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 b/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 new file mode 100644 index 000000000..9e7e56a9d --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 @@ -0,0 +1 @@ +{"id":"5a812efc-9061-4835-b641-78e2cc78a60e","address":"181625ff8566de18404882e596a6207135aecbc8","crypto":{"cipher":"aes-128-ctr","ciphertext":"681e9b437b22fdcb8477cab80de40bd399f916ef11870face87a255d101bf9a3","cipherparams":{"iv":"357ebdc05e5d59384cdfcf10aa23ddb8"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"2d4df78990c5b90a482b00ba1c9c5838c1a715926a3bfce5313b0022f68cfb2c"},"mac":"92f79bdd492d3304715e0673c387c1753a7c6c2c325c861ff974949f77a3b8ae"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 b/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 new file mode 100644 index 000000000..c11cbb78e --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 @@ -0,0 +1 @@ +{"id":"77ead276-b6ee-4f52-ada1-b5f1e9d88c01","address":"f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7","crypto":{"cipher":"aes-128-ctr","ciphertext":"7aef2f90e3c928a495c3ebc67ab045b4f290fbbf73a12e4175296489941e8109","cipherparams":{"iv":"b54385d5539c7829c33a1b5b9caa85c3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"228ea0b8ad8ee13e5aa0fead6d6e4b8126c7fc5caf8be017a3ab7171228788aa"},"mac":"1b4eb05ba311b8e554193a9a842c4b677a6ca71a3f4b7adeaebea0d29452bb18"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 b/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 new file mode 100644 index 000000000..4bdb5ebcc --- /dev/null +++ b/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 @@ -0,0 +1 @@ +{"id":"41b57d52-c096-4071-a4b0-6d53e8da74e6","address":"ff188023fcc81a4b558fda87ddff41ee5bf984c6","crypto":{"cipher":"aes-128-ctr","ciphertext":"26ae052d3c031a2502ef620fbf16e5290b98fc1d4b9fa128bd82ec3e73396a83","cipherparams":{"iv":"fc32cc97cbf7319ff2bb3a5fdbecd9db"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"a37924f3bc656c93a8ab7b348e5eaf28054ad358f253e6ea1dc563b59d43d10e"},"mac":"2259568cdd4a6cdc9bb551de24029d42508d7e469aa84b5e892c24d379349c77"},"version":3} \ No newline at end of file From 9e62337ba353a4e10c47384b7dae46f121d3dd00 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:10:31 -0500 Subject: [PATCH 05/30] rm keys/ from testing --- ...17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 | 1 - ...17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 | 1 - ...17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 | 1 - ...17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 | 1 - ...17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d | 1 - ...17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 | 1 - ...17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d | 1 - ...T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 | 1 - ...17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 | 1 - ...T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 | 1 - 10 files changed, 10 deletions(-) delete mode 100644 keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 delete mode 100644 keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 delete mode 100644 keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 delete mode 100644 keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 delete mode 100644 keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d delete mode 100644 keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 delete mode 100644 keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d delete mode 100644 keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 delete mode 100644 keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 delete mode 100644 keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 diff --git a/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 b/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 deleted file mode 100644 index 01a3d1200..000000000 --- a/keys/UTC--2018-11-21T17-19-03.064299857Z--28722756b2ae432fea34c46655683d04d3d63d97 +++ /dev/null @@ -1 +0,0 @@ -{"id":"89959609-c024-4833-be72-5239d2000923","address":"28722756b2ae432fea34c46655683d04d3d63d97","crypto":{"cipher":"aes-128-ctr","ciphertext":"6d992c38a73ff3bf72c606a54bc9cb24d82e0d9ed6709d70f5ee4bee2da1a0cd","cipherparams":{"iv":"9fe13dea23b97e69d0b30360d775605d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"02b64a6104e0768cc75840c4e15c0c3ecedad0281850a855e92cb20657e68a8d"},"mac":"52cafc01a87fc4fc90c65ad8c5eb973b0a9cbd78a79c40bd92dc0354daaf1d80"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 b/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 deleted file mode 100644 index 7b7b46ac9..000000000 --- a/keys/UTC--2018-11-21T17-19-04.288924442Z--9c9d64bc74d229de27b0d001541ad1c79fe59258 +++ /dev/null @@ -1 +0,0 @@ -{"id":"62f9db96-dd1b-425c-98dd-f0a538e0fcff","address":"9c9d64bc74d229de27b0d001541ad1c79fe59258","crypto":{"cipher":"aes-128-ctr","ciphertext":"fbfb50981bfe4208bbc749cfcd0441f5eeb917915d0ff9e55fadf89fdc1969a2","cipherparams":{"iv":"32d8cebf9c62b80e45532ef7e42912c3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"73c9428059b79dac962eedc5455f4a58db38a0bb76589180711a17498f84c3be"},"mac":"ee740ef0a6eacb3434fa65ac9f7491dab2e8c36abb6c0ba724bdb9e29487567f"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 b/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 deleted file mode 100644 index 6ebe4fff4..000000000 --- a/keys/UTC--2018-11-21T17-19-05.045871411Z--61dc4c92f9687cbd242e433fa43f144990e34441 +++ /dev/null @@ -1 +0,0 @@ -{"id":"6add4abd-7264-4cf2-b30f-30b88cf39ca0","address":"61dc4c92f9687cbd242e433fa43f144990e34441","crypto":{"cipher":"aes-128-ctr","ciphertext":"d0ec57e0f33c423dbf9c76a87af3ee073c24da250b185f3db00df969bc4bcdc8","cipherparams":{"iv":"65627b28ca4df3cbd7f261d319d22903"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"726b73434266ea8c8210b7e77d0e9fff624468cc43bbc6c1f72934eb9d78ea03"},"mac":"096612683bc953fb366d3c5ab8c90bbb19a37fa30c4a02f4417b440300769aa0"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 b/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 deleted file mode 100644 index 398e860ea..000000000 --- a/keys/UTC--2018-11-21T17-19-06.173240408Z--eacd611878cdc721cd27f83df76f7a47f2d7a6f7 +++ /dev/null @@ -1 +0,0 @@ -{"id":"d744543e-60ef-4d72-94d7-4613346448e0","address":"eacd611878cdc721cd27f83df76f7a47f2d7a6f7","crypto":{"cipher":"aes-128-ctr","ciphertext":"881623c4e13407a24b0f364750470a35ddff8327a2ad3a401866929c6086e597","cipherparams":{"iv":"2497222d17e3b5b3563645446aa96a73"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"57cfd8bad3828f78124f20e00f4b5e02e553633a9fd2becc1f01c8e01d4a545b"},"mac":"0ff39d0721d1325a26a146c042eef321d4f7556ba105c8464f2ec835d15ca9c0"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d b/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d deleted file mode 100644 index b33ceb3af..000000000 --- a/keys/UTC--2018-11-21T17-19-06.844841648Z--2ddf073d4ac988f825285c9f897843ffe071165d +++ /dev/null @@ -1 +0,0 @@ -{"id":"10034918-8a6e-4ac9-b4aa-790d41ee54e2","address":"2ddf073d4ac988f825285c9f897843ffe071165d","crypto":{"cipher":"aes-128-ctr","ciphertext":"26bf52d6c4d4626666fd5ea1f191636613ceb3ce5b933c7a3b0d6e96b73623a8","cipherparams":{"iv":"2e794734af2b8ad6626a4b882f2cfff1"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"fb86c0ad2cd2f74870b765b3c03b037ed3415a9a05ec0dcd4fd62b7e99238ebe"},"mac":"c406a70a451f5912e9f48f1be0b6abf9cd1751aa4b8e843a02b4afa468c35caa"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 b/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 deleted file mode 100644 index 46c300835..000000000 --- a/keys/UTC--2018-11-21T17-19-07.692268019Z--1941813f4a7ba0e5f99a9e92a51fc3e0219de098 +++ /dev/null @@ -1 +0,0 @@ -{"id":"d98c023b-8ff6-41c1-a044-6aaf62baea70","address":"1941813f4a7ba0e5f99a9e92a51fc3e0219de098","crypto":{"cipher":"aes-128-ctr","ciphertext":"c86935b02960341d5b15ef222072a5fe14002ff69139178fef4afc9c9bd5cbc2","cipherparams":{"iv":"22aba9fa6583b20074a6380efa4315d6"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"dbc1a28094beabd9f7a9fa491d34f7e2ead57ba9d7dc0245795ff347c93246fb"},"mac":"06cad0b309c7ceaf385cdd314350adf3c1090259ff9e85fa5a77a35bd4c440de"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d b/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d deleted file mode 100644 index 77311be52..000000000 --- a/keys/UTC--2018-11-21T17-19-08.363305801Z--396279cdb403d2b2d66dca18cda4797e39f4701d +++ /dev/null @@ -1 +0,0 @@ -{"id":"9a857e71-a15b-422a-8f24-dd3d002eefda","address":"396279cdb403d2b2d66dca18cda4797e39f4701d","crypto":{"cipher":"aes-128-ctr","ciphertext":"78441bc396277b5994b94938e640b9bdf7ab0d4b83b1eff69bf36c2604c4304e","cipherparams":{"iv":"3d3f84b8cffc447c49e1e60e9f89e058"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"be75502ec0053d5dfdc5943ca4ba2cb4755d0cbec0daf1b4a314b5271ab8d50e"},"mac":"86bced0fa4373623c8548c9283ea37ef3e9170f5f09a50d33f01fb78dc1137da"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 b/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 deleted file mode 100644 index 9e7e56a9d..000000000 --- a/keys/UTC--2018-11-21T17-19-09.09718147Z--181625ff8566de18404882e596a6207135aecbc8 +++ /dev/null @@ -1 +0,0 @@ -{"id":"5a812efc-9061-4835-b641-78e2cc78a60e","address":"181625ff8566de18404882e596a6207135aecbc8","crypto":{"cipher":"aes-128-ctr","ciphertext":"681e9b437b22fdcb8477cab80de40bd399f916ef11870face87a255d101bf9a3","cipherparams":{"iv":"357ebdc05e5d59384cdfcf10aa23ddb8"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"2d4df78990c5b90a482b00ba1c9c5838c1a715926a3bfce5313b0022f68cfb2c"},"mac":"92f79bdd492d3304715e0673c387c1753a7c6c2c325c861ff974949f77a3b8ae"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 b/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 deleted file mode 100644 index c11cbb78e..000000000 --- a/keys/UTC--2018-11-21T17-19-10.353420804Z--f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7 +++ /dev/null @@ -1 +0,0 @@ -{"id":"77ead276-b6ee-4f52-ada1-b5f1e9d88c01","address":"f8b6193fae9ff40e95ae2dcb94e8d042a3b07ff7","crypto":{"cipher":"aes-128-ctr","ciphertext":"7aef2f90e3c928a495c3ebc67ab045b4f290fbbf73a12e4175296489941e8109","cipherparams":{"iv":"b54385d5539c7829c33a1b5b9caa85c3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"228ea0b8ad8ee13e5aa0fead6d6e4b8126c7fc5caf8be017a3ab7171228788aa"},"mac":"1b4eb05ba311b8e554193a9a842c4b677a6ca71a3f4b7adeaebea0d29452bb18"},"version":3} \ No newline at end of file diff --git a/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 b/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 deleted file mode 100644 index 4bdb5ebcc..000000000 --- a/keys/UTC--2018-11-21T17-19-11.26900001Z--ff188023fcc81a4b558fda87ddff41ee5bf984c6 +++ /dev/null @@ -1 +0,0 @@ -{"id":"41b57d52-c096-4071-a4b0-6d53e8da74e6","address":"ff188023fcc81a4b558fda87ddff41ee5bf984c6","crypto":{"cipher":"aes-128-ctr","ciphertext":"26ae052d3c031a2502ef620fbf16e5290b98fc1d4b9fa128bd82ec3e73396a83","cipherparams":{"iv":"fc32cc97cbf7319ff2bb3a5fdbecd9db"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"a37924f3bc656c93a8ab7b348e5eaf28054ad358f253e6ea1dc563b59d43d10e"},"mac":"2259568cdd4a6cdc9bb551de24029d42508d7e469aa84b5e892c24d379349c77"},"version":3} \ No newline at end of file From 086879f5a8de200407a68653396840a6914fa140 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:11:51 -0500 Subject: [PATCH 06/30] init basic functionality miner.automine (without nonce pow validation) --- cmd/geth/ezdev.go | 19 +++--- cmd/geth/flag.go | 5 -- core/assets/assets.go | 2 +- core/block_validator.go | 2 +- core/config.go | 2 + eth/backend.go | 2 +- miner/agent.go | 5 ++ miner/auto_agent.go | 147 ++++++++++++++++++++++++++++++++++++++++ miner/miner.go | 12 ++-- miner/remote_agent.go | 5 ++ miner/worker.go | 82 +++++++++++++++++----- test.js | 16 +++++ 12 files changed, 260 insertions(+), 39 deletions(-) create mode 100644 miner/auto_agent.go create mode 100644 test.js diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index 2923e5c2d..c0227bff9 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -30,14 +30,12 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { setCTXDefault(ctx, NoDiscoverFlag.Name, "true") setCTXDefault(ctx, LightKDFFlag.Name, "true") - cc := core.DefaultConfigEZDev - cc.Include = []string{"dev_genesis.json"} + config.Include = []string{"dev_genesis.json"} - var cg *core.GenesisDump - cg = cc.Genesis + cg := config.Genesis // Set original genesis to nil so no conflict between GenesisAlloc field and present Genesis obj. - cc.Genesis = nil + config.Genesis = nil cg.AllocFile = "dev_genesis_alloc.csv" // cc.Genesis = cg @@ -55,8 +53,10 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { return err } // accounts = append(accounts, acc) + // a := acc.Address.Hex() + a := strings.Replace(acc.Address.Hex(), "0x", "", -1) d := fmt.Sprintf(`"%s","%v" -`, strings.TrimLeft(acc.Address.Hex(), "0x"), bal) +`, a, bal) glog.D(logger.Warn).Infoln(acc.Address.Hex(), acc.File) // b, ok := new(big.Int).SetString(bal, 10) // if !ok { @@ -74,7 +74,7 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { } // marshal and write config json - if err := cc.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { + if err := config.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { return err } // marshal and write dev_genesis.json @@ -91,11 +91,12 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { // write alloc file ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis_alloc.csv"), data, os.ModePerm) - ccc, err = core.ReadExternalChainConfigFromFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")) + cc, err := core.ReadExternalChainConfigFromFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")) if err != nil { panic(err) } - cc.Genesis = ccc.Genesis + config.Genesis = cc.Genesis + config.ChainConfig.Automine = true return nil } diff --git a/cmd/geth/flag.go b/cmd/geth/flag.go index e0c1dee9c..216c4cbbd 100644 --- a/cmd/geth/flag.go +++ b/cmd/geth/flag.go @@ -493,11 +493,6 @@ func MakeSystemNode(version string, ctx *cli.Context) *node.Node { config := mustMakeSufficientChainConfig(ctx) logChainConfiguration(ctx, config) - // if reflect.DeepEqual(core.DefaultConfigEZDev, config) { - // if err := setupEZDev(ctx, config); err != nil { - // log.Fatal(err) - // } - // } if ctx.GlobalBool(EZDevModeFlag.Name) { if err := setupEZDev(ctx, config); err != nil { log.Fatal(err) diff --git a/core/assets/assets.go b/core/assets/assets.go index 71322b68b..719fb7117 100644 --- a/core/assets/assets.go +++ b/core/assets/assets.go @@ -481,7 +481,7 @@ func init() { fi: FileInfo{ name: "dev_genesis_alloc.csv", size: 0, - modTime: time.Unix(0, 1542804884724147473), + modTime: time.Unix(0, 1542823445002300459), isDir: false, }, }, "/core/config/dev_morden.json": File{ diff --git a/core/block_validator.go b/core/block_validator.go index 4526a945b..f661d09bc 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -257,7 +257,7 @@ func ValidateHeader(config *ChainConfig, pow pow.PoW, header *types.Header, pare if checkPow { // Verify the nonce of the header. Return an error if it's not valid - if !pow.Verify(types.NewBlockWithHeader(header)) { + if !config.Automine && !pow.Verify(types.NewBlockWithHeader(header)) { return &BlockNonceErr{header.Number, header.Hash(), header.Nonce.Uint64()} } } diff --git a/core/config.go b/core/config.go index d56a3108d..d7902072e 100644 --- a/core/config.go +++ b/core/config.go @@ -150,6 +150,8 @@ type ChainConfig struct { // BadHashes holds well known blocks with consensus issues. See ErrHashKnownBad. BadHashes []*BadHash `json:"badHashes"` + + Automine bool `json:"automine,omitempty"` } type Fork struct { diff --git a/eth/backend.go b/eth/backend.go index 2e790aee2..864295259 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -306,7 +306,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, m, uint64(config.NetworkId), eth.eventMux, eth.txPool, eth.pow, eth.blockchain, chainDb); err != nil { return nil, err } - eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.pow) + eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.pow, config.ChainConfig.Automine) if err = eth.miner.SetGasPrice(config.GasPrice); err != nil { return nil, err } diff --git a/miner/agent.go b/miner/agent.go index ba563768c..eacb24464 100644 --- a/miner/agent.go +++ b/miner/agent.go @@ -22,6 +22,7 @@ import ( "sync/atomic" "github.com/ethereumproject/go-ethereum/common" + "github.com/ethereumproject/go-ethereum/core/types" "github.com/ethereumproject/go-ethereum/logger" "github.com/ethereumproject/go-ethereum/logger/glog" "github.com/ethereumproject/go-ethereum/pow" @@ -130,3 +131,7 @@ func (self *CpuAgent) mine(work *Work, stop <-chan struct{}) { func (self *CpuAgent) GetHashRate() int64 { return self.pow.GetHashrate() } + +func (self *CpuAgent) Win(work *Work) *types.Block { + panic("satisfies automining method") +} diff --git a/miner/auto_agent.go b/miner/auto_agent.go new file mode 100644 index 000000000..55331693a --- /dev/null +++ b/miner/auto_agent.go @@ -0,0 +1,147 @@ +// Copyright 2015 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package miner + +import ( + "math/rand" + "sync" + "time" + + "sync/atomic" + + "github.com/ethereumproject/go-ethereum/common" + "github.com/ethereumproject/go-ethereum/core/types" + "github.com/ethereumproject/go-ethereum/logger" + "github.com/ethereumproject/go-ethereum/logger/glog" + "github.com/ethereumproject/go-ethereum/pow" +) + +type AutoAgent struct { + mu sync.Mutex + + workCh chan *Work + quit chan struct{} + quitCurrentOp chan struct{} + returnCh chan<- *Result + + index int + pow pow.PoW + + isMining int32 // isMining indicates whether the agent is currently mining +} + +func NewAutoAgent(index int) *AutoAgent { + miner := &AutoAgent{ + index: index, + } + + return miner +} + +func (self *AutoAgent) Work() chan<- *Work { return self.workCh } +func (self *AutoAgent) Pow() pow.PoW { return self.pow } +func (self *AutoAgent) SetReturnCh(ch chan<- *Result) { self.returnCh = ch } + +func (self *AutoAgent) Stop() { + self.mu.Lock() + defer self.mu.Unlock() + + close(self.quit) +} + +func (self *AutoAgent) Start() { + self.mu.Lock() + defer self.mu.Unlock() + + if !atomic.CompareAndSwapInt32(&self.isMining, 0, 1) { + return // agent already started + } + + self.quit = make(chan struct{}) + // creating current op ch makes sure we're not closing a nil ch + // later on + self.workCh = make(chan *Work, 1) + + go self.update() +} + +func (self *AutoAgent) update() { +out: + for { + select { + case work := <-self.workCh: + self.mu.Lock() + if self.quitCurrentOp != nil { + close(self.quitCurrentOp) + } + self.quitCurrentOp = make(chan struct{}) + go self.mine(work, self.quitCurrentOp) + self.mu.Unlock() + case <-self.quit: + self.mu.Lock() + if self.quitCurrentOp != nil { + close(self.quitCurrentOp) + self.quitCurrentOp = nil + } + self.mu.Unlock() + break out + } + } + +done: + // Empty work channel + for { + select { + case <-self.workCh: + default: + close(self.workCh) + break done + } + } + + atomic.StoreInt32(&self.isMining, 0) +} + +func (self *AutoAgent) mine(work *Work, stop <-chan struct{}) { + glog.V(logger.Debug).Infof("(re)started agent[%d]. mining...\n", self.index) + + // Mine + // nonce, mixDigest := self.pow.Search(work.Block, stop, self.index) + nonce := work.Block.NumberU64() + 1 + mixDigest, _ := time.Now().MarshalBinary() + if nonce != 0 { + block := work.Block.WithMiningResult(nonce, common.BytesToHash(mixDigest)) + self.returnCh <- &Result{work, block} + } else { + self.returnCh <- nil + } +} + +func (self *AutoAgent) GetHashRate() int64 { + return self.pow.GetHashrate() +} + +func (self *AutoAgent) Win(work *Work) *types.Block { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + nonce := uint64(r.Int63()) + + // nonce := work.Block.NumberU64() + // mixDigest, _ := time.Now().MarshalBinary() + // block := work.Block.WithMiningResult(nonce, common.BytesToHash(mixDigest)) + block := work.Block.WithMiningResult(nonce, common.BytesToHash(nil)) + return block +} diff --git a/miner/miner.go b/miner/miner.go index f5039eae3..6b6c12b72 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -51,10 +51,12 @@ type Miner struct { canStart int32 // can start indicates whether we can start the mining operation shouldStart int32 // should start indicates whether we should start after sync + + automine bool } -func New(eth core.Backend, config *core.ChainConfig, mux *event.TypeMux, pow pow.PoW) *Miner { - miner := &Miner{eth: eth, mux: mux, pow: pow, worker: newWorker(config, common.Address{}, eth), canStart: 1} +func New(eth core.Backend, config *core.ChainConfig, mux *event.TypeMux, pow pow.PoW, automine bool) *Miner { + miner := &Miner{eth: eth, mux: mux, pow: pow, worker: newWorker(config, common.Address{}, eth), canStart: 1, automine: automine} go miner.update() return miner @@ -121,8 +123,10 @@ func (self *Miner) Start(coinbase common.Address, threads int) { atomic.StoreInt32(&self.mining, 1) - for i := 0; i < threads; i++ { - self.worker.register(NewCpuAgent(i, self.pow)) + if !self.automine { + for i := 0; i < threads; i++ { + self.worker.register(NewCpuAgent(i, self.pow)) + } } mlogMinerStart.AssignDetails( diff --git a/miner/remote_agent.go b/miner/remote_agent.go index 7d97182fe..903d72cef 100644 --- a/miner/remote_agent.go +++ b/miner/remote_agent.go @@ -25,6 +25,7 @@ import ( "github.com/ethereumproject/ethash" "github.com/ethereumproject/go-ethereum/common" + "github.com/ethereumproject/go-ethereum/core/types" "github.com/ethereumproject/go-ethereum/logger" "github.com/ethereumproject/go-ethereum/logger/glog" ) @@ -192,3 +193,7 @@ out: } } } + +func (self *RemoteAgent) Win(work *Work) *types.Block { + panic("satisfies automining method") +} diff --git a/miner/worker.go b/miner/worker.go index ef1e73131..f2a6ecb2b 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -18,7 +18,6 @@ package miner import ( "fmt" - "log" "math/big" "sync" "sync/atomic" @@ -49,6 +48,7 @@ type Agent interface { Stop() Start() GetHashRate() int64 + Win(work *Work) *types.Block // just for automining } type uint64RingBuffer struct { @@ -101,6 +101,8 @@ type worker struct { agents map[Agent]struct{} recv chan *Result + autominer Agent + eth core.Backend chain *core.BlockChain proc core.Validator @@ -137,9 +139,14 @@ func newWorker(config *core.ChainConfig, coinbase common.Address, eth core.Backe possibleUncles: make(map[common.Hash]*types.Block), coinbase: coinbase, txQueue: make(map[common.Hash]*types.Transaction), - agents: make(map[Agent]struct{}), fullValidation: false, } + worker.agents = make(map[Agent]struct{}) + if !config.Automine { + } else { + worker.autominer = NewAutoAgent(0) + worker.fullValidation = false + } worker.events = worker.mux.Subscribe(core.ChainHeadEvent{}, core.ChainSideEvent{}, core.TxPreEvent{}) go worker.update() @@ -217,21 +224,48 @@ func (self *worker) unregister(agent Agent) { } func (self *worker) update() { - for event := range self.events.Chan() { - // A real event arrived, process interesting content - switch ev := event.Data.(type) { - case core.ChainHeadEvent: - self.commitNewWork() - case core.ChainSideEvent: - self.uncleMu.Lock() - self.possibleUncles[ev.Block.Hash()] = ev.Block - self.uncleMu.Unlock() - case core.TxPreEvent: - // Apply transaction to the pending state if we're not mining - if atomic.LoadInt32(&self.mining) == 0 { - self.currentMu.Lock() - self.current.commitTransactions(self.mux, types.Transactions{ev.Tx}, self.gasPrice, self.chain) - self.currentMu.Unlock() + if self.config.Automine { + for event := range self.events.Chan() { + switch ev := event.Data.(type) { + case core.ChainHeadEvent: + self.commitNewWork() + case core.ChainSideEvent: + self.uncleMu.Lock() + self.possibleUncles[ev.Block.Hash()] = ev.Block + self.uncleMu.Unlock() + case core.TxPreEvent: + glog.D(logger.Warn).Infoln(" + tx: ", ev.Tx.Hash().Hex()) + + if atomic.LoadInt32(&self.mining) == 0 { + self.currentMu.Lock() + self.current.commitTransactions(self.mux, types.Transactions{ev.Tx}, self.gasPrice, self.chain) + self.currentMu.Unlock() + } else { + b := &Result{self.current, self.autominer.Win(self.current)} + // glog.D(logger.Warn).Infoln("b=", b) + glog.D(logger.Warn).Infoln("b <-", b.Block.Hash().Hex(), b.Block.Nonce(), b.Block.MixDigest().Hex()) + self.recv <- b + } + + } + } + } else { + for event := range self.events.Chan() { + // A real event arrived, process interesting content + switch ev := event.Data.(type) { + case core.ChainHeadEvent: + self.commitNewWork() + case core.ChainSideEvent: + self.uncleMu.Lock() + self.possibleUncles[ev.Block.Hash()] = ev.Block + self.uncleMu.Unlock() + case core.TxPreEvent: + // Apply transaction to the pending state if we're not mining + if atomic.LoadInt32(&self.mining) == 0 { + self.currentMu.Lock() + self.current.commitTransactions(self.mux, types.Transactions{ev.Tx}, self.gasPrice, self.chain) + self.currentMu.Unlock() + } } } } @@ -249,6 +283,12 @@ func newLocalMinedBlock(blockNumber uint64, prevMinedBlocks *uint64RingBuffer) ( return minedBlocks } +func (self *worker) autowait() { + for { + } +} + +// wait waits for agent to find new a new solved block func (self *worker) wait() { for { for result := range self.recv { @@ -260,29 +300,35 @@ func (self *worker) wait() { block := result.Block work := result.Work + glog.D(logger.Error).Infoln("got result", block, work) if self.fullValidation { + glog.D(logger.Error).Infoln("full") if res := self.chain.InsertChain(types.Blocks{block}); res.Error != nil { - log.Printf("mine: ignoring invalid block #%d (%x) received: %v\n", block.Number(), block.Hash(), res.Error) + glog.Errorln("mine: ignoring invalid block #%d (%x) received: %v\n", block.Number(), block.Hash(), res.Error) continue } go self.mux.Post(core.NewMinedBlockEvent{Block: block}) } else { + glog.D(logger.Error).Infoln("notfull") work.state.CommitTo(self.chainDb, false) parent := self.chain.GetBlock(block.ParentHash()) if parent == nil { glog.V(logger.Error).Infoln("Invalid block found during mining") + glog.D(logger.Error).Infoln("Invalid block found during mining") continue } auxValidator := self.eth.BlockChain().AuxValidator() if err := core.ValidateHeader(self.config, auxValidator, block.Header(), parent.Header(), true, false); err != nil && err != core.BlockFutureErr { glog.V(logger.Error).Infoln("Invalid header on mined block:", err) + glog.D(logger.Error).Infoln("Invalid header on mined block:", err) continue } stat, err := self.chain.WriteBlock(block) if err != nil { glog.V(logger.Error).Infoln("error writing block to chain", err) + glog.D(logger.Error).Infoln("error writing block to chain", err) continue } diff --git a/test.js b/test.js new file mode 100644 index 000000000..ceb5279c5 --- /dev/null +++ b/test.js @@ -0,0 +1,16 @@ + +var a = { + a: function() {personal.unlockAccount(eth.accounts[0])}, + b: miner.start, + c: function() {eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(1.33, "ether")}); } +}; + +a.a() +a.b() + +a.c() +a.c() +a.c() + + + From ad21687e42d5c2e5aa70d0c3e143c3ad1c34d008 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:22:01 -0500 Subject: [PATCH 07/30] instructions and notes --- README.md | 337 ++---------------------------------------------------- 1 file changed, 9 insertions(+), 328 deletions(-) diff --git a/README.md b/README.md index e2256e5bc..b0a963ff6 100644 --- a/README.md +++ b/README.md @@ -5,336 +5,17 @@ )](https://godoc.org/github.com/ethereumproject/go-ethereum) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereumproject/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -## Ethereum Go (Ethereum Classic Blockchain) - -Official Go language implementation of the Ethereum protocol supporting the -_original_ chain. Ethereum Classic (ETC) offers a censorship-resistant and powerful application platform for developers in parallel to Ethereum (ETHF), while differentially rejecting the DAO bailout. - -## Install - -### :rocket: From a release binary -The simplest way to get started running a node is to visit our [Releases page](https://github.com/ethereumproject/go-ethereum/releases) and download a zipped executable binary (matching your operating system, of course), then moving the unzipped file `geth` to somewhere in your `$PATH`. Now you should be able to open a terminal and run `$ geth help` to make sure it's working. For additional installation instructions please check out the [Installation Wiki](https://github.com/ethereumproject/go-ethereum/wiki/Home#Developers). - -#### :beers: Using Homebrew (OSX only) -``` -$ brew install ethereumproject/classic/geth -``` - -### :hammer: Building the source - -If your heart is set on the bleeding edge, install from source. However, please be advised that you may encounter some strange things, and we can't prioritize support beyond the release versions. Recommended for developers only. - -#### Dependencies -Building geth requires both Go >=1.9 and a C compiler. On Linux systems, -a C compiler can, for example, by installed with `sudo apt-get install -build-essential`. On Mac: `xcode-select --install`. - -#### Get source and package dependencies -``` -$ go get -v github.com/ethereumproject/go-ethereum/...` -``` - -#### Install and build command executables - -Executables installed from source will, by default, be installed in `$GOPATH/bin/`. - -##### With go: - -- the full suite of utilities: -``` -$ go install github.com/ethereumproject/go-ethereum/cmd/...` -``` - -- just __geth__: -``` -$ go install github.com/ethereumproject/go-ethereum/cmd/geth` -``` - -##### With make: -``` -$ cd $GOPATH/src/github.com/ethereumproject/go-ethereum -``` - -- the full suite of utilities: -``` -$ make install -``` - -- just __geth__: -``` -$ make install_geth +Start geth with: +- `rm -rf` ing old development files w/ each rerun +- new `--ezdev` flag +- `--sputnikvm` for demonstration +- `--keystore` for demonstrating a custom keystore dir. This is the directory in which keyfiles live. If there are NO keyfiles in this dir, then EZDev :registered: will generate 10 keys, each with password `foo`. If there ARE ANY key files in this dir, then geth will not generate any new files, and will endow those accounts with substantial premine balances (`10000000000000000000000000000000wei`) in the genesis block. This directory can be anywhere. ``` - -> For further `make` information, use `make help` to see a list and description of available make -> commands. - - -##### Building a specific release -All the above commands results with building binaries from `HEAD`. To use a specific release/tag, use the following before installing: - -```shell -$ go get -d github.com/ethereumproject/go-ethereum/... -$ cd $GOPATH/src/github.com/ethereumproject/go-ethereum -$ git checkout -# Use a go or make command above. -``` - -##### Using a release source code tarball -Because of strict Go directory structure, the tarball needs to be extracted into the proper subdirectory under `$GOPATH`. -The following commands are an example of building the v4.1.1 release: - -```shell -$ mkdir -p $GOPATH/src/github.com/ethereumproject -$ cd $GOPATH/src/github.com/ethereumproject -$ tar xzf /path/to/go-ethereum-4.1.1.tar.gz -$ mv go-ethereum-4.1.1 go-ethereum $ cd go-ethereum -# Use a go or make command above. +$ make cmd/geth && rm -rf ./keys && rm -rf ~/.ethereum-classic/ezdev && ./bin/geth --ezdev --sputnikvm --keystore ./keys ``` -## Executables - -This repository includes several wrappers/executables found in the `cmd` directory. - -| Command | Description | -|:----------:|-------------| -| **`geth`** | The main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test-, or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. Please see our [Command Line Options](https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options) wiki page for details. | -| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereumproject/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereumproject/go-ethereum/wiki/Native-DApps-in-Go) wiki page for details. | -| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. | -| `disasm` | Bytecode disassembler to convert EVM (Ethereum Virtual Machine) bytecode into more user friendly assembly-like opcodes (e.g. `echo "6001" | disasm`). For details on the individual opcodes, please see pages 22-30 of the [Ethereum Yellow Paper](http://gavwood.com/paper.pdf). | -| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow insolated, fine graned debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). | -| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereumproject/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereumproject/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereumproject/rpc-tests/blob/master/README.md) for details. | -| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereumproject/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). | - -## :green_book: Geth: the basics - -### Data directory -By default, geth will store all node and blockchain data in a __parent directory__ depending on your OS: - -- Linux: `$HOME/.ethereum-classic/` -- Mac: `$HOME/Library/EthereumClassic/` -- Windows: `$HOME/AppData/Roaming/EthereumClassic/` - -__You can specify this directory__ with `--data-dir=$HOME/id/rather/put/it/here`. - -Within this parent directory, geth will use a __/subdirectory__ to hold data for each network you run. The defaults are: - - - `/mainnet` for the Mainnet - - `/morden` for the Morden Testnet - -__You can specify this subdirectory__ with `--chain=mycustomnet`. - -> __Migrating__: If you have existing data created prior to the [3.4 Release](https://github.com/ethereumproject/go-ethereum/releases), geth will attempt to migrate your existing standard ETC data to this structure. To learn more about managing this migration please read our [3.4 release notes on our Releases page](https://github.com/ethereumproject/go-ethereum/wiki/Release-3.4.0-Notes). - -### Full node on the main Ethereum network - -``` -$ geth -``` - -It's that easy! This will establish an ETC blockchain node and download ("sync") the full blocks for the entirety of the ETC blockchain. __However__, before you go ahead with plain ol' `geth`, we would encourage reviewing the following section... - -#### :speedboat: `--fast` - -The most common scenario is users wanting to simply interact with the Ethereum Classic network: create accounts; transfer funds; deploy and interact with contracts, and mine. For this particular use-case the user doesn't care about years-old historical data, so we can _fast-sync_ to the current state of the network. To do so: - -``` -$ geth --fast -``` - -Using geth in fast sync mode causes it to download only block _state_ data -- leaving out bulky transaction records -- which avoids a lot of CPU and memory intensive processing. - -Fast sync will be automatically __disabled__ (and full sync enabled) when: - -- your chain database contains *any* full blocks -- your node has synced up to the current head of the network blockchain - -In case of using `--mine` together with `--fast`, geth will operate as described; syncing in fast mode up to the head, and then begin mining once it has synced its first full block at the head of the chain. - -*Note:* To further increase geth's performace, you can use a `--cache=2054` flag to bump the memory allowance of the database (e.g. 2054MB) which can significantly improve sync times, especially for HDD users. This flag is optional and you can set it as high or as low as you'd like, though we'd recommend the 1GB - 2GB range. - -### Create or manage account(s) - -Geth is able to create, import, update, unlock, and otherwise manage your private (encrypted) key files. Key files are in JSON format and, by default, stored in the respective chain folder's `/keystore` directory; you can specify a custom location with the `--keystore` flag. - -``` -$ geth account new -``` - -This command will create a new account and prompt you to enter a passphrase to protect your account. - -Other `account` subcommands include: -``` -SUBCOMMANDS: - - list print account addresses - new create a new account - update update an existing account - import import a private key into a new account - -``` - -Learn more at the [Accounts Wiki Page](https://github.com/ethereumproject/go-ethereum/wiki/Managing-Accounts). If you're interested in using geth to manage a lot (~100,000+) of accounts, please visit the [Indexing Accounts Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Indexing-Accounts). - - -### Interact with the Javascript console -``` -$ geth console -``` - -This command will start up Geth's built-in interactive [JavaScript console](https://github.com/ethereumproject/go-ethereum/wiki/JavaScript-Console), through which you can invoke all official [`web3` methods](https://github.com/ethereumproject/wiki/wiki/JavaScript-API) as well as Geth's own [management APIs](https://github.com/ethereumproject/go-ethereum/wiki/Management-APIs). This too is optional and if you leave it out you can always attach to an already running Geth instance with `geth attach`. - -Learn more at the [Javascript Console Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/JavaScript-Console). - - -### And so much more! - -For a comprehensive list of command line options, please consult our [CLI Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options). - -## :orange_book: Geth: developing and advanced useage - -### Morden Testnet -If you'd like to play around with creating Ethereum contracts, you -almost certainly would like to do that without any real money involved until you get the hang of the entire system. In other words, instead of attaching to the main network, you want to join the **test** network with your node, which is fully equivalent to the main network, but with play-Ether only. - -``` -$ geth --chain=morden --fast console -``` - -The `--fast` flag and `console` subcommand have the exact same meaning as above and they are equally useful on the testnet too. Please see above for their explanations if you've skipped to here. - -Specifying the `--chain=morden` flag will reconfigure your Geth instance a bit: - - - As mentioned above, Geth will host its testnet data in a `morden` subfolder (`~/.ethereum-classic/morden`). - - Instead of connecting the main Ethereum network, the client will connect to the test network, which uses different P2P bootnodes, different network IDs and genesis states. - -You may also optionally use `--testnet` or `--chain=testnet` to enable this configuration. - -> *Note: Although there are some internal protective measures to prevent transactions from crossing over between the main network and test network (different starting nonces), you should make sure to always use separate accounts for play-money and real-money. Unless you manually move accounts, Geth -will by default correctly separate the two networks and will not make any accounts available between them.* - -### Programatically interfacing Geth nodes - -As a developer, sooner rather than later you'll want to start interacting with Geth and the Ethereum network via your own programs and not manually through the console. To aid this, Geth has built in support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereumproject/wiki/wiki/JSON-RPC) and -[Geth specific APIs](https://github.com/ethereumproject/go-ethereum/wiki/Management-APIs)). These can be exposed via HTTP, WebSockets and IPC (unix sockets on unix based platroms, and named pipes on Windows). - -The IPC interface is enabled by default and exposes all the APIs supported by Geth, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect. - -HTTP based JSON-RPC API options: - - * `--rpc` Enable the HTTP-RPC server - * `--rpc-addr` HTTP-RPC server listening interface (default: "localhost") - * `--rpc-port` HTTP-RPC server listening port (default: 8545) - * `--rpc-api` API's offered over the HTTP-RPC interface (default: "eth,net,web3") - * `--rpc-cors-domain` Comma separated list of domains from which to accept cross origin requests (browser enforced) - * `--ws` Enable the WS-RPC server - * `--ws-addr` WS-RPC server listening interface (default: "localhost") - * `--ws-port` WS-RPC server listening port (default: 8546) - * `--ws-api` API's offered over the WS-RPC interface (default: "eth,net,web3") - * `--ws-origins` Origins from which to accept websockets requests - * `--ipc-disable` Disable the IPC-RPC server - * `--ipc-api` API's offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3") - * `--ipc-path` Filename for IPC socket/pipe within the datadir (explicit paths escape it) - -You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect via HTTP, WS or IPC to a Geth node configured with the above flags and you'll need to speak [JSON-RPC](http://www.jsonrpc.org/specification) on all transports. You can reuse the same connection for multiple requests! - -> Note: Please understand the security implications of opening up an HTTP/WS based transport before doing so! Hackers on the internet are actively trying to subvert Ethereum nodes with exposed APIs! Further, all browser tabs can access locally running webservers, so malicious webpages could try to subvert locally available APIs!* - -### Operating a private/custom network - -As of [Geth 3.4](https://github.com/ethereumproject/go-ethereum/releases) you are now able to configure a private chain by specifying an __external chain configuration__ JSON file, which includes necessary genesis block data as well as feature configurations for protocol forks, bootnodes, and chainID. - -Please find full [example external configuration files representing the Mainnet and Morden Testnet specs in the /config subdirectory of this repo](). You can use either of these files as a starting point for your own customizations. - -It is important for a private network that all nodes use compatible chains. In the case of custom chain configuration, the chain configuration file (`chain.json`) should be equivalent for each node. - -#### Define external chain configuration - -Specifying an external chain configuration file will allow fine-grained control over a custom blockchain/network configuration, including the genesis state and extending through bootnodes and fork-based protocol upgrades. - -```shell -$ geth --chain=morden dump-chain-config /customnet/chain.json -$ sed s/mainnet/customnet/ /customnet/chain.json -$ vi /customnet/chain.json # make your custom edits -$ geth --chain=customnet [--flags] [command] -``` - -The external chain configuration file specifies valid settings for the following top-level fields: - -| JSON Key | Notes | -| --- | --- | -| `chainID` | Chain identity. Determines local __/subdir__ for chain data, with required `chain.json` located in it. It is required, but must not be identical for each node. Please note that this is _not_ the chainID validation introduced in _EIP-155_; that is configured as a protocal upgrade within `forks.features`. | -| `name` | _Optional_. Human readable name, ie _Ethereum Classic Mainnet_, _Morden Testnet._ | -| `state.startingNonce` | _Optional_. Initialize state db with a custom nonce. | -| `network` | Determines Network ID to identify valid peers. | -| `consensus` | _Optional_. Proof of work algorithm to use, either "ethash" or "ethast-test" (for development) | -| `genesis` | Determines __genesis state__. If running the node for the first time, it will write the genesis block. If configuring an existing chain database with a different genesis block, it will overwrite it. | -| `chainConfig` | Determines configuration for fork-based __protocol upgrades__, ie _EIP-150_, _EIP-155_, _EIP-160_, _ECIP-1010_, etc ;-). Subkeys are `forks` and `badHashes`. | -| `bootstrap` | _Optional_. Determines __bootstrap nodes__ in [enode format](https://github.com/ethereumproject/wiki/wiki/enode-url-format). | -| `include` | _Optional_. Other configuration files to include. Paths can be relative (to the config file with `include` field, or absolute). Each of configuration files has the same structure as "main" configuration. Included files are processed after the "main" configuration in the same order as specified in the array; values processed later overwrite the previously defined ones. | - - -*Fields `name`, `state.startingNonce`, and `consensus` are optional. Geth will panic if any required field is missing, invalid, or in conflict with another flag. This renders `--chain` __incompatible__ with `--testnet`. It remains __compatible__ with `--data-dir`.* - -To learn more about external chain configuration, please visit the [External Command Line Options Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options). - -##### Create the rendezvous point - -Once all participating nodes have been initialized to the desired genesis state, you'll need to start a __bootstrap node__ that others can use to find each other in your network and/or over the internet. The clean way is to configure and run a dedicated bootnode: - -``` -$ bootnode --genkey=boot.key -$ bootnode --nodekey=boot.key -``` - -With the bootnode online, it will display an `enode` URL that other nodes can use to connect to it and exchange peer information. Make sure to replace the -displayed IP address information (most probably `[::]`) with your externally accessible IP to get the actual `enode` URL. - -*Note: You could also use a full fledged Geth node as a bootnode, but it's the less recommended way.* - -To learn more about enodes and enode format, visit the [Enode Wiki page](https://github.com/ethereumproject/wiki/wiki/enode-url-format). - -##### Starting up your member nodes - -With the bootnode operational and externally reachable (you can try `telnet ` to ensure it's indeed reachable), start every subsequent Geth node pointed to the bootnode for peer discovery via the `--bootnodes` flag. It will probably be desirable to keep private network data separate from defaults; to do so, specify a custom `--datadir` and/or `--chain` flag. - -``` -$ geth --datadir=path/to/custom/data/folder \ - --chain=kittynet \ - --bootnodes= -``` - -*Note: Since your network will be completely cut off from the main and test networks, you'll also need to configure a miner to process transactions and create new blocks for you.* - -#### Running a private miner - -Mining on the public Ethereum network is a complex task as it's only feasible using GPUs, requiring an OpenCL or CUDA enabled `ethminer` instance. For information on such a setup, please consult the [EtherMining subreddit](https://www.reddit.com/r/EtherMining/) and the [Genoil miner](https://github.com/Genoil/cpp-ethereum) repository. - -In a private network setting however, a single CPU miner instance is more than enough for practical purposes as it can produce a stable stream of blocks at the correct intervals without needing heavy resources (consider running on a single thread, no need for multiple ones either). To start a Geth instance for mining, run it with all your usual flags, extended by: - -``` -$ geth --mine --minerthreads=1 --etherbase=0x0000000000000000000000000000000000000000 -``` - -Which will start mining blocks and transactions on a single CPU thread, crediting all proceedings to the account specified by `--etherbase`. You can further tune the mining by changing the default gas limit blocks converge to (`--targetgaslimit`) and the price transactions are accepted at (`--gasprice`). - -For more information about managing accounts, please see the [Managing Accounts Wiki page](https://github.com/ethereumproject/go-ethereum/wiki/Managing-Accounts). - - -## Contribution - -Thank you for considering to help out with the source code! - -The core values of democratic engagement, transparency, and integrity run deep with us. We welcome contributions from everyone, and are grateful for even the smallest of fixes. :clap: - -This project is migrated from the now hard-forked [Ethereum (ETHF) Github project](https://github.com/ethereum), and we will need to incrementally migrate pieces of the infrastructure required to maintain the project. - -If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes, please check up with the core devs first on [our Slack channel (#development)](http://ethereumclassic.herokuapp.com/) or [our Discord channel (#development)](https://discord.gg/wpwSGWn) to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. - -Please see the [Wiki](https://github.com/ethereumproject/go-ethereum/wiki) for more details on configuring your environment, managing project dependencies, and testing procedures. - -## License - -The go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the [GNU Lesser General Public License v3.0](http://www.gnu.org/licenses/lgpl-3.0.en.html), also included in our repository in the `COPYING.LESSER` file. +Of note: +- if you smell hack, it's because there is hack +- the genesis and chain config setup "bootstraps itself" by reading a default config -The go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the [GNU General Public License v3.0](http://www.gnu.org/licenses/gpl-3.0.en.html), also included in our repository in the `COPYING` file. From 317f0361e21b9105450c705ec0fcf85f7cd1cc38 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:25:22 -0500 Subject: [PATCH 08/30] include instructions for test js --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0a963ff6..26e2fa053 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,26 @@ )](https://godoc.org/github.com/ethereumproject/go-ethereum) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereumproject/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +### Instructions + Start geth with: - `rm -rf` ing old development files w/ each rerun - new `--ezdev` flag - `--sputnikvm` for demonstration - `--keystore` for demonstrating a custom keystore dir. This is the directory in which keyfiles live. If there are NO keyfiles in this dir, then EZDev :registered: will generate 10 keys, each with password `foo`. If there ARE ANY key files in this dir, then geth will not generate any new files, and will endow those accounts with substantial premine balances (`10000000000000000000000000000000wei`) in the genesis block. This directory can be anywhere. -``` + +```shell $ cd go-ethereum $ make cmd/geth && rm -rf ./keys && rm -rf ~/.ethereum-classic/ezdev && ./bin/geth --ezdev --sputnikvm --keystore ./keys ``` -Of note: +Then, in another session let's test out the automine feature. + +```shell +$ ./bin/geth --chain ezdev --preload test.js attach +``` + +### Of note: - if you smell hack, it's because there is hack - the genesis and chain config setup "bootstraps itself" by reading a default config From ecaf62085449caa19fa1fe4ea02cc49ce92c6a9d Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:25:44 -0500 Subject: [PATCH 09/30] only write main config file when not present --- cmd/geth/ezdev.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index c0227bff9..086ad3ac2 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -73,10 +73,14 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { } } - // marshal and write config json - if err := config.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { - return err + // marshal and write config json IFF it doesn't already exist + if _, err := os.Stat(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil && os.IsNotExist(err) { + + if err := config.WriteToJSONFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")); err != nil { + return err + } } + // marshal and write dev_genesis.json genC, err := json.MarshalIndent(struct { Genesis *core.GenesisDump `json:"genesis"` @@ -88,9 +92,10 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { return err } - // write alloc file + // write alloc file, ALWAYS, because these never change and it's just extra logic, even though it would seem more right to care if the file already exists or not ioutil.WriteFile(filepath.Join(MustMakeChainDataDir(ctx), "dev_genesis_alloc.csv"), data, os.ModePerm) + // again.. hacky. maybe unnecessary. cc, err := core.ReadExternalChainConfigFromFile(filepath.Join(MustMakeChainDataDir(ctx), "chain.json")) if err != nil { panic(err) From 1f2247244f2c7ff4c3e1d6bd067b836c10a52300 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:45:52 -0500 Subject: [PATCH 10/30] problem: ezdev overwrites config each run solution: only write ezdev info (config, keys, gen) --- cmd/geth/ezdev.go | 10 ++++++++-- cmd/geth/flag.go | 36 +++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index 086ad3ac2..9bd1c272a 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -20,6 +20,11 @@ func setCTXDefault(ctx *cli.Context, name, val string) { } } +func setEZDevFlags(ctx *cli.Context) { + setCTXDefault(ctx, NoDiscoverFlag.Name, "true") + setCTXDefault(ctx, LightKDFFlag.Name, "true") +} + func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { glog.Errorln("Initializing EZDEV...") @@ -27,8 +32,6 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { // copy dev.json, dev_genesis.json, dev_genesis_allow.csv to datadir/ezdev/{ chain, dev_genesis, dev_genesis_alloc }.json/csv, // init 10 accounts with password 'foo' // add these accounts to genesis alloc csv - setCTXDefault(ctx, NoDiscoverFlag.Name, "true") - setCTXDefault(ctx, LightKDFFlag.Name, "true") config.Include = []string{"dev_genesis.json"} @@ -38,6 +41,9 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { config.Genesis = nil cg.AllocFile = "dev_genesis_alloc.csv" + // because this cli ctx is weird and accounts seem slower to generate if this isn't here + setEZDevFlags(ctx) + // cc.Genesis = cg // make some accounts accman := MakeAccountManager(ctx) diff --git a/cmd/geth/flag.go b/cmd/geth/flag.go index 216c4cbbd..916814265 100644 --- a/cmd/geth/flag.go +++ b/cmd/geth/flag.go @@ -488,17 +488,15 @@ func MakeSystemNode(version string, ctx *cli.Context) *node.Node { miner.HeaderExtra = []byte(s) } + if ctx.GlobalBool(EZDevModeFlag.Name) { + setEZDevFlags(ctx) + } + // Makes sufficient configuration from JSON file or DB pending flags. // Delegates flag usage. config := mustMakeSufficientChainConfig(ctx) logChainConfiguration(ctx, config) - if ctx.GlobalBool(EZDevModeFlag.Name) { - if err := setupEZDev(ctx, config); err != nil { - log.Fatal(err) - } - } - // Configure the Ethereum service ethConf := mustMakeEthConf(ctx, config) @@ -707,20 +705,26 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig state.StartingNonce = state.DefaultTestnetStartingNonce // (2**20) } return config - } else if ctx.GlobalBool(EZDevModeFlag.Name) { - glog.Errorln("setting EZDEV suffconf...") - c := core.DefaultConfigEZDev - if c.State != nil { - state.StartingNonce = c.State.StartingNonce - } - return c } + // else if ctx.GlobalBool(EZDevModeFlag.Name) { + // glog.Errorln("setting EZDEV suffconf...") + // c := core.DefaultConfigEZDev + // if c.State != nil { + // state.StartingNonce = c.State.StartingNonce + // } + // return c + // } // Returns surely valid suff chain config. chainDir := MustMakeChainDataDir(ctx) defaultChainConfigPath := filepath.Join(chainDir, "chain.json") if _, de := os.Stat(defaultChainConfigPath); de != nil && os.IsNotExist(de) { - glog.Fatalf(`%v: %v + if ctx.GlobalBool(EZDevModeFlag.Name) { + if err := setupEZDev(ctx, core.DefaultConfigEZDev); err != nil { + panic(err) + } + } else { + glog.Fatalf(`%v: %v It looks like you haven't set up your custom chain yet... Here's a possible workflow for that: @@ -728,8 +732,10 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig $ sed -i.bak s/morden/%v/ %v/chain.json $ vi %v/chain.json # <- make your customizations `, core.ErrChainConfigNotFound, defaultChainConfigPath, - chainDir, chainIdentity, chainDir, chainDir) + chainDir, chainIdentity, chainDir, chainDir) + } } + glog.D(logger.Warn).Infoln("Reading chain config from", defaultChainConfigPath) config, err := core.ReadExternalChainConfigFromFile(defaultChainConfigPath) if err != nil { glog.Fatalf(`invalid external configuration JSON: '%v': %v From afdb01da85464af49c2d59f6e36c758cfbc78c28 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:47:30 -0500 Subject: [PATCH 11/30] add link for test js to make obvious --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 26e2fa053..ce31d591e 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Then, in another session let's test out the automine feature. $ ./bin/geth --chain ezdev --preload test.js attach ``` +[./test.js](./test.js) + ### Of note: - if you smell hack, it's because there is hack - the genesis and chain config setup "bootstraps itself" by reading a default config From 979bad2d685c0738ce7e31dbbbb39f1b136baf8a Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:54:40 -0500 Subject: [PATCH 12/30] shane wants no passwords --- cmd/geth/ezdev.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index 9bd1c272a..0dc857d5e 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -51,7 +51,7 @@ func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { bal := "10000000000000000000000000000000" if len(accman.Accounts()) == 0 { glog.D(logger.Warn).Infoln("No existing EZDEV accounts found, creating 10") - password := "foo" + password := "" // accounts := []accounts.Account{} for i := 0; i < 10; i++ { acc, err := accman.NewAccount(password) From 97959baa068b84819b4b13f361d4199be10eaf86 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 14:57:00 -0500 Subject: [PATCH 13/30] make chainid 69 2 :floppy_disk: --- core/assets/assets.go | 4 ++-- core/config/dev.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/assets/assets.go b/core/assets/assets.go index 719fb7117..e2fd5d0d0 100644 --- a/core/assets/assets.go +++ b/core/assets/assets.go @@ -294,7 +294,7 @@ func init() { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x22, - 0x3a, 0x20, 0x36, 0x32, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x3a, 0x20, 0x36, 0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, @@ -421,7 +421,7 @@ func init() { fi: FileInfo{ name: "dev.json", size: 3333, - modTime: time.Unix(0, 1542806932597996283), + modTime: time.Unix(0, 1542830212835744575), isDir: false, }, }, "/core/config/dev_bootnodes.json": File{ diff --git a/core/config/dev.json b/core/config/dev.json index f6b56967d..9a70b81d3 100644 --- a/core/config/dev.json +++ b/core/config/dev.json @@ -54,7 +54,7 @@ { "id": "eip155", "options": { - "chainID": 62 + "chainID": 69 } }, { From 56406bc6e86bc29b2806defb12ce42ee1ad18cae Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 15:02:46 -0500 Subject: [PATCH 14/30] make readme more legible --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index ce31d591e..dcf0b49d1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,4 @@ -[![MacOS Build Status](https://circleci.com/gh/ethereumproject/go-ethereum/tree/master.svg?style=shield)](https://circleci.com/gh/ethereumproject/go-ethereum/tree/master) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/ethereumproject/go-ethereum?svg=true)](https://ci.appveyor.com/project/splix/go-ethereum) -[![Go Report Card](https://goreportcard.com/badge/github.com/ethereumproject/go-ethereum)](https://goreportcard.com/report/github.com/ethereumproject/go-ethereum) -[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 -)](https://godoc.org/github.com/ethereumproject/go-ethereum) -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereumproject/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +# README ### Instructions From 94b2e4b22db4fa8b8087ecc1a6fac9b1f7584d79 Mon Sep 17 00:00:00 2001 From: ia Date: Wed, 21 Nov 2018 15:03:56 -0500 Subject: [PATCH 15/30] remove very verbose block logger --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index f2a6ecb2b..7fa4f5e15 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -300,7 +300,7 @@ func (self *worker) wait() { block := result.Block work := result.Work - glog.D(logger.Error).Infoln("got result", block, work) + // glog.D(logger.Error).Infoln("got result", block, work) if self.fullValidation { glog.D(logger.Error).Infoln("full") if res := self.chain.InsertChain(types.Blocks{block}); res.Error != nil { From 687bd2c2994064939e2c982ec1d3c8ee6d626ea0 Mon Sep 17 00:00:00 2001 From: ia Date: Thu, 22 Nov 2018 07:04:19 -0500 Subject: [PATCH 16/30] fix maybe it wasn't automining... adjusting test.js to send moar txs' --- cmd/geth/flag.go | 38 +++++++++++++++----------------------- core/config.go | 2 -- miner/worker.go | 2 ++ test.js | 38 ++++++++++++++++++++++++++------------ 4 files changed, 43 insertions(+), 37 deletions(-) diff --git a/cmd/geth/flag.go b/cmd/geth/flag.go index 916814265..412bd028e 100644 --- a/cmd/geth/flag.go +++ b/cmd/geth/flag.go @@ -130,8 +130,6 @@ func copyChainConfigFileToChainDataDir(ctx *cli.Context, identity, configFilePat return nil } -// var localChainId string - // getChainIdentity parses --chain and --testnet (legacy) flags. // It will fatal if finds notok value. // It returns one of valid strings: ["mainnet", "morden", or --chain="flaggedCustom"] @@ -139,9 +137,7 @@ func mustMakeChainIdentity(ctx *cli.Context) (identity string) { if id := core.GetCacheChainIdentity(); id != "" { return id - } // else if localChainId != "" { - // return localChainId - // } + } if ctx.GlobalIsSet(aliasableName(TestNetFlag.Name, ctx)) && ctx.GlobalIsSet(aliasableName(ChainIdentityFlag.Name, ctx)) { glog.Fatalf(`%v: used redundant/conflicting flags: --%v, --%v @@ -150,8 +146,6 @@ func mustMakeChainIdentity(ctx *cli.Context) (identity string) { } defer func() { - glog.Error("chain set identity", identity) - // localChainId = identity core.SetCacheChainIdentity(identity) }() @@ -491,6 +485,11 @@ func MakeSystemNode(version string, ctx *cli.Context) *node.Node { if ctx.GlobalBool(EZDevModeFlag.Name) { setEZDevFlags(ctx) } + if ctx.GlobalBool(EZDevModeFlag.Name) { + if err := setupEZDev(ctx, core.DefaultConfigEZDev); err != nil { + panic(err) + } + } // Makes sufficient configuration from JSON file or DB pending flags. // Delegates flag usage. @@ -705,26 +704,20 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig state.StartingNonce = state.DefaultTestnetStartingNonce // (2**20) } return config + } else if ctx.GlobalBool(EZDevModeFlag.Name) { + glog.Errorln("setting EZDEV suffconf...") + c := core.DefaultConfigEZDev + if c.State != nil { + state.StartingNonce = c.State.StartingNonce + } + return c } - // else if ctx.GlobalBool(EZDevModeFlag.Name) { - // glog.Errorln("setting EZDEV suffconf...") - // c := core.DefaultConfigEZDev - // if c.State != nil { - // state.StartingNonce = c.State.StartingNonce - // } - // return c - // } // Returns surely valid suff chain config. chainDir := MustMakeChainDataDir(ctx) defaultChainConfigPath := filepath.Join(chainDir, "chain.json") if _, de := os.Stat(defaultChainConfigPath); de != nil && os.IsNotExist(de) { - if ctx.GlobalBool(EZDevModeFlag.Name) { - if err := setupEZDev(ctx, core.DefaultConfigEZDev); err != nil { - panic(err) - } - } else { - glog.Fatalf(`%v: %v + glog.Fatalf(`%v: %v It looks like you haven't set up your custom chain yet... Here's a possible workflow for that: @@ -732,8 +725,7 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig $ sed -i.bak s/morden/%v/ %v/chain.json $ vi %v/chain.json # <- make your customizations `, core.ErrChainConfigNotFound, defaultChainConfigPath, - chainDir, chainIdentity, chainDir, chainDir) - } + chainDir, chainIdentity, chainDir, chainDir) } glog.D(logger.Warn).Infoln("Reading chain config from", defaultChainConfigPath) config, err := core.ReadExternalChainConfigFromFile(defaultChainConfigPath) diff --git a/core/config.go b/core/config.go index d7902072e..3c790275e 100644 --- a/core/config.go +++ b/core/config.go @@ -495,9 +495,7 @@ func resolvePath(path, parentOrAdjacentPath string) string { } func parseAllocationFile(config *SufficientChainConfig, open func(string) (io.ReadCloser, error), currentFile string) error { - glog.Errorln(" ** parsing alloc file") if config.Genesis == nil || config.Genesis.AllocFile == "" { - glog.Errorln(" ** returning ") return nil } diff --git a/miner/worker.go b/miner/worker.go index 7fa4f5e15..61a5d608c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -225,6 +225,7 @@ func (self *worker) unregister(agent Agent) { func (self *worker) update() { if self.config.Automine { + glog.D(logger.Warn).Infoln("miner worker updating:", "AUTOMINE") for event := range self.events.Chan() { switch ev := event.Data.(type) { case core.ChainHeadEvent: @@ -250,6 +251,7 @@ func (self *worker) update() { } } } else { + glog.D(logger.Warn).Infoln("miner worker updating:", "NORMALMINE") for event := range self.events.Chan() { // A real event arrived, process interesting content switch ev := event.Data.(type) { diff --git a/test.js b/test.js index ceb5279c5..969b9b33f 100644 --- a/test.js +++ b/test.js @@ -1,16 +1,30 @@ -var a = { - a: function() {personal.unlockAccount(eth.accounts[0])}, - b: miner.start, - c: function() {eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(1.33, "ether")}); } -}; - -a.a() -a.b() - -a.c() -a.c() -a.c() +// a function that unlocks all accounts +function unlockall() { + for (var i = 0; i < eth.accounts.length; i++) { + personal.unlockAccount(eth.accounts[i], ""); + } + console.log("unlocked all owned accounts"); +} + +// a function that makes a lot of transactions +function ntxs(n) { + for (var i = 0; i < n; i++) { + var txh = eth.sendTransaction({from: eth.accounts[i%eth.accounts.length], to: eth.accounts[(i%eth.accounts.length)+1], value: web3.toWei(1.33, "ether")}); + console.log("tx", i, "pending", eth.pendingTransactions.length, ": ", txh); + } +} + + +unlockall(); + +// note that miner.start() MUST be called prior to processing any txs +miner.start(); + +ntxs(); + + + From 56281fc7ba18c1057e7f9b2ee946e6ad59ae3b0d Mon Sep 17 00:00:00 2001 From: ia Date: Thu, 22 Nov 2018 07:12:30 -0500 Subject: [PATCH 17/30] problem: nil pointer on worker work and blockWithMiningREsult --- miner/worker.go | 13 +++++++++++-- test.js | 10 ++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 61a5d608c..4a93b6c02 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -242,8 +242,17 @@ func (self *worker) update() { self.current.commitTransactions(self.mux, types.Transactions{ev.Tx}, self.gasPrice, self.chain) self.currentMu.Unlock() } else { - b := &Result{self.current, self.autominer.Win(self.current)} - // glog.D(logger.Warn).Infoln("b=", b) + var ww *Work + for ww == nil { + ww = self.current + } + var w *types.Block + for w == nil { + if ww.Block != nil { + w = self.autominer.Win(ww) + } + } + b := &Result{ww, w} glog.D(logger.Warn).Infoln("b <-", b.Block.Hash().Hex(), b.Block.Nonce(), b.Block.MixDigest().Hex()) self.recv <- b } diff --git a/test.js b/test.js index 969b9b33f..27512c9df 100644 --- a/test.js +++ b/test.js @@ -2,15 +2,17 @@ // a function that unlocks all accounts function unlockall() { for (var i = 0; i < eth.accounts.length; i++) { - personal.unlockAccount(eth.accounts[i], ""); + var a = eth.accounts[i] + personal.unlockAccount(a, ""); + console.log("unlocked", a); } - console.log("unlocked all owned accounts"); + console.log("unlocked all owned accounts"); } // a function that makes a lot of transactions function ntxs(n) { for (var i = 0; i < n; i++) { - var txh = eth.sendTransaction({from: eth.accounts[i%eth.accounts.length], to: eth.accounts[(i%eth.accounts.length)+1], value: web3.toWei(1.33, "ether")}); + var txh = eth.sendTransaction({from: eth.accounts[i%eth.accounts.length], to: eth.accounts[(i%eth.accounts.length)+1], value: web3.toWei(0.33, "ether")}); console.log("tx", i, "pending", eth.pendingTransactions.length, ": ", txh); } } @@ -21,7 +23,7 @@ unlockall(); // note that miner.start() MUST be called prior to processing any txs miner.start(); -ntxs(); +ntxs(10000); From 2a5be9c8d9e924de35a1d724056b1d774127e679 Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 08:41:10 -0500 Subject: [PATCH 18/30] remove scrap file --- core/config/dev_morden.json | 109 ------------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 core/config/dev_morden.json diff --git a/core/config/dev_morden.json b/core/config/dev_morden.json deleted file mode 100644 index 5b1fac163..000000000 --- a/core/config/dev_morden.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "identity": "EZDEV", - "name": "EZDEV Client", - "state": { - "startingNonce": 1048576 - }, - "network": 69, - "consensus": "ethash-test", - "chainConfig": { - "forks": [ - { - "name": "Homestead", - "block": 0, - "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "features": [ - { - "id": "difficulty", - "options": { - "type": "homestead" - } - }, - { - "id": "gastable", - "options": { - "type": "homestead" - } - } - ] - }, - { - "name": "GasReprice", - "block": 0, - "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "features": [ - { - "id": "gastable", - "options": { - "type": "eip150" - } - } - ] - }, - { - "name": "The DAO Hard Fork", - "block": 0, - "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "features": [] - }, - { - "name": "Diehard", - "block": 0, - "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "features": [ - { - "id": "eip155", - "options": { - "chainID": 62 - } - }, - { - "id": "gastable", - "options": { - "type": "eip160" - } - }, - { - "id": "difficulty", - "options": { - "length": 2000000, - "type": "ecip1010" - } - } - ] - }, - { - "name": "Gotham", - "block": 0, - "requiredHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "features": [ - { - "id": "reward", - "options": { - "era": 2000000, - "type": "ecip1017" - } - } - ] - }, - { - "name": "Defuse Difficulty Bomb", - "block": 0, - "features": [ - { - "id": "difficulty", - "options": { - "type": "defused" - } - } - ] - } - ], - "badHashes": [ - ] - }, - "include" : [ - "dev_genesis.json", - "dev_bootnodes.json" - ] -} From dab83cf9872b7f0e30a7a6c577429f861a50a31c Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:12:08 -0500 Subject: [PATCH 19/30] add block write stat to NewMinedBlockEvent --- cmd/geth/log_display_basic.go | 2 +- core/blockchain.go | 13 +++++++++++++ core/events.go | 5 ++++- miner/worker.go | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/cmd/geth/log_display_basic.go b/cmd/geth/log_display_basic.go index 18ed96f31..bc760c020 100644 --- a/cmd/geth/log_display_basic.go +++ b/cmd/geth/log_display_basic.go @@ -57,7 +57,7 @@ var basicDisplaySystem = displayEventHandlers{ switch d := evData.(type) { case core.NewMinedBlockEvent: glog.D(logger.Warn).Infof(basicScanLn, - "Mined", + "Mined "+d.Stat.String(), formatBlockNumber(d.Block.NumberU64()), d.Block.Hash().Hex()[2:2+len(xlocalHeadHashD)], fmt.Sprintf("%3d/%2d", d.Block.Transactions().Len(), new(big.Int).Div(d.Block.GasUsed(), big.NewInt(1000000)).Int64()), diff --git a/core/blockchain.go b/core/blockchain.go index abc0c9296..4d3ae4ec0 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1197,6 +1197,19 @@ const ( SideStatTy ) +func (w WriteStatus) String() string { + switch w { + case NonStatTy: + return "non" + case CanonStatTy: + return "canon" + case SideStatTy: + return "side" + default: + panic("unreachable") + } +} + // Rollback is designed to remove a chain of links from the database that aren't // certain enough to be valid. func (bc *BlockChain) Rollback(chain []common.Hash) { diff --git a/core/events.go b/core/events.go index 0e752831a..63528b1d9 100644 --- a/core/events.go +++ b/core/events.go @@ -44,7 +44,10 @@ type PendingStateEvent struct{} type NewBlockEvent struct{ Block *types.Block } // NewMinedBlockEvent is posted when a block has been imported. -type NewMinedBlockEvent struct{ Block *types.Block } +type NewMinedBlockEvent struct { + Block *types.Block + Stat WriteStatus +} // RemovedTransactionEvent is posted when a reorg happens type RemovedTransactionEvent struct{ Txs types.Transactions } diff --git a/miner/worker.go b/miner/worker.go index 4a93b6c02..363dd1455 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -365,7 +365,7 @@ func (self *worker) wait() { // broadcast before waiting for validation go func(block *types.Block, logs vm.Logs, receipts []*types.Receipt) { - self.mux.Post(core.NewMinedBlockEvent{Block: block}) + self.mux.Post(core.NewMinedBlockEvent{Block: block, Stat: stat}) self.mux.Post(core.ChainEvent{Block: block, Hash: block.Hash(), Logs: logs}) if stat == core.CanonStatTy { From 544eadb7599fce4aa039c98857ce1f4bca98546b Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:13:28 -0500 Subject: [PATCH 20/30] test.js: add loggers and time meters --- test.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/test.js b/test.js index 27512c9df..813b261f6 100644 --- a/test.js +++ b/test.js @@ -1,29 +1,42 @@ +// note that miner.start() MUST be called prior to processing any txs +miner.start(); // a function that unlocks all accounts function unlockall() { + console.log("Unlocking all accounts", "bn=", eth.blockNumber); for (var i = 0; i < eth.accounts.length; i++) { var a = eth.accounts[i] personal.unlockAccount(a, ""); - console.log("unlocked", a); + // console.log("unlocked", a, "bal=", eth.getBalance(a), "#txs=", geth.getTransactionsByAddress(a, 0, 'latest', 'tf', 's', 0, -1, false).length); + console.log("unlocked", a, "bal=", eth.getBalance(a)); } console.log("unlocked all owned accounts"); } // a function that makes a lot of transactions function ntxs(n) { + var d = new Date(); + var nn = 0; + var txps = 0; for (var i = 0; i < n; i++) { + var bn = eth.blockNumber; var txh = eth.sendTransaction({from: eth.accounts[i%eth.accounts.length], to: eth.accounts[(i%eth.accounts.length)+1], value: web3.toWei(0.33, "ether")}); - console.log("tx", i, "pending", eth.pendingTransactions.length, ": ", txh); + nn++; + console.log("tx n=", i, "bn=", eth.blockNumber, "tx_pool.pending=", eth.pendingTransactions.length, "tx/s=", txps, txh.substring(0,8)); + var dd = new Date(); + if (dd.getSeconds() > d.getSeconds()) { + d = dd; + txps = nn; + nn = 0; + } } } unlockall(); -// note that miner.start() MUST be called prior to processing any txs -miner.start(); -ntxs(10000); +// ntxs(10000); From 506b8fdc872d7a9f3ffe9d04b78c83992877f9e3 Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:14:40 -0500 Subject: [PATCH 21/30] problem: tx/block creation stalls for 5 seconds solution: allow future blocks when automining --- miner/worker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index 363dd1455..5aac09df9 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -516,11 +516,15 @@ func (self *worker) commitNewWork() { tstart := time.Now() parent := self.chain.CurrentBlock() tstamp := tstart.Unix() + + // compare parent time and ~now time (tstamp), + // if parent time is greater than or the same as tstamp, + // then set stamp to be one second after parent if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) >= 0 { tstamp = parent.Time().Int64() + 1 } // this will ensure we're not going off too far in the future - if now := time.Now().Unix(); tstamp > now+4 { + if now := time.Now().Unix(); tstamp > now+4 && !self.config.Automine { wait := time.Duration(tstamp-now) * time.Second glog.V(logger.Info).Infoln("We are too far in the future. Waiting for", wait) time.Sleep(wait) From 1f1605fba757f2dabecf15d19818174ba5862e1c Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:15:18 -0500 Subject: [PATCH 22/30] problem: decoding genesis address fails occasionally solution: allow 0x and non-0x prefixed hashes --- core/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/config.go b/core/config.go index 3c790275e..ea670e7c1 100644 --- a/core/config.go +++ b/core/config.go @@ -740,7 +740,9 @@ func WriteGenesisBlock(chainDb ethdb.Database, genesis *GenesisDump) (*types.Blo for addrHex, account := range genesis.Alloc { var addr common.Address if err := addrHex.Decode(addr[:]); err != nil { - return nil, fmt.Errorf("malformed addres %q: %s", addrHex, err) + if err = addrHex[2:].Decode(addr[:]); err != nil { + return nil, fmt.Errorf("malformed addres %q: %s", addrHex, err) + } } balance, ok := new(big.Int).SetString(account.Balance, 0) From adf0b2c8bebe9f58fb2720ce6b9995aae51037df Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:15:51 -0500 Subject: [PATCH 23/30] problem@txpool: current state getting errors should log to error logs solution: change verbosity and level --- core/tx_pool.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index 2c669abb4..e87179234 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -111,7 +111,6 @@ func (pool *TxPool) eventLoop() { if ev.Block != nil && pool.config.IsHomestead(ev.Block.Number()) { pool.homestead = true } - pool.resetState() pool.mu.Unlock() case GasPriceChanged: @@ -127,12 +126,12 @@ func (pool *TxPool) eventLoop() { func (pool *TxPool) resetState() { currentState, err := pool.currentState() if err != nil { - glog.V(logger.Info).Infof("failed to get current state: %v", err) + glog.V(logger.Error).Errorf("failed to get current state: %v", err) return } managedState := state.ManageState(currentState) if err != nil { - glog.V(logger.Info).Infof("failed to get managed state: %v", err) + glog.V(logger.Error).Errorf("failed to get managed state: %v", err) return } pool.pendingState = managedState From 7f597bb6579602af33ef2bdf2c5f28fb3060849d Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:16:25 -0500 Subject: [PATCH 24/30] unnecessarily random nonces; use plain time --- miner/auto_agent.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/miner/auto_agent.go b/miner/auto_agent.go index 55331693a..0de0a3f78 100644 --- a/miner/auto_agent.go +++ b/miner/auto_agent.go @@ -17,7 +17,6 @@ package miner import ( - "math/rand" "sync" "time" @@ -136,8 +135,7 @@ func (self *AutoAgent) GetHashRate() int64 { } func (self *AutoAgent) Win(work *Work) *types.Block { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - nonce := uint64(r.Int63()) + nonce := uint64(time.Now().UnixNano()) // nonce := work.Block.NumberU64() // mixDigest, _ := time.Now().MarshalBinary() From 406f8e70e898993df3f4574b47e4221e0da3a322 Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:17:53 -0500 Subject: [PATCH 25/30] ensure no nil work by using mutex, ... and skip block win/mining when just draining the channel also refactors a bit --- miner/worker.go | 86 ++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 5aac09df9..eaf822670 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -142,10 +142,8 @@ func newWorker(config *core.ChainConfig, coinbase common.Address, eth core.Backe fullValidation: false, } worker.agents = make(map[Agent]struct{}) - if !config.Automine { - } else { + if config.Automine { worker.autominer = NewAutoAgent(0) - worker.fullValidation = false } worker.events = worker.mux.Subscribe(core.ChainHeadEvent{}, core.ChainSideEvent{}, core.TxPreEvent{}) go worker.update() @@ -224,53 +222,49 @@ func (self *worker) unregister(agent Agent) { } func (self *worker) update() { - if self.config.Automine { - glog.D(logger.Warn).Infoln("miner worker updating:", "AUTOMINE") - for event := range self.events.Chan() { - switch ev := event.Data.(type) { - case core.ChainHeadEvent: - self.commitNewWork() - case core.ChainSideEvent: - self.uncleMu.Lock() - self.possibleUncles[ev.Block.Hash()] = ev.Block - self.uncleMu.Unlock() - case core.TxPreEvent: - glog.D(logger.Warn).Infoln(" + tx: ", ev.Tx.Hash().Hex()) - + glog.D(logger.Warn).Infoln("miner worker updating:", "AUTOMINE") + // var txPreN = 0 + for event := range self.events.Chan() { + var t = time.Now() + switch ev := event.Data.(type) { + case core.ChainHeadEvent: + self.commitNewWork() + case core.ChainSideEvent: + self.uncleMu.Lock() + self.possibleUncles[ev.Block.Hash()] = ev.Block + self.uncleMu.Unlock() + case core.TxPreEvent: + if self.config.Automine { + // if txPreN < 2 { + // txPreN++ + // continue + // } + // txPreN = 0 if atomic.LoadInt32(&self.mining) == 0 { - self.currentMu.Lock() - self.current.commitTransactions(self.mux, types.Transactions{ev.Tx}, self.gasPrice, self.chain) - self.currentMu.Unlock() + self.start() } else { - var ww *Work - for ww == nil { - ww = self.current - } - var w *types.Block - for w == nil { - if ww.Block != nil { - w = self.autominer.Win(ww) - } + // If many txs are fired at geth at once, they will be included in blocks more quickly than this event will be processed, causing ~200+ transactions per block, and yielding many empty blocks after the burst is complete as the channel drains. This conditional simply + pending, queued := self.eth.TxPool().Stats() + if pending+queued == 0 { + continue } + glog.D(logger.Info).Infoln("+tx: ", ev.Tx.Hash().Hex()[:9], "p=", pending, "q=", queued, "took=", time.Since(t)) + t = time.Now() + + self.currentMu.Lock() + ww := self.current + self.currentMu.Unlock() + + self.currentMu.Lock() + w := self.autominer.Win(ww) // ftw + self.currentMu.Unlock() + b := &Result{ww, w} - glog.D(logger.Warn).Infoln("b <-", b.Block.Hash().Hex(), b.Block.Nonce(), b.Block.MixDigest().Hex()) + + glog.D(logger.Warn).Infoln("b <-", b.Block.Hash().Hex()[:8], b.Block.Nonce(), b.Block.MixDigest().Hex()[:8]) self.recv <- b } - - } - } - } else { - glog.D(logger.Warn).Infoln("miner worker updating:", "NORMALMINE") - for event := range self.events.Chan() { - // A real event arrived, process interesting content - switch ev := event.Data.(type) { - case core.ChainHeadEvent: - self.commitNewWork() - case core.ChainSideEvent: - self.uncleMu.Lock() - self.possibleUncles[ev.Block.Hash()] = ev.Block - self.uncleMu.Unlock() - case core.TxPreEvent: + } else { // Apply transaction to the pending state if we're not mining if atomic.LoadInt32(&self.mining) == 0 { self.currentMu.Lock() @@ -278,6 +272,7 @@ func (self *worker) update() { self.currentMu.Unlock() } } + } } } @@ -311,16 +306,13 @@ func (self *worker) wait() { block := result.Block work := result.Work - // glog.D(logger.Error).Infoln("got result", block, work) if self.fullValidation { - glog.D(logger.Error).Infoln("full") if res := self.chain.InsertChain(types.Blocks{block}); res.Error != nil { glog.Errorln("mine: ignoring invalid block #%d (%x) received: %v\n", block.Number(), block.Hash(), res.Error) continue } go self.mux.Post(core.NewMinedBlockEvent{Block: block}) } else { - glog.D(logger.Error).Infoln("notfull") work.state.CommitTo(self.chainDb, false) parent := self.chain.GetBlock(block.ParentHash()) if parent == nil { From 3acff6813b53a05c03269589532b1d549fed2aa3 Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:23:03 -0500 Subject: [PATCH 26/30] readem updates --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dcf0b49d1..77e7a332d 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,23 @@ ### Instructions Start geth with: -- `rm -rf` ing old development files w/ each rerun -- new `--ezdev` flag -- `--sputnikvm` for demonstration -- `--keystore` for demonstrating a custom keystore dir. This is the directory in which keyfiles live. If there are NO keyfiles in this dir, then EZDev :registered: will generate 10 keys, each with password `foo`. If there ARE ANY key files in this dir, then geth will not generate any new files, and will endow those accounts with substantial premine balances (`10000000000000000000000000000000wei`) in the genesis block. This directory can be anywhere. ```shell $ cd go-ethereum $ make cmd/geth && rm -rf ./keys && rm -rf ~/.ethereum-classic/ezdev && ./bin/geth --ezdev --sputnikvm --keystore ./keys ``` +- `rm -rf` ing old development files w/ each rerun; this is not necessary +- new `--ezdev` flag (note that this overrides the `--chain` flag) +- `--sputnikvm` for demonstration +- `--keystore` for demonstrating a custom keystore dir. This is the directory in which keyfiles live. If there are NO keyfiles in this dir, then EZDev :registered: will generate 10 keys, each with password `foo`. If there ARE ANY key files in this dir, then geth will not generate any new files, and will endow those accounts with substantial premine balances (`10000000000000000000000000000000wei`) in the genesis block. This directory can be anywhere. Then, in another session let's test out the automine feature. ```shell $ ./bin/geth --chain ezdev --preload test.js attach +$ ntxs(10000000000); ``` - -[./test.js](./test.js) +> [./test.js](./test.js) ### Of note: - if you smell hack, it's because there is hack From 7bdb94fe69e035a5babca75370d2a9f0f44d7908 Mon Sep 17 00:00:00 2001 From: ia Date: Mon, 26 Nov 2018 14:28:52 -0500 Subject: [PATCH 27/30] remove dead code, fix comments remove keys --- miner/worker.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index eaf822670..41890e702 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -223,7 +223,6 @@ func (self *worker) unregister(agent Agent) { func (self *worker) update() { glog.D(logger.Warn).Infoln("miner worker updating:", "AUTOMINE") - // var txPreN = 0 for event := range self.events.Chan() { var t = time.Now() switch ev := event.Data.(type) { @@ -235,21 +234,15 @@ func (self *worker) update() { self.uncleMu.Unlock() case core.TxPreEvent: if self.config.Automine { - // if txPreN < 2 { - // txPreN++ - // continue - // } - // txPreN = 0 if atomic.LoadInt32(&self.mining) == 0 { self.start() } else { - // If many txs are fired at geth at once, they will be included in blocks more quickly than this event will be processed, causing ~200+ transactions per block, and yielding many empty blocks after the burst is complete as the channel drains. This conditional simply + // If many txs are fired at geth at once, they will be included in blocks more quickly than this event will be processed, causing ~200+ transactions per block, and yielding many empty blocks after the burst is complete as the channel drains. This conditional simply ensure that there are actually transactions to add a next block. If not, the event is essentially ignored. pending, queued := self.eth.TxPool().Stats() if pending+queued == 0 { continue } glog.D(logger.Info).Infoln("+tx: ", ev.Tx.Hash().Hex()[:9], "p=", pending, "q=", queued, "took=", time.Since(t)) - t = time.Now() self.currentMu.Lock() ww := self.current @@ -289,11 +282,6 @@ func newLocalMinedBlock(blockNumber uint64, prevMinedBlocks *uint64RingBuffer) ( return minedBlocks } -func (self *worker) autowait() { - for { - } -} - // wait waits for agent to find new a new solved block func (self *worker) wait() { for { From 580c8a0e3a939d3fb31c3f0a4894930d37f10645 Mon Sep 17 00:00:00 2001 From: ia Date: Tue, 27 Nov 2018 22:15:43 -0500 Subject: [PATCH 28/30] core/types: minor refactoring for tx helpers --- core/types/transaction.go | 8 +++++--- core/types/transaction_signing.go | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/types/transaction.go b/core/types/transaction.go index b7c96b587..b223d369e 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -228,7 +228,8 @@ func (tx *Transaction) String() string { } enc, _ := rlp.EncodeToBytes(&tx.data) return fmt.Sprintf(` - TX(%x) + Hash: %x + ChainID: %v Contract: %v From: %s To: %s @@ -240,10 +241,11 @@ func (tx *Transaction) String() string { V: 0x%x R: 0x%x S: 0x%x - Hex: %x + RLP Hex: %x `, tx.Hash(), - len(tx.data.Recipient.Bytes()) == 0, + tx.ChainId(), + tx.To() == nil, from, to, tx.data.AccountNonce, diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index f33ba455c..2ed03f725 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -50,15 +50,16 @@ func normaliseV(s Signer, v *big.Int) byte { } // deriveChainId derives the chain id from the given v parameter -func deriveChainId(v *big.Int) *big.Int { +func deriveChainId(v *big.Int) (o *big.Int) { + o = new(big.Int) if v.BitLen() <= 64 { v := v.Uint64() if v == 27 || v == 28 { - return new(big.Int) + return o } - return new(big.Int).SetUint64((v - 35) / 2) + return o.SetUint64((v - 35) / 2) } - v = new(big.Int).Sub(v, big.NewInt(35)) + v = o.Sub(v, big.NewInt(35)) return v.Div(v, big.NewInt(2)) } From 1fba1ed12fbed27d88d22da6bd8b0e92ad8a1467 Mon Sep 17 00:00:00 2001 From: ia Date: Tue, 27 Nov 2018 22:27:36 -0500 Subject: [PATCH 29/30] problem@cmd/geth: messy code, mining not set with ezdev solution: clean, set mining flag with --ezdev --- cmd/geth/ezdev.go | 14 +++++++------- cmd/geth/flag.go | 4 ---- cmd/geth/main.go | 27 +-------------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/cmd/geth/ezdev.go b/cmd/geth/ezdev.go index 0dc857d5e..69e76867b 100644 --- a/cmd/geth/ezdev.go +++ b/cmd/geth/ezdev.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "log" "os" "path/filepath" "strings" @@ -14,20 +15,19 @@ import ( "gopkg.in/urfave/cli.v1" ) -func setCTXDefault(ctx *cli.Context, name, val string) { - if !ctx.GlobalIsSet(aliasableName(name, ctx)) { - ctx.GlobalSet(name, val) +func mustSetCTXDefault(ctx *cli.Context, name, val string) { + if err := ctx.GlobalSet(aliasableName(name, ctx), val); err != nil { + log.Fatal(err) } } func setEZDevFlags(ctx *cli.Context) { - setCTXDefault(ctx, NoDiscoverFlag.Name, "true") - setCTXDefault(ctx, LightKDFFlag.Name, "true") + mustSetCTXDefault(ctx, NoDiscoverFlag.Name, "true") + mustSetCTXDefault(ctx, LightKDFFlag.Name, "true") + mustSetCTXDefault(ctx, MiningEnabledFlag.Name, "true") } func setupEZDev(ctx *cli.Context, config *core.SufficientChainConfig) error { - glog.Errorln("Initializing EZDEV...") - // set flag config defaults // copy dev.json, dev_genesis.json, dev_genesis_allow.csv to datadir/ezdev/{ chain, dev_genesis, dev_genesis_alloc }.json/csv, // init 10 accounts with password 'foo' diff --git a/cmd/geth/flag.go b/cmd/geth/flag.go index 412bd028e..a4f3e5ba4 100644 --- a/cmd/geth/flag.go +++ b/cmd/geth/flag.go @@ -252,7 +252,6 @@ func MustMakeChainDataDir(ctx *cli.Context) string { } rp = af } - glog.Error("chain data dir", rp) return rp } @@ -484,8 +483,6 @@ func MakeSystemNode(version string, ctx *cli.Context) *node.Node { if ctx.GlobalBool(EZDevModeFlag.Name) { setEZDevFlags(ctx) - } - if ctx.GlobalBool(EZDevModeFlag.Name) { if err := setupEZDev(ctx, core.DefaultConfigEZDev); err != nil { panic(err) } @@ -705,7 +702,6 @@ func mustMakeSufficientChainConfig(ctx *cli.Context) *core.SufficientChainConfig } return config } else if ctx.GlobalBool(EZDevModeFlag.Name) { - glog.Errorln("setting EZDEV suffconf...") c := core.DefaultConfigEZDev if c.State != nil { state.StartingNonce = c.State.StartingNonce diff --git a/cmd/geth/main.go b/cmd/geth/main.go index e70f8790f..25153a8ed 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -280,37 +280,12 @@ func makeCLIApp() (app *cli.App) { if !ctx.GlobalIsSet(aliasableName(ChainIdentityFlag.Name, ctx)) { if e := ctx.GlobalSet(ChainIdentityFlag.Name, "morden"); e != nil { return fmt.Errorf("failed to set chain value: %v", e) - } else { - core.SetCacheChainIdentity("morden") } } - - // if mustMakeChainIdentity(ctx) != "morden" { - // log.Fatal("--dev not morden") - // } } if ctx.GlobalBool(aliasableName(EZDevModeFlag.Name, ctx)) { - log.Println("setting ezdev...") - setCTXDefault := func(ctx *cli.Context, name, val string) { - if !ctx.GlobalIsSet(aliasableName(name, ctx)) { - if err := ctx.GlobalSet(name, val); err != nil { - log.Fatal(err) - } - if err := ctx.Set(name, val); err != nil { - log.Fatal(err) - } - } - } - setCTXDefault(ctx, ChainIdentityFlag.Name, "ezdev") - if ctx.GlobalString(ChainIdentityFlag.Name) != "ezdev" { - log.Fatal("ez != ez") - } - if ctx.String(ChainIdentityFlag.Name) != "ezdev" { - log.Fatal("ez != ez ng") - } - // This is what's really doing work here. The ctx package is either very weird or buggy, and - // values that I expect to be set are not actually, sometimes. + log.Println("Turning on EZDEV...") core.SetCacheChainIdentity("ezdev") } From 97a890f48bdcea1716f4f0557411749ba4d5dcda Mon Sep 17 00:00:00 2001 From: ia Date: Tue, 27 Nov 2018 22:27:56 -0500 Subject: [PATCH 30/30] miner: minor refactoring and logging --- miner/worker.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 41890e702..c2c536cfa 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -222,7 +222,6 @@ func (self *worker) unregister(agent Agent) { } func (self *worker) update() { - glog.D(logger.Warn).Infoln("miner worker updating:", "AUTOMINE") for event := range self.events.Chan() { var t = time.Now() switch ev := event.Data.(type) { @@ -241,21 +240,16 @@ func (self *worker) update() { pending, queued := self.eth.TxPool().Stats() if pending+queued == 0 { continue + } - glog.D(logger.Info).Infoln("+tx: ", ev.Tx.Hash().Hex()[:9], "p=", pending, "q=", queued, "took=", time.Since(t)) self.currentMu.Lock() ww := self.current - self.currentMu.Unlock() - - self.currentMu.Lock() w := self.autominer.Win(ww) // ftw self.currentMu.Unlock() - b := &Result{ww, w} - - glog.D(logger.Warn).Infoln("b <-", b.Block.Hash().Hex()[:8], b.Block.Nonce(), b.Block.MixDigest().Hex()[:8]) - self.recv <- b + glog.D(logger.Info).Infoln("+tx: ", ev.Tx.String(), "txpool(p=", pending, "q=", queued, ") took=", time.Since(t)) + self.recv <- &Result{ww, w} } } else { // Apply transaction to the pending state if we're not mining