1

I am trying to create a private chain. this are my details

{
    "nonce": "0x0000000000000042",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x4000",
    "alloc": {
    "xxxxxxx": {
        "balance": "10000000000000000000"
        }
    },
    "coinbase": "0x0000000000000000000000000000000000000000",
    "timestamp": "0x00",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "Custem Ethereum Genesis Block",
    "gasLimit": "0xffffffff"
}

I then did geth --datadir eth-data --networkid 123 --nodiscover --maxpeers 0 console init genesis.json

But my ether is still 0/. What is going on

  • you can use puppeth to easily generate the genesis file – Ha ĐANG Aug 22 '18 at 10:50
  • btw, xxxxxxx is real value or you just to make a censorship? – Ha ĐANG Aug 22 '18 at 11:11
  • its a fake value. but then my accounts are still reading 0 even though i have initualised? – Adam Aug 22 '18 at 11:26
  • @Adam Try initializing in an empty directory. If it was previously initialized it will not initialize again. How are you checking the balances? – Ismael Apr 8 at 19:21
0

I know linking is not considered an answer but I'm not a fan of copy pasting bits of the article either...

https://hackernoon.com/setup-your-own-private-proof-of-authority-ethereum-network-with-geth-9a0a3750cda8

0

Try this:

File genesis.json:

{
   "config": {
      "chainId": 100,
      "homesteadBlock": 0,
      "eip155Block": 0,
      "eip158Block": 0,
      "byzantiumBlock": 0
   },
   "difficulty": "0",
   "gasLimit": "0xfffffffffff",
   "alloc": {
        "PUBLIC_KEY_1": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_2": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_3": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_4": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_5": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_6": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_7": {"balance": "1000000000000000000000000000000000000000"},
        "PUBLIC_KEY_8": {"balance": "1000000000000000000000000000000000000000"}
    }
}

Call from command-line one time:

geth --datadir=.\data init .\genesis.json

Call from command-line every time you want to start the node:

geth.exe --networkid=100 --rpc --rpcport=8545 --lightkdf --mine --datadir=./data

You can add --verbosity=2 if you want to have a small amount of debug-printouts.

You can add --verbosity=5 if you want to have a large amount of debug-printouts.

  • Of course, use your actual public keys (wallet addresses) up there. – goodvibration Aug 22 '18 at 11:53

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.