Language

Choose a language

/build/rpc / btc

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": "2.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

getblockfilter(blockhash: string, filtertype?: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"getblockfilter","params":["\"<blockhash>\"","basic"]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
blockhashstringyesThe hash of the block
filtertypestringThe type name of the filter

Result

Type:  any

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

Source: services/core-node/bcore/src/rpc/blockchain.cpp:2852

C++ symbol: getblockfilter