Go-ethereum: All flags are "provided but not defined"

Created on 4 Nov 2016  路  2Comments  路  Source: ethereum/go-ethereum

System information

Geth version:
Geth
Version 1.4.18-stable-c72f5459
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.7
OS: Windows
GOPATH=
GOROOT=/usr/local/go

OS & Version: Windows7

Expected behaviour

Use the --datadir, --nodiscover, --rpc, rpcport "8080" flags, and more.

Actual behaviour

Every flag usage make geth return "flag provided but not defined: "
Flags only have one hyphen ( "-datadir" ) in the error line.

Steps to reproduce the behaviour

geth init genesis.json --nodiscover --rpc --rpcport "8080" --datadir "\dir"

Backtrace

[backtrace]

Most helpful comment

Note, the flags need to come after geth and before init, as all flags currently are global and not subcommand specific. This is ugly we know, it will probably change in the future but that's outside of our development scope for now.

All 2 comments

The init subcommand is used to generate the blockchain with the genesis block as defined in genesis.json. There is no point in giving runtime options since it won't start the node. The only flag that is interesting is the datadir flag.

Steps to initialize and start a node are:

geth --datadir <my-dir> init genesis.json
geth --datadir <my-dir> -nodiscover --rpc --rpcport "8080" 

Note, the flags need to come after geth and before init, as all flags currently are global and not subcommand specific. This is ugly we know, it will probably change in the future but that's outside of our development scope for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

freshonline picture freshonline  路  3Comments

prene picture prene  路  3Comments

keitaj picture keitaj  路  3Comments

JMaxU picture JMaxU  路  3Comments

AdrianScott picture AdrianScott  路  3Comments