0

I created my genesis.json, then init it into 2 different paths. But these 2 path didn't contain same genesis file.

How to make these 2 use same genesis file? Or How an I wrong?

This is my genesis.json

{
"config": {
        "chainId": 10701,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },

  "alloc"      : {
  "0x0000000000000000000000000000000000000001": {"balance": "2000"},
  "0x0000000000000000000000000000000000000002": {"balance": "5000"}
    },

  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x00100",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000002378",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

Command for first path.

geth --datadir "E:\blockchain\database\node a" --networkid 10701 --nodiscover --nat none -identity node1 init C:\Users\ZephyR\Desktop\genesis.json

geth --datadir "E:\blockchain\database\node a" --networkid 10701 --nodiscover --nat none -identity node1 --rpc --rpcapi "web3, etc, personal" --rpccorsdomain "*" console

enter image description here

Command for second path.

geth --datadir "E:\blockchain\database\node b" --networkid 10701 --nodiscover --nat none -identity node2 init C:\Users\ZephyR\Desktop\genesis.json

geth --datadir "E:\blockchain\database\node b" --networkid 10701 --nodiscover --nat none --datadir node2 --rpc --rpcapi "web3, etc, personal" --rpccorsdomain "*" --rpcport 2222 --port 30302 --ipcpath node/geth.ipc console

enter image description here

However, It's work on ubuntu.

0

Double check the command you are using to start the second node. It specifies datadir twice: --datadir "E:\blockchain\database\node b" and --datadir node2. Therefore the second datadir (node2) is used which is not the one that you initialised with your genesis.json.

You might also want to check your -identity parameter - that should have two dashes: --identity.

Finally - how are you planning on making the nodes communicate with each other? One option is to use admin.addPeer(<address of other node>) from the second node's console. The other is to supply this address to --bootnodes when launching the second geth node.

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.