2

I'm trying to setup a local testnet with multiple nodes. Currently I have three nodes, and their mining powers are almost the same.

Things have been quite ok so far, except some problems that I need to ask from you.

  1. When I run the getblocktemplate rpc call (because I later want to run a pool), it returns the message as in the title. For example:

    ./src/bitcoin-cli -datadir=./localnet getblocktemplate error: {"code":-10,"message":"Bitcoin is downloading blocks..."}

although there are already 10 blocks in the blockchain maintained by the node. Its the same for other nodes as well. So why does that happen?

  1. The nodes do not sync up very often although they are all connected together (each node has 2 inbound connections and 2 outbound connections). It is so often that one node is 2 block ahead of other and remains so for a long time. Thus, again, why does that happen? I thought after finding a valid block, the node will broadcast that to every connected node and the network will work on top of that block?

Please let me know if you can help answer either one or all the questions.

1 Answer 1

2

For your first question, the message "Bitcoin is downloading blocks" is produced if the client hasn't yet downloaded all the checkpoint blocks. For testnet, there is exactly one checkpoint block, at height 546. So until your client has mined 546 blocks, you will continue to get this message.

Unfortunately, when you do mine block number 546, it will be rejected since its hash won't match the hardcoded checkpoint, and you will still get this message anyway. So you will have to remove the checkpoint from the code and replace it with a zero-height checkpoint matching your genesis block.

4
  • I just add one more question, please check if you can help @Nate
    – Loi.Luu
    Commented Sep 24, 2014 at 5:24
  • @Loi.Luu: You should really remove it and ask it as a separate question. Multi-question posts are discouraged as they make it harder for future users to find what they need. Commented Sep 24, 2014 at 5:27
  • Thanks, I thought it would be a more helpful thread... Will do it immediately.
    – Loi.Luu
    Commented Sep 24, 2014 at 5:28
  • Btw, your answer does solve the second problem also :)
    – Loi.Luu
    Commented Sep 24, 2014 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.