3

I started a private network with Geth.
Geth 1.5.9-stable, Windows 10. Here is My genesis.json:

{
    "nonce": "0x0000000000000042",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x0",
    "gasLimit": "0x8000000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
        "0x0a53521645e1F9380989ce3F55aF0d8A0f902DAb": {
            "balance": "1000000000000000000000000000000"
        }
    }
}

Then I created two different folder for blockhains:

geth --datadir "C:\Ethereum\TestChains\1" init "C:\Users\user1\Desktop\Ethereum\genesis_1.json"

geth --datadir "C:\Ethereum\TestChains\2" init "C:\Users\user1\Desktop\Ethereum\genesis_1.json"

Then I started running two nodes. One of them with --mine key:

geth --maxpendpeers=5 --nodiscover --networkid "15985" --datadir "C:\Ethereum\TestChains\1" --port 30304 --rpcport 18999 console

geth --maxpendpeers=5 --nodiscover --networkid "15985" --datadir "C:\Ethereum\TestChains\2" --port 30305 --ipcdisable --mine --minerthreads=2 --etherbase="0x0a53521645e1F9380989ce3F55aF0d8A0f902DAb" console

And finally I adds peer manualy:

admin.addPeer("enode://ec491fe874bcba129add0fab1b3a3a30109fefb5cb1b8497ed1397a1f6a5de54da2c3097cfde4cfc32f3d3297bfb679c7c13948583fe50f7d31d310affe1e112@127.0.0.1:30305")

Both nodes shows "neighboring nodes" by admin.peers command.
I runs EthereumWallet (Mist) and I see one neighboring peer - enter image description here

Troubles and qustions:
1)
Transaction not works. I send 1000 eth by EthereumWallet, I see this transaction in Geth enter image description here, but a few minutes later I see in log

I0322 12:42:41.765915 internal/ethapi/api.go:1026] receipt not found for transaction 0x7811d28051834923f4e4fefe672dfa3bbebcc9876faf336e317e6ff3652be4f5

2) (already solved below)
Geth witn --mine key constantly doing something. This log-messages is every few seconds raised by Geth - I0321 11:12:13.857226 miner/worker.go:517] commit new work on block 624 with 0 txs & 0 uncles. Took 0s.
He constantly creates new empty blocks (0 txs & 0 uncles). Why? And why He do not creates a block with My transaction?

Jesbus
  • 10,478
  • 6
  • 35
  • 62
Artem
  • 687
  • 1
  • 5
  • 12
  • I have the same issue with a java DApp I'm programming and I just found out, that this occurs only when I do rawTransactions. Transactions with web3j as example work fine, so maybe there is some bug with handling rawTransactions? – Tom Apr 02 '17 at 11:32

1 Answers1

1

An answer to one part of your question...

He constantly creates new empty blocks (0 txs & 0 uncles). Why?

If there are no pending transactions in the mempool, then miners still have to create a block every ~14 seconds - they won't just sit there doing nothing.

See the following for more details: In a private blockchain, why do miners keep adding empty blocks to the blockchain?

Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144