0

I start with the following genesis.json.

{
  "config": {
    "chainId": 15,
    "homesteadBlock": 0,
    "eip155Block": 0,
    "eip158Block": 0
  },
    "difficulty": "200000000",
    "gasLimit": "2100000",
    "alloc": {
      "7df9a875a174b3bc565e6424a0050ebc1b2d1d82": { "balance": "300000" },
      "f41c74c9ae680c1aa78f42e5647a62f353b7bdde": { "balance": "400000" }
    }
}

Then I run

$ geth --datadir /tmp/geth_datadir init genesis.json
INFO [03-28|12:16:35] Maximum peer count                       ETH=25 LES=0 total=25
INFO [03-28|12:16:35] Allocated cache and file handles         database=/tmp/geth_datadir/geth/chaindata cache=16 handles=16
INFO [03-28|12:16:35] Persisted trie from memory database      nodes=3 size=503.00B time=11.951µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-28|12:16:35] Successfully wrote genesis state         database=chaindata                        hash=614a31…9df7ba
INFO [03-28|12:16:35] Allocated cache and file handles         database=/tmp/geth_datadir/geth/lightchaindata cache=16 handles=16
INFO [03-28|12:16:35] Persisted trie from memory database      nodes=3 size=503.00B time=8.733µs  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-28|12:16:35] Successfully wrote genesis state         database=lightchaindata                        hash=614a31…9df7ba

Then, I start a private network.

$ geth --datadir /tmp/geth_datadir --networkid 15
INFO [03-28|12:18:08] Maximum peer count                       ETH=25 LES=0 total=25
INFO [03-28|12:18:08] Starting peer-to-peer node               instance=Geth/v1.8.3-stable/darwin-amd64/go1.10
INFO [03-28|12:18:08] Allocated cache and file handles         database=/tmp/geth_datadir/geth/chaindata cache=768 handles=128
INFO [03-28|12:18:08] Initialised chain configuration          config="{ChainID: 15 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: 0 EIP158: 0 Byzantium: <nil> Constantinople: <nil> Engine: unknown}"
INFO [03-28|12:18:08] Disk storage enabled for ethash caches   dir=/tmp/geth_datadir/geth/ethash count=3
INFO [03-28|12:18:08] Disk storage enabled for ethash DAGs     dir=/Users/pengy/.ethash          count=2
INFO [03-28|12:18:08] Initialising Ethereum protocol           versions="[63 62]" network=15
INFO [03-28|12:18:08] Loaded most recent local header          number=0 hash=614a31…9df7ba td=200000000
INFO [03-28|12:18:08] Loaded most recent local full block      number=0 hash=614a31…9df7ba td=200000000
INFO [03-28|12:18:08] Loaded most recent local fast block      number=0 hash=614a31…9df7ba td=200000000
INFO [03-28|12:18:08] Loaded local transaction journal         transactions=0 dropped=0
INFO [03-28|12:18:08] Regenerated local transaction journal    transactions=0 accounts=0
INFO [03-28|12:18:08] Starting P2P networking 
INFO [03-28|12:18:10] UDP listener up                          self=enode://021fefa3279fb201f61dea5f059fa4e3a7db31f4db84ac87d0e92a78e63f2e7bd939b7efc8d164c28a7c9f1d93959fb886c7a8c5fee5afcd5bdb2a38023dfc17@[::]:30303
INFO [03-28|12:18:10] RLPx listener up                         self=enode://021fefa3279fb201f61dea5f059fa4e3a7db31f4db84ac87d0e92a78e63f2e7bd939b7efc8d164c28a7c9f1d93959fb886c7a8c5fee5afcd5bdb2a38023dfc17@[::]:30303
INFO [03-28|12:18:10] IPC endpoint opened                      url=/tmp/geth_datadir/geth.ipc

These are the additional output after the above command is run for a while.

INFO [03-28|12:22:48] Etherbase automatically configured       address=0x84af67291FBe16C82e88E3877603dF3D181ebCb7
INFO [03-28|12:22:56] Updated mining threads                   threads=0
INFO [03-28|12:22:56] Transaction pool price threshold updated price=18000000000
INFO [03-28|12:22:56] Starting mining operation 
INFO [03-28|12:22:56] Commit new mining work                   number=1 txs=0 uncles=0 elapsed=382.292µs
INFO [03-28|12:22:59] Generating ethash verification cache     epoch=1 percentage=99 elapsed=3.042s
INFO [03-28|12:22:59] Generated ethash verification cache      epoch=1 elapsed=3.073s
INFO [03-28|12:23:04] Generating DAG in progress               epoch=1 percentage=0  elapsed=4.552s
INFO [03-28|12:23:08] Generating DAG in progress               epoch=1 percentage=1  elapsed=8.231s
INFO [03-28|12:23:12] Generating DAG in progress               epoch=1 percentage=2  elapsed=12.463s
INFO [03-28|12:23:15] Generating DAG in progress               epoch=1 percentage=3  elapsed=15.954s
INFO [03-28|12:23:19] Generating DAG in progress               epoch=1 percentage=4  elapsed=20.003s
INFO [03-28|12:23:24] Generating DAG in progress               epoch=1 percentage=5  elapsed=25.003s
INFO [03-28|12:23:29] Generating DAG in progress               epoch=1 percentage=6  elapsed=29.499s
INFO [03-28|12:23:34] Generating DAG in progress               epoch=1 percentage=7  elapsed=34.194s
INFO [03-28|12:23:39] Generating DAG in progress               epoch=1 percentage=8  elapsed=39.211s
INFO [03-28|12:23:44] Generating DAG in progress               epoch=1 percentage=9  elapsed=44.360s
INFO [03-28|12:23:49] Generating DAG in progress               epoch=1 percentage=10 elapsed=49.107s
INFO [03-28|12:23:54] Generating DAG in progress               epoch=1 percentage=11 elapsed=54.795s
INFO [03-28|12:23:58] Generating DAG in progress               epoch=1 percentage=12 elapsed=59.032s
INFO [03-28|12:24:03] Generating DAG in progress               epoch=1 percentage=13 elapsed=1m3.386s
INFO [03-28|12:24:07] Generating DAG in progress               epoch=1 percentage=14 elapsed=1m7.997s
INFO [03-28|12:24:13] Generating DAG in progress               epoch=1 percentage=15 elapsed=1m13.530s
INFO [03-28|12:24:18] Generating DAG in progress               epoch=1 percentage=16 elapsed=1m18.925s
INFO [03-28|12:24:24] Generating DAG in progress               epoch=1 percentage=17 elapsed=1m24.509s
INFO [03-28|12:24:29] Generating DAG in progress               epoch=1 percentage=18 elapsed=1m29.453s
INFO [03-28|12:24:34] Generating DAG in progress               epoch=1 percentage=19 elapsed=1m34.490s
INFO [03-28|12:24:40] Generating DAG in progress               epoch=1 percentage=20 elapsed=1m40.658s
INFO [03-28|12:24:44] Generating DAG in progress               epoch=1 percentage=21 elapsed=1m44.660s
INFO [03-28|12:24:48] Generating DAG in progress               epoch=1 percentage=22 elapsed=1m48.982s
INFO [03-28|12:24:53] Generating DAG in progress               epoch=1 percentage=23 elapsed=1m53.314s
INFO [03-28|12:24:55] Generating DAG in progress               epoch=1 percentage=24 elapsed=1m55.313s
INFO [03-28|12:24:58] Generating DAG in progress               epoch=1 percentage=25 elapsed=1m58.408s
INFO [03-28|12:25:00] Generating DAG in progress               epoch=1 percentage=26 elapsed=2m0.619s
INFO [03-28|12:25:02] Generating DAG in progress               epoch=1 percentage=27 elapsed=2m2.714s
INFO [03-28|12:25:04] Generating DAG in progress               epoch=1 percentage=28 elapsed=2m5.006s
INFO [03-28|12:25:06] Generating DAG in progress               epoch=1 percentage=29 elapsed=2m6.946s
INFO [03-28|12:25:09] Generating DAG in progress               epoch=1 percentage=30 elapsed=2m9.232s
INFO [03-28|12:25:11] Generating DAG in progress               epoch=1 percentage=31 elapsed=2m11.467s
INFO [03-28|12:25:13] Generating DAG in progress               epoch=1 percentage=32 elapsed=2m13.696s
INFO [03-28|12:25:15] Generating DAG in progress               epoch=1 percentage=33 elapsed=2m15.774s
INFO [03-28|12:25:17] Generating DAG in progress               epoch=1 percentage=34 elapsed=2m17.707s
INFO [03-28|12:25:20] Generating DAG in progress               epoch=1 percentage=35 elapsed=2m20.285s
INFO [03-28|12:25:22] Generating DAG in progress               epoch=1 percentage=36 elapsed=2m22.319s
INFO [03-28|12:25:24] Generating DAG in progress               epoch=1 percentage=37 elapsed=2m24.250s
INFO [03-28|12:25:26] Generating DAG in progress               epoch=1 percentage=38 elapsed=2m26.148s
INFO [03-28|12:25:27] Generating DAG in progress               epoch=1 percentage=39 elapsed=2m28.023s
INFO [03-28|12:25:30] Generating DAG in progress               epoch=1 percentage=40 elapsed=2m30.349s
INFO [03-28|12:25:32] Generating DAG in progress               epoch=1 percentage=41 elapsed=2m32.996s
INFO [03-28|12:25:35] Generating DAG in progress               epoch=1 percentage=42 elapsed=2m35.223s
INFO [03-28|12:25:37] Generating DAG in progress               epoch=1 percentage=43 elapsed=2m37.155s
INFO [03-28|12:25:39] Generating DAG in progress               epoch=1 percentage=44 elapsed=2m39.083s
INFO [03-28|12:25:40] Generating DAG in progress               epoch=1 percentage=45 elapsed=2m40.941s
INFO [03-28|12:25:43] Generating DAG in progress               epoch=1 percentage=46 elapsed=2m43.259s
INFO [03-28|12:25:45] Generating DAG in progress               epoch=1 percentage=47 elapsed=2m45.414s
INFO [03-28|12:25:47] Generating DAG in progress               epoch=1 percentage=48 elapsed=2m47.308s
INFO [03-28|12:25:49] Generating DAG in progress               epoch=1 percentage=49 elapsed=2m49.527s
INFO [03-28|12:25:52] Generating DAG in progress               epoch=1 percentage=50 elapsed=2m52.627s
INFO [03-28|12:25:56] Generating DAG in progress               epoch=1 percentage=51 elapsed=2m56.111s
INFO [03-28|12:25:58] Generating DAG in progress               epoch=1 percentage=52 elapsed=2m58.835s
INFO [03-28|12:26:00] Generating DAG in progress               epoch=1 percentage=53 elapsed=3m0.859s
INFO [03-28|12:26:02] Generating DAG in progress               epoch=1 percentage=54 elapsed=3m2.997s
INFO [03-28|12:26:04] Generating DAG in progress               epoch=1 percentage=55 elapsed=3m5.078s
INFO [03-28|12:26:07] Generating DAG in progress               epoch=1 percentage=56 elapsed=3m7.646s
INFO [03-28|12:26:09] Generating DAG in progress               epoch=1 percentage=57 elapsed=3m9.627s
INFO [03-28|12:26:11] Generating DAG in progress               epoch=1 percentage=58 elapsed=3m11.459s
INFO [03-28|12:26:13] Generating DAG in progress               epoch=1 percentage=59 elapsed=3m13.312s
INFO [03-28|12:26:15] Generating DAG in progress               epoch=1 percentage=60 elapsed=3m15.138s
INFO [03-28|12:26:16] Generating DAG in progress               epoch=1 percentage=61 elapsed=3m16.952s
INFO [03-28|12:26:18] Generating DAG in progress               epoch=1 percentage=62 elapsed=3m18.792s
INFO [03-28|12:26:20] Generating DAG in progress               epoch=1 percentage=63 elapsed=3m20.654s
INFO [03-28|12:26:22] Generating DAG in progress               epoch=1 percentage=64 elapsed=3m22.505s
INFO [03-28|12:26:24] Generating DAG in progress               epoch=1 percentage=65 elapsed=3m24.350s
INFO [03-28|12:26:26] Generating DAG in progress               epoch=1 percentage=66 elapsed=3m26.304s
INFO [03-28|12:26:28] Generating DAG in progress               epoch=1 percentage=67 elapsed=3m28.167s
INFO [03-28|12:26:30] Generating DAG in progress               epoch=1 percentage=68 elapsed=3m30.115s
INFO [03-28|12:26:31] Generating DAG in progress               epoch=1 percentage=69 elapsed=3m32.073s
INFO [03-28|12:26:34] Generating DAG in progress               epoch=1 percentage=70 elapsed=3m34.103s
INFO [03-28|12:26:35] Generating DAG in progress               epoch=1 percentage=71 elapsed=3m36.015s
INFO [03-28|12:26:37] Generating DAG in progress               epoch=1 percentage=72 elapsed=3m37.900s
INFO [03-28|12:26:39] Generating DAG in progress               epoch=1 percentage=73 elapsed=3m39.736s
INFO [03-28|12:26:41] Generating DAG in progress               epoch=1 percentage=74 elapsed=3m41.628s
INFO [03-28|12:26:43] Generating DAG in progress               epoch=1 percentage=75 elapsed=3m43.342s
INFO [03-28|12:26:45] Generating DAG in progress               epoch=1 percentage=76 elapsed=3m45.116s
INFO [03-28|12:26:46] Generating DAG in progress               epoch=1 percentage=77 elapsed=3m46.857s
INFO [03-28|12:26:48] Generating DAG in progress               epoch=1 percentage=78 elapsed=3m48.537s
INFO [03-28|12:26:50] Generating DAG in progress               epoch=1 percentage=79 elapsed=3m50.266s
INFO [03-28|12:26:51] Generating DAG in progress               epoch=1 percentage=80 elapsed=3m51.984s
INFO [03-28|12:26:53] Generating DAG in progress               epoch=1 percentage=81 elapsed=3m53.667s
INFO [03-28|12:26:55] Generating DAG in progress               epoch=1 percentage=82 elapsed=3m55.387s
INFO [03-28|12:26:56] Generating DAG in progress               epoch=1 percentage=83 elapsed=3m57.069s
INFO [03-28|12:26:58] Generating DAG in progress               epoch=1 percentage=84 elapsed=3m58.815s
INFO [03-28|12:27:00] Generating DAG in progress               epoch=1 percentage=85 elapsed=4m0.969s
INFO [03-28|12:27:02] Generating DAG in progress               epoch=1 percentage=86 elapsed=4m2.725s
INFO [03-28|12:27:04] Generating DAG in progress               epoch=1 percentage=87 elapsed=4m4.483s
INFO [03-28|12:27:06] Generating DAG in progress               epoch=1 percentage=88 elapsed=4m6.241s
INFO [03-28|12:27:07] Generating DAG in progress               epoch=1 percentage=89 elapsed=4m7.993s
INFO [03-28|12:27:09] Generating DAG in progress               epoch=1 percentage=90 elapsed=4m9.699s
INFO [03-28|12:27:11] Generating DAG in progress               epoch=1 percentage=91 elapsed=4m11.639s
INFO [03-28|12:27:13] Generating DAG in progress               epoch=1 percentage=92 elapsed=4m13.419s
INFO [03-28|12:27:15] Generating DAG in progress               epoch=1 percentage=93 elapsed=4m15.115s
INFO [03-28|12:27:16] Generating DAG in progress               epoch=1 percentage=94 elapsed=4m16.844s
INFO [03-28|12:27:18] Generating DAG in progress               epoch=1 percentage=95 elapsed=4m18.568s
INFO [03-28|12:27:20] Generating DAG in progress               epoch=1 percentage=96 elapsed=4m20.267s
INFO [03-28|12:27:21] Generating DAG in progress               epoch=1 percentage=97 elapsed=4m22.027s
INFO [03-28|12:27:23] Generating DAG in progress               epoch=1 percentage=98 elapsed=4m23.742s
INFO [03-28|12:27:25] Generating DAG in progress               epoch=1 percentage=99 elapsed=4m25.832s

Then I run the following commands in geth attach, but miner.start(2) does not return true. Does anybody know whether this is wrong?

$ geth attach  --datadir /tmp/geth_datadir/
Welcome to the Geth JavaScript console!

instance: Geth/v1.8.3-stable/darwin-amd64/go1.10
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> personal.newAccount()
Passphrase: 
Repeat passphrase: 
"0x84af67291fbe16c82e88e3877603df3d181ebcb7"
> eth.coinbase
"0x84af67291fbe16c82e88e3877603df3d181ebcb7"
> personal.list
personal.listAccounts personal.listWallets 
> personal.listAccounts
["0x84af67291fbe16c82e88e3877603df3d181ebcb7"]
> miner.start(2)
null
> eth.getBalance(eth.coinbase)
0
  • Can you check if you receive any error/warning on geth side? In my case I had to unlock coinbase account to enable sealing from that account. – Ayushya Mar 28 '18 at 17:30
  • If you did the 'getBalance' immediately after all these steps, chances are the geth is generating DAG (geth console should print out 'Generating DAG') before it is able to mine, thus the zero balance. The mining should start after the DAG generation, afterwards the balance will increase. – Linmao Song Mar 28 '18 at 17:59
  • @Ayushya I got INFO [03-28|15:32:23] Updated mining threads threads=2 INFO [03-28|15:32:23] Transaction pool price threshold updated price=18000000000 INFO [03-28|15:32:23] Starting mining operation INFO [03-28|15:32:23] Commit new mining work number=1 txs=0 uncles=0 elapsed=355.537µs in the output of geth --datadir /tmp/geth_datadir --networkid 15. Is it correct? – user1424739 Mar 28 '18 at 20:35
  • @LinmaoSong Indeed, DAG had been generated. But I run miner.start(2) again, now I don't see DAG generation. I don't know how to check what is mined. But since this is a private network, if there is no transactions, then there should be nothing to mine. Is it the case? Thanks. – user1424739 Mar 28 '18 at 20:41
  • 1
    The difficulty is a bit high you may try using a lower value, like "200". – Ismael Mar 29 '18 at 3:56

Your Answer

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

Browse other questions tagged or ask your own question.