<p>To enable the compact block filter, you need to start bitcoind with the <code>-blockfilterindex=basic</code> (or simply <code>-blockfilterindex</code>) command line option, or put that option in your bitcoin.conf file.</p>
<p>Depending on your hardware, it may take a few hours to build the compact block filter index. This is done in the background and does not affect normal node or wallet processing.</p>

CC BY-SA 4.0
2022-07-07T00:27:06.287Z
are there any other type of filters available? or is the only filtertype "basic"?
Sachin Meier
CC BY-SA 4.0
2022-07-08T11:22:03.487Z
@SachinMeier Currently there is only one filter type defined (in BIP158) and implemented in Bitcoin Core. There was originally planned to be an 'extended' filter type, but that was removed during development of the proposal here: https://github.com/bitcoin/bips/pull/687.
jnewbery
CC BY-SA 4.0
2020-06-30T16:48:18.973Z
2020-06-30T16:48:18.973Z
jnewbery
<p>I'm failing to run the <code>getblockfilter</code> example. What am I doing wrong?</p>
<pre><code>$ bitcoin-cli help getblockfilter
getblockfilter &quot;blockhash&quot; ( &quot;filtertype&quot; )

Retrieve a BIP 157 content filter for a particular block.

Arguments:
1. blockhash     (string, required) The hash of the block
2. filtertype    (string, optional, default=basic) The type name of the filter

Result:
{                      (json object)
  &quot;filter&quot; : &quot;hex&quot;,    (string) the hex-encoded filter data
  &quot;header&quot; : &quot;hex&quot;     (string) the hex-encoded filter header
}

Examples:
&gt; bitcoin-cli getblockfilter &quot;00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09&quot; &quot;basic&quot;
&gt; curl --user myusername --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getblockfilter&quot;, &quot;params&quot;: [&quot;00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09&quot;, &quot;basic&quot;]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

$ bitcoin-cli getblockfilter &quot;00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09&quot; &quot;basic&quot;
error code: -1
error message:
Index is not enabled for filtertype basic

$ bitcoind --version
Bitcoin Core version v0.20.0.0-ga62f0ed64f8bbbdfe6467ac5ce92ef5b5222d1bd
...
</code></pre>
<p>Do I need to build a block filter index or something?</p>

<compact-client-side-block-filters>
getblockfilter Error: Index is not enabled for filtertype basic
justinmoon
# getblockfilter Error: Index is not enabled for filtertype basic

(Asked by: username_0 on 2020-06-30)

I'm failing to run the `getblockfilter` example. What am I doing wrong?

```
$ bitcoin-cli help getblockfilter
getblockfilter "blockhash" ( "filtertype" )

Retrieve a BIP 157 content filter for a particular block.

Arguments:
1. blockhash     (string, required) The hash of the block
2. filtertype    (string, optional, default=basic) The type name of the filter

Result:
{                      (json object)
  "filter" : "hex",    (string) the hex-encoded filter data
  "header" : "hex"     (string) the hex-encoded filter header
}

Examples:
> bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

$ bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
error code: -1
error message:
Index is not enabled for filtertype basic

$ bitcoind --version
Bitcoin Core version v0.20.0.0-ga62f0ed64f8bbbdfe6467ac5ce92ef5b5222d1bd
...

```

Do I need to build a block filter index or something?

**Tags:** compact-client-side-block-filters


---

## 1 answers

### Answer by username_1 on 2020-06-30. Score: 7 | Accepted answer

To enable the compact block filter, you need to start bitcoind with the `-blockfilterindex=basic` (or simply `-blockfilterindex`) command line option, or put that option in your bitcoin.conf file.

Depending on your hardware, it may take a few hours to build the compact block filter index. This is done in the background and does not affect normal node or wallet processing.

> **Comments:**
> **username_2**: are there any other type of filters available? or is the only filtertype "basic"?  
> **username_1**: @username_2 Currently there is only one filter type defined (in BIP158) and implemented in Bitcoin Core. There was originally planned to be an 'extended' filter type, but that was removed during development of the proposal here: https://github.com/bitcoin/bips/pull/687.  

---

