aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-09-06 21:46:54 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-09-09 14:53:05 +0800
commitf04b3a6f293ef15151dc040183ab74ef5ce54d2a (patch)
tree4e74df1f20d9a9f83c10370ce6eb428f6fbaf0e2 /eth/backend.go
parente2d7c1a52303ebdd8c2956badad5e600bf93ff33 (diff)
downloadgo-tangerine-f04b3a6f293ef15151dc040183ab74ef5ce54d2a.tar.gz
go-tangerine-f04b3a6f293ef15151dc040183ab74ef5ce54d2a.tar.zst
go-tangerine-f04b3a6f293ef15151dc040183ab74ef5ce54d2a.zip
cmd/geth, cmd/utils, eth: added dev mode flag
Dev mode enabled some debugging flags such as: * VM debugging mode * Simpler proof of work * Whisper enabled by default * Datadir to a tmp datadir * Maxpeers set to 0 * Gas price of 0 * Random listen port
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go
index ad2a2c1f9..639aaaaec 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -73,6 +73,8 @@ var (
)
type Config struct {
+ DevMode bool
+
Name string
NetworkId int
GenesisNonce int
@@ -303,16 +305,17 @@ func New(config *Config) (*Ethereum, error) {
glog.V(logger.Info).Infof("Successfully wrote genesis block. New genesis hash = %x\n", block.Hash())
}
- if config.Olympic {
+ // different modes
+ switch {
+ case config.Olympic:
+ glog.V(logger.Error).Infoln("Starting Olympic network")
+ fallthrough
+ case config.DevMode:
_, err := core.WriteTestNetGenesisBlock(chainDb, 42)
if err != nil {
return nil, err
}
- glog.V(logger.Error).Infoln("Starting Olympic network")
- }
-
- // This is for testing only.
- if config.GenesisBlock != nil {
+ case config.GenesisBlock != nil: // This is for testing only.
core.WriteBlock(chainDb, config.GenesisBlock)
core.WriteHead(chainDb, config.GenesisBlock)
}