<p>You can use the command <code>bitcoin-cli getblockheader &quot;hash&quot; ( verbose )</code> to return a specific block header. For more info: <code>bitcoin-cli help getblockheader</code></p>
<blockquote>
<p>but I can't know where should I change get block to get headers: <a href="https://bitcoin.org/en/developer-reference#getheaders" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#getheaders</a></p>
<p>I want to get all headers instead of total blocks to have a SVP node.</p>
</blockquote>
<p>The <code>getheaders</code> message referenced in that link is part of the peer-to-peer gossip protocol between nodes, not the command line interface. From that link:</p>
<blockquote>
<p>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.</p>
</blockquote>

CC BY-SA 4.0
2020-05-03T13:41:45.433Z
Thank you, Yes I know about getblockheader command, but I want to have all headers instead of blocks. I have downloaded https://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
CC BY-SA 4.0
2020-05-03T23:39:08.417Z
@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
CC BY-SA 4.0
2020-05-03T12:09:48.027Z
2020-05-03T12:09:48.027Z
2020-06-16T11:10:03.350Z
chytrik
<p>I have run a <code>full node</code> on <code>linux</code>
now I can run commands with <code>bitcoin-cli</code> like:</p>

<pre><code>bitcoin-cli getbestblockhash
</code></pre>

<p>it returns:</p>

<pre><code>0000000000344240308f54ded700542571b3df9efe05fab92e669099e20e0d92
</code></pre>

<p>or</p>

<pre><code>bitcoin-cli getblockcount

82273
</code></pre>

<p>but I can't know where should I change get block to get headers: </p>

<p><a href="https://bitcoin.org/en/developer-reference#getheaders" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#getheaders</a></p>

<p>I want to get all headers instead of total blocks to have a <code>SVP</code> node.</p>

<bitcoin-core><bitcoind><full-node><spv>
How to getheaders from blockchain?
Hamid Naghipour
# How to getheaders from blockchain?

(Asked by: username_0 on 2020-05-03)

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.

**Tags:** bitcoin-core, bitcoind, full-node, spv


---

## 1 answers

### Answer by username_1 on 2020-05-03. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: Thank you, Yes I know about getblockheader command, but I want to have all headers instead of blocks. I have downloaded https://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  
> **username_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.  

---

