@Test
public void startMiningConsumer() throws Exception {

    SysPropConfig2.props.overrideParams(ConfigFactory.parseString(
            "peer.listen.port = 30336 \n" +
                    "peer.privateKey = 3ec771c31cac8c0dba77a69e503765701d3c2bb62435888d4ffa38fed60c445c \n" +
                    "peer.networkId = 555 \n" +
                    "peer.active = [" +
                    "{ url = \"enode://b23b3b9f38f1d314b27e63c63f3e45a6ea5f82c83f282e2d38f2f01c22165e897656fe2e5f9f18616b81f41cbcf2e9100fc9f8dad099574f3d84cf9623de2fc9@localhost:20301\" }," +
                    "{ url = \"enode://26ba1aadaf59d7607ad7f437146927d79e80312f026cfa635c6b2ccf2c5d3521f5812ca2beb3b295b14f97110e6448c1c7ff68f14c5328d43a3c62b44143e9b1@localhost:30335\" }" +
                    "] \n" +
                    "sync.enabled = true \n" +
                    "genesis = genesis-harder.json \n" +
                      "genesis = frontier.json \n" +
                    "database.dir = testDB-1 \n"));
    Ethereum ethereum2 = EthereumFactory.createEthereum(SysPropConfig2.props, SysPropConfig2.class);
    final CountDownLatch semaphore = new CountDownLatch(1);
    ethereum2.addListener(new EthereumListenerAdapter() {
        @Override
        public void onBlock(Block block, List<TransactionReceipt> receipts) {
            System.err.println("=== New block: " + blockInfo(block));
            System.err.println(block);
            for (Transaction tx : block.getTransactionsList()) {
                  Pair<Transaction, Long> remove = submittedTxs.remove(new ByteArrayWrapper(tx.getHash()));
                  if (remove == null) {
                      System.err.println("===== !!! Unknown Tx: " + tx);
                  } else {
                      System.out.println("===== Tx included in " + (System.currentTimeMillis() - remove.getRight()) / 1000
                              + " sec: " + tx);
                  }
            }
              for (Pair<Transaction, Long> pair : submittedTxs.values()) {
                  if (System.currentTimeMillis() - pair.getRight() > 60 * 1000) {
                      System.err.println("==== !!! Lost Tx: " + (System.currentTimeMillis() - pair.getRight()) / 1000
                              + " sec: " + pair.getLeft());
                  }
              }
        }
        @Override
        public void onPendingTransactionsReceived(List<Transaction> transactions) {
            System.err.println("=== Tx: " + transactions);
        }
        @Override
        public void onSyncDone(SyncState state) {
            semaphore.countDown();
            System.err.println("=== Sync Done!");
        }
    });
    System.out.println("Waiting for sync...");
    semaphore.await();
      ECKey senderKey = ECKey.fromPrivate(Hex.decode("3ec771c31cac8c0dba77a69e503765701d3c2bb62435888d4ffa38fed60c445c"));
      byte[] receiverAddr = Hex.decode("31e2e1ed11951c7091dfba62cd4b7145e947219c");
    ECKey senderKey = ECKey.fromPrivate(Hex.decode("6ef8da380c27cea8fdf7448340ea99e8e2268fc2950d79ed47cbf6f85dc977ec"));
    byte[] receiverAddr = Hex.decode("5db10750e8caff27f906b41c71b3471057dd2004");
    for (int i = ethereum2.getRepository().getNonce(senderKey.getAddress()).intValue(), j = 0; j < 200; i++, j++) {
        {
            Transaction tx = new Transaction(ByteUtil.intToBytesNoLeadZeroes(i),
                    ByteUtil.longToBytesNoLeadZeroes(50_000_000_000L), ByteUtil.longToBytesNoLeadZeroes(0xfffff),
                    receiverAddr, new byte[]{77}, new byte[0]);
            tx.sign(senderKey);
            System.out.println("=== Submitting tx: " + tx);
            ethereum2.submitTransaction(tx);
            submittedTxs.put(new ByteArrayWrapper(tx.getHash()), Pair.of(tx, System.currentTimeMillis()));
        }
        Thread.sleep(7000);
    }
    Thread.sleep(100000000L);
}