aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethereum/main.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
committerobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
commit09841b1c9b2553a4572590128580df37c8fa83ad (patch)
tree42a846801bde7d8f7edc5ec07ccbba7806261128 /cmd/ethereum/main.go
parentbd0c267cbe9db805b5a272d29ef8860c62ddafe5 (diff)
downloadgo-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.gz
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.tar.zst
go-tangerine-09841b1c9b2553a4572590128580df37c8fa83ad.zip
Cleaned up some of that util
Diffstat (limited to 'cmd/ethereum/main.go')
-rw-r--r--cmd/ethereum/main.go48
1 files changed, 18 insertions, 30 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 7efee31e7..95060025f 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -25,6 +25,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
)
@@ -48,35 +49,26 @@ func main() {
// precedence: code-internal flag default < config file < environment variables < command line
Init() // parsing command line
- // If the difftool option is selected ignore all other log output
- if DiffTool || Dump {
- LogLevel = 0
- }
-
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
- ethutil.Config.Diff = DiffTool
- ethutil.Config.DiffType = DiffType
-
- utils.InitDataDir(Datadir)
- utils.InitLogging(Datadir, LogFile, LogLevel, DebugFile)
-
- db := utils.NewDatabase()
- err := utils.DBSanityCheck(db)
+ ethereum, err := eth.New(&eth.Config{
+ Name: ClientIdentifier,
+ Version: Version,
+ KeyStore: KeyStore,
+ DataDir: Datadir,
+ LogFile: LogFile,
+ LogLevel: LogLevel,
+ Identifier: Identifier,
+ MaxPeers: MaxPeer,
+ Port: OutboundPort,
+ NATType: PMPGateway,
+ PMPGateway: PMPGateway,
+ KeyRing: KeyRing,
+ })
if err != nil {
- fmt.Println(err)
-
- os.Exit(1)
+ clilogger.Fatalln(err)
}
-
- keyManager := utils.NewKeyManager(KeyStore, Datadir, db)
-
- // create, import, export keys
- utils.KeyTasks(keyManager, KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive)
-
- clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier, string(keyManager.PublicKey()))
-
- ethereum := utils.NewEthereum(db, clientIdentity, keyManager, utils.NatType(NatType, PMPGateway), OutboundPort, MaxPeer)
+ utils.KeyTasks(ethereum.KeyManager(), KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive)
if Dump {
var block *types.Block
@@ -103,11 +95,7 @@ func main() {
fmt.Println(block)
- os.Exit(0)
- }
-
- if ShowGenesis {
- utils.ShowGenesis(ethereum)
+ return
}
if StartMining {