8

I am following this link to make private Ethereum Chain.But running

geth --identity "Prashant" --genesis CustomGenesis.json --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "chaindata" --port "30303" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1900 --nat "any" console

gives Incorrect Usage.

I am using stable version of geth 1.4.10.

What's the possible reasons for the issue?

12

The most likely reason why you are getting this error is because the --genesis parameter is now deprecated and has been replaced with an init parameter.

See geth init, what are the arguments? for details on how to use the init parameter to initialise your private blockchain before being able to use it.



Update 20/07/2016

From geth Command Line Options - Init:

Init

With the init command it is possible to create a chain with a custom genesis block and chain configuration (currently only the homestead transition block can be configured). It respects the --datadir argument and accepts a JSON file describing the chain configuration.

geth --datadir <some/location/where/to/create/chain> init genesis.json

Example genesis.json file:

{
    "config": {
            "homesteadBlock": "10"
    },
    "nonce": "0",
    "difficulty": "0x20000",
    "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
    "coinbase": "0x0000000000000000000000000000000000000000",
    "timestamp": "0x00",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x",
    "gasLimit": "0x2FEFD8",
    "alloc": {}
}

To use the created chain start geth with:

geth --datadir <some/location/where/to/create/chain>
  • 1
    Yes it is a version problem. – niksmac Jul 19 '16 at 14:45
2

The error i am able to reproduce is,

####################################################################
#                                                                  #
# --genesis is deprecated. Switch to use 'geth init /path/to/file' #
#                                                                  #
####################################################################

Try this, it will work.

geth --identity "Prashant" --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "chaindata" --port "30303" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1900 --nat "any" init /path/to/genesis.json console
  • This will work but it won't start a private blockchain because path to genesis file is not mentioned in your command. Removing --genesis command is not the expected solution here. It should be replaced with init. – galahad Jul 19 '16 at 16:55
  • @varm yeah, i explained it now. – niksmac Jul 19 '16 at 17:11
  • @varm I added path to genesis using init and it's working good. The basic reason was genesis parameter was replaced with init – Prashant Prabhakar Singh Jul 19 '16 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.