1

I just finished downloading bitcoin core on windows 7 and I am trying to create a raw transaction. When I typed listunspent 0 or listunspent 1 on console, I got no message (empty message) in the console. How do I get raw transaction txid, scriptpubkey using bitcoin core console ?

0

Bitcoin is an open source platform where everyone who runs a full node verifies each and every transaction that has ever happened on the network. It checks that the transaction does not double spend the bitcoins, verifies the signatures (if you set assumevalid=0), and the block structure and proof of work. Thus it takes time for your node to sync up to the current state of the network.

As you have stated in the question, you have just finished downloading the Bitcoin Core software. This means you did not give your node the time yet to finish syncing with the network and verifying every transaction. Depending on the type of machine you are using this should take between couple of days to a week. This is not because of the time needed to download the blocks, but due to the time needed to verify each and every transaction.

If you run your node in pruned mode, you won't be able to query transactions from blocks that are deleted to conform with the prune requirements. Moreover, you will need to set txindex=1 to maintain an index of transaction if you want to query it using txid.

  • My bitcoin core has finished synchronizing and it is update – Red Cash Feb 15 at 14:00
  • @RedCash if you run the command getblockchaininfo do you see that headers = blocks? It should be around 617616. Also, have you set txindex=1 in the bitcoin.conf file? – Ugam Kamat Feb 16 at 9:57
  • Yes when I ran getblockchaininfo, I could see the values of chain: main, blocks: 618239, headers: 618239 and NO i have not set txindex=1. Pls how do I set txindex=1? – Red Cash Feb 20 at 19:14
  • @RedCash You can set the parameter in the bitcoin.conf file. But note, you would have to reindex the blockchain so that the index can be set to the transactions. If you are running a pruned node, then txindex parameter cannot be set. – Ugam Kamat Feb 22 at 7:10
  • I have set txindex=1 in bitcoin.conf but nothing has changes. Same empty message in console after I typed listunspent 0 or listunspent 1. I just wanted to be able to spend unspent bitcoins using bitcoin core. – Red Cash Feb 24 at 15:31

Your Answer

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

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