aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-09-29 20:24:37 +0800
committerGitHub <noreply@github.com>2016-09-29 20:24:37 +0800
commit44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308 (patch)
treeaaab07e78f7b9341f0fcfbd9348fe96273bd6a0d /cmd/geth/main.go
parent4e8cec05abb567457e80185cb9fcf7ec2cc90596 (diff)
parentb42a5b118f1aa7ac1235547c8594146978941401 (diff)
downloaddexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.gz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.bz2
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.lz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.xz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.zst
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.zip
Merge pull request #2914 from fjl/node-coinhabit
cmd/utils, node: make datadir reusable for bzzd
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index a7b332d0f..65311ca41 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -36,7 +36,6 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/eth"
- "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
@@ -46,7 +45,7 @@ import (
)
const (
- clientIdentifier = "Geth" // Client identifier to advertise over the network
+ clientIdentifier = "geth" // Client identifier to advertise over the network
)
var (
@@ -245,17 +244,15 @@ func initGenesis(ctx *cli.Context) error {
state.StartingNonce = 1048576 // (2**20)
}
- chainDb, err := ethdb.NewLDBDatabase(filepath.Join(utils.MustMakeDataDir(ctx), "chaindata"), 0, 0)
- if err != nil {
- utils.Fatalf("could not open database: %v", err)
- }
+ stack := makeFullNode(ctx)
+ chaindb := utils.MakeChainDatabase(ctx, stack)
genesisFile, err := os.Open(genesisPath)
if err != nil {
utils.Fatalf("failed to read genesis file: %v", err)
}
- block, err := core.WriteGenesisBlock(chainDb, genesisFile)
+ block, err := core.WriteGenesisBlock(chaindb, genesisFile)
if err != nil {
utils.Fatalf("failed to write genesis block: %v", err)
}
@@ -296,9 +293,6 @@ func makeFullNode(ctx *cli.Context) *node.Node {
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
// miner.
func startNode(ctx *cli.Context, stack *node.Node) {
- // Report geth version
- glog.V(logger.Info).Infof("instance: Geth/%s/%s/%s\n", utils.Version, runtime.Version(), runtime.GOOS)
-
// Start up the node itself
utils.StartNode(stack)
@@ -379,7 +373,7 @@ func gpubench(ctx *cli.Context) error {
}
func version(c *cli.Context) error {
- fmt.Println(clientIdentifier)
+ fmt.Println(strings.Title(clientIdentifier))
fmt.Println("Version:", utils.Version)
if gitCommit != "" {
fmt.Println("Git Commit:", gitCommit)