1

I have run a full node on linux now I can run commands with bitcoin-cli like:

bitcoin-cli getbestblockhash

it returns:

0000000000344240308f54ded700542571b3df9efe05fab92e669099e20e0d92

or

bitcoin-cli getblockcount

82273

but I can't know where should I change get block to get headers:

https://bitcoin.org/en/developer-reference#getheaders

I want to get all headers instead of total blocks to have a SVP node.

1

You can use the command bitcoin-cli getblockheader "hash" ( verbose ) to return a specific block header. For more info: bitcoin-cli help getblockheader

but I can't know where should I change get block to get headers: https://bitcoin.org/en/developer-reference#getheaders

I want to get all headers instead of total blocks to have a SVP node.

The getheaders message referenced in that link is part of the peer-to-peer gossip protocol between nodes, not the command line interface. From that link:

The getheaders message requests a headers message that provides block headers starting from a particular point in the block chain. It allows a peer which has been disconnected or started for the first time to get the headers it hasn’t seen yet.

| improve this answer | |
  • Thank you, Yes I know about getblockheader command, but I want to have all headers instead of blocks. I have downloaded github.com/bitcoin/bitcoin and install it on linux. It works very well but I don't want to download 300GB, As I know SPV download only headers but I can't find any place to change type of message, change from block to header, something like a line to add bitcoin.conf – Hamid Naghipour May 3 at 13:41
  • 1
    @HamidNaghipour Bitcoin-core is a full node; there is no configuration options to turn it into a light-verification (SPV) wallet. You can enable pruning mode to trim the datadirectroy size down (to just a few gigs if you so desire), but your machine will still download and validate the whole chain first. If you are looking for an SPV wallet specifically, bitcoin-core is not what you want. – chytrik May 3 at 23:39

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.