<p>Bitcoin nodes advertise their services with the <code>nServices</code> bitmap. The first bit is <code>NODE_NETWORK</code> which indicates whether a node will be able to serve all blocks to other network participants. </p>

<p>Pruning nodes do not signal <code>NODE_NETWORK</code>, because they do not have a complete copy of the blockchain. They will however return any requested blocks they have in storage. As the minimum pruning size is 550 MB, they will be able to serve at least the last three days worth of blocks.</p>

CC BY-SA 3.0
2017-10-03T13:49:31.303Z
Is there a way for a node to serve blocks up to a certain height? Like the last 1000 blocks, f.e.? Other than just signaling `NODE_NETWORK` but refusing to send blocks you don't have?
Steven Roose
CC BY-SA 3.0
2017-10-03T18:05:17.613Z
@StevenRoose: As far as I know, pruning nodes will never serve blocks currently. There was something in the works to make them serve the ones they have, but as far as I'm aware, that's not done yet.
Murch
CC BY-SA 3.0
2017-10-03T18:18:38.527Z
@StevenRoose: I've doublechecked. Pieter says that they would serve the blocks they have, they just don't usually get asked for blocks because they do not set the `NODE_NETWORK` service flag.
Murch
CC BY-SA 3.0
2017-10-10T14:46:40.030Z
That makes sense. So there is just no "obligation" to send them if you have `NODE_NETWORK` set in order not to get banned when you don't have them. Does a node with `NODE_NETWORK` get banned when he is unable to provide a block?
Steven Roose
CC BY-SA 4.0
2020-10-08T21:53:11.953Z
I'm not sure. I would guess that it would at least cause the requesting node's peer score for the node to suffer, but I don't know whether it would cause an outright drop.
Murch
CC BY-SA 3.0
2017-10-03T04:17:38.803Z
2017-10-05T06:38:34.480Z
2017-10-05T06:38:34.480Z
Murch
<p>If you can connect to the node via <a href="https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs" rel="nofollow noreferrer">RPC</a>, you can issue a <a href="https://bitcoin.org/en/developer-reference#getblockchaininfo" rel="nofollow noreferrer"><code>getblockchaininfo</code></a> command to the node, that will tell you whether the node is pruned (<code>"pruned": True/False</code>) and the height at which the chain is pruned (<code>"pruneheight": X</code>). </p>

<p>The command will also show the current height of the chain (<code>"blocks": X</code>), so you can compute the actual number of stored blocks by substracting pruneheight from current heigh.  </p>

<p>Just as an example, this is the output of getblockchaininfo for a pruned node on the testnet:
<code>
{
  "chain": "test",
  "blocks": 1261324,
  "headers": 1261324,
  "bestblockhash": "000000000000075568c48c5bd77bdbe2a11eaa3416ad1ec066f290158d862259",
  "difficulty": 2108481.043832448,
  "mediantime": 1517322442,
  "verificationprogress": 0.9999987734618496,
  "chainwork": "000000000000000000000000000000000000000000000035070d21569475cdd3",
  "pruned": true,
  ...
  "pruneheight": 1225344
}
</code></p>

<p>So the node is storing 1261324 - 1225344 = 35980 complete blocks.</p>

CC BY-SA 3.0
2018-01-30T14:49:09.697Z
2018-01-30T14:49:09.697Z
cpsola
<p>Try: </p>

<pre><code>du -h $HOME/.bitcoin/blocks/
</code></pre>

<p>That will display the size of the blockchain your client has downloaded.
If your pruned, it shouldn't go above the size you set in bitcoin.conf</p>

CC BY-SA 3.0
2018-01-30T12:22:27.840Z
2018-01-30T12:22:27.840Z
iamanyone
<p>Is it possible to check if a specific node is running the full blockchain or a pruned one?</p>

<p>Also if you can, is it possible to check exactly how many (or roughly) how many blocks they are distributing.</p>

CC BY-SA 3.0
2017-10-03T04:18:31.073Z
Related: [Does having a pruned node reduce its network score?](https://bitcoin.stackexchange.com/q/53456/5406)
Murch
<pruning>
Can you check if a node is pruning?
masterq
# Can you check if a node is pruning?

(Asked by: username_0 on 2017-10-02)

Is it possible to check if a specific node is running the full blockchain or a pruned one?

Also if you can, is it possible to check exactly how many (or roughly) how many blocks they are distributing.

**Tags:** pruning

> **Comments:**
> **username_1**: Related: [Does having a pruned node reduce its network score?](https://bitcoin.stackexchange.com/q/53456/5406)  

---

## 3 answers

### Answer by username_1 on 2017-10-03. Score: 4

Bitcoin nodes advertise their services with the `nServices` bitmap. The first bit is `NODE_NETWORK` which indicates whether a node will be able to serve all blocks to other network participants.

Pruning nodes do not signal `NODE_NETWORK`, because they do not have a complete copy of the blockchain. They will however return any requested blocks they have in storage. As the minimum pruning size is 550 MB, they will be able to serve at least the last three days worth of blocks.

> **Comments:**
> **username_2**: Is there a way for a node to serve blocks up to a certain height? Like the last 1000 blocks, f.e.? Other than just signaling `NODE_NETWORK` but refusing to send blocks you don't have?  
> **username_1**: @username_2: As far as I know, pruning nodes will never serve blocks currently. There was something in the works to make them serve the ones they have, but as far as I'm aware, that's not done yet.  
> **username_1**: @username_2: I've doublechecked. Pieter says that they would serve the blocks they have, they just don't usually get asked for blocks because they do not set the `NODE_NETWORK` service flag.  
> **username_2**: That makes sense. So there is just no "obligation" to send them if you have `NODE_NETWORK` set in order not to get banned when you don't have them. Does a node with `NODE_NETWORK` get banned when he is unable to provide a block?  
> **username_1**: I'm not sure. I would guess that it would at least cause the requesting node's peer score for the node to suffer, but I don't know whether it would cause an outright drop.  

---

### Answer by username_3 on 2018-01-30. Score: 3

If you can connect to the node via [RPC](https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs), you can issue a [`getblockchaininfo`](https://bitcoin.org/en/developer-reference#getblockchaininfo) command to the node, that will tell you whether the node is pruned (`"pruned": True/False`) and the height at which the chain is pruned (`"pruneheight": X`).

The command will also show the current height of the chain (`"blocks": X`), so you can compute the actual number of stored blocks by substracting pruneheight from current heigh.

Just as an example, this is the output of getblockchaininfo for a pruned node on the testnet:
`{
"chain": "test",
"blocks": 1261324,
"headers": 1261324,
"bestblockhash": "000000000000075568c48c5bd77bdbe2a11eaa3416ad1ec066f290158d862259",
"difficulty": 2108481.043832448,
"mediantime": 1517322442,
"verificationprogress": 0.9999987734618496,
"chainwork": "000000000000000000000000000000000000000000000035070d21569475cdd3",
"pruned": true,
...
"pruneheight": 1225344
}`

So the node is storing 1261324 - 1225344 = 35980 complete blocks.


---

### Answer by username_4 on 2018-01-30. Score: 0

Try:

```
du -h $HOME/.bitcoin/blocks/

```

That will display the size of the blockchain your client has downloaded.
If your pruned, it shouldn't go above the size you set in bitcoin.conf


---

