Private

無法創建私鏈

  • December 27, 2020

我正在嘗試創建一個私有鏈。這是我的詳細資訊

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

然後我做了 geth --datadir eth-data --networkid 123 --nodiscover --maxpeers 0 console init genesis.json

但我的乙太幣仍然是 0/。到底是怎麼回事

我知道連結不被視為答案,但我也不喜歡複製粘貼文章的部分內容……

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

試試這個:

文件 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"}
   }
}

從命令行呼叫一次:

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

每次要啟動節點時從命令行呼叫:

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

--verbosity=2如果您想要少量的調試列印輸出,您可以添加。

--verbosity=5如果您想要大量的調試列印輸出,您可以添加。

引用自:https://ethereum.stackexchange.com/questions/57168