Author

Topic: Testnet Mining Question (Read 1285 times)

newbie
Activity: 6
Merit: 0
December 05, 2013, 05:38:03 PM
#2
Solved, now I'm mining like 50 blocks every 30 seconds.  Posting the fix in case anyone runs into this.  Compile bitcoind from source with the following 'fast-miner.patch'.  Enjoy!
======== patch follows ===========

--- a/src/main.cpp    2013-12-05 18:49:50.013814863 +0000
+++ b/src/main.cpp    2013-12-05 18:59:05.293814863 +0000
@@ -32,7 +32,7 @@

 map mapBlockIndex;
 uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
-static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
+static CBigNum bnProofOfWorkLimit(~uint256(0) >> 15);
 CBlockIndex* pindexGenesisBlock = NULL;
 int nBestHeight = -1;
 uint256 nBestChainWork = 0;
@@ -1072,7 +1072,7 @@
 }

 static const int64 nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
-static const int64 nTargetSpacing = 10 * 60;
+static const int64 nTargetSpacing = 10;
 static const int64 nInterval = nTargetTimespan / nTargetSpacing;

 //
newbie
Activity: 6
Merit: 0
December 04, 2013, 11:43:49 PM
#1
Hola!   I'm trying to mine funny money on the bitcoin testnet and having a problem getting my "bitcoins".  I sure hope somebody here can assist.  I can reward you with some conterfeit BTC for your time if we're successful.   Tongue

I've got a couple of bitcoind processes running (latest version 0.8.5) on a ubuntu VM.  I also downloaded the 'testnet-in-a-box' from github and followed the instructions with that to get things running.  I'm using cpuminer (minerd) to mine against it.  Things appear to be normal, here's some commands and their results which make me believe it's functioning normally. 

So, questions are, why aren't my coins confirmed and in my wallet? 
I see most have a category of 'immature' which I understand means their valid coins, but not truly valid until they are confirmed by peers on the network.  Isn't 10 confirmations enough?
I also never really told bitcoind where to put the coins, I figured it would just default to the default wallet.dat, but maybe I need to specify an address somewhere?

bitcoind getinfo
{
    "version" : 80500,
    "protocolversion" : 70001,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 31,
    "timeoffset" : 0,
    "connections" : 1,
    "proxy" : "",
    "difficulty" : 1.00000000,
    "testnet" : true,
    "keypoololdest" : 1386211650,
    "keypoolsize" : 6,
    "paytxfee" : 0.00000000,
    "errors" : ""
}
{
    "version" : 80500,
    "protocolversion" : 70001,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 31,
    "timeoffset" : 0,
    "connections" : 1,
    "proxy" : "",
    "difficulty" : 1.00000000,
    "testnet" : true,
    "keypoololdest" : 1338837868,
    "keypoolsize" : 6,
    "paytxfee" : 0.00000000,
    "errors" : ""
}

Here's the result of a bitcoind listtransactions command (just a snippet of the first of many similar ones):
        "account" : "",
        "address" : "n37fAnqNUcjJeKTG8YmHdqg9yjDtkxJSD2",
        "category" : "immature",
        "amount" : 50.00000000,
        "confirmations" : 10,
        "generated" : true,
        "blockhash" : "000000008061308fd286650e3ef34ee96838943ff96ae250a229f38ba69858d5",
        "blockindex" : 0,
        "blocktime" : 1386206816,
        "txid" : "e66fa4ae880ac2554e837e2e1496f5838c30b177be3d0e96e27db1778f7ac118",
        "time" : 1386206816,
        "timereceived" : 1386206816

Here's an excerpt from the bitcoind debug.log, it's basically just repeating this over and over for each block, but it looks happy - right?

ProcessBlock: ACCEPTED
keypool added key 211, size=6
keypool reserve 206
CreateNewBlock(): total size 1000
received getdata for: block 0000000057cd0dfd4e7ca136b87a0d762fcaae5ac53b63fa75e25874d63d3232
Flushing wallet.dat
Flushed wallet.dat 4ms
ResendWalletTransactions()
ThreadRPCServer method=listtransactions
Flushed 0 addresses to peers.dat  3ms
BitcoinMiner:
proof-of-work found 
  hash: 0000000085905c32abce594c39ea568d05983adea08ee67140210cb3bb53d19d 
target: 00000000ffff0000000000000000000000000000000000000000000000000000
CBlock(hash=0000000085905c32abce594c39ea568d05983adea08ee67140210cb3bb53d19d, ver=2, hashPrevBlock=0000000057cd0dfd4e7ca136b87a0d762fcaae5ac53b63fa75e25874d63d3232, hashMerkleRoot=9afdbcf53c2f3a7763789fb6c25c946c481ece5c94822a4d83ee5a0a46070b28, nTime=1386217255, nBits=1d00ffff, nNonce=1098763008, vtx=1)
  CTransaction(hash=9afdbcf53c2f3a7763789fb6c25c946c481ece5c94822a4d83ee5a0a46070b28, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 011f02cd00062f503253482f)
    CTxOut(nValue=50.00000000, scriptPubKey=03c6675bba8b76fc47014458ac9b19)
  vMerkleTree: 9afdbcf53c2f3a7763789fb6c25c946c481ece5c94822a4d83ee5a0a46070b28
generated 50.00
keypool keep 206
AddToWallet 9afdbcf53c2f3a7763789fb6c25c946c481ece5c94822a4d83ee5a0a46070b28  new
Committing 1 changed transactions to coin database...
SetBestChain: new best=0000000085905c32abce594c39ea568d05983adea08ee67140210cb3bb53d19d  height=31  log2_work=37.000022  tx=32  date=2013-12-05 04:20:55 progress=0.000038

Here's my bitcoin.conf:
# Important for testnet-in-a-box functionality:
testnet=1
irc=0
dnsseed=0
upnp=0
listen=0
checkpoints=0
connect=127.0.0.1:19000

# Feel free to change these:
rpcuser=test
rpcpassword=123
port=19010
rpcport=19011
keypool=5

Let me know if there's any other info you would find useful.  Thanks in advance!
 
Jump to: