Skip to main content

Block Query

In this section, we show you how to select all flakes from a block or a selection of blocks. Fluree allows you to select data from an entire block or block range. All of these queries can be issued through the API or the user interface (select FlureeQL in the sidebar, then make sure Query is selected in the top-right, and Block is selected in the dropdown).

To issue these queries using the API, see /block.

Block Clauses

A block query requires a block key, which specifies a block or range of blocks to return. There are a variety of options for how to format this value. They are listed below.

A block query can also optionally include a prettyPrint key, which pretty prints the results if true.

KeyRequired?Description
blockyesA block or range of blocks to return, options for the format of this value are listed below.
prettyPrintnoOptional, true or false, whether to pretty print results. Default false

Query Single block

To query a single block, you specify the block number, an ISO-8601 formatted wall clock time, or an ISO-8601 formatted duration.

Using a block number:

{
"block": 3
}

Using an ISO-8601 formatted wall-clock time:

{
"block": "2017-11-14T20:59:36.097Z"
}

Query Block Range

To query a range of block, specify a lower and upper limit (inclusive).

{
"block": [3, 5]
}

Query Block Range, Lower Limit

To query a range of block, starting with a lower limit, specify just the lower limit (inclusive).

{
"block": [3]
}

Pretty Print Block Query

In FlureeQL, you can pretty print the results of a block query by adding "prettyPrint": true to your query map. Any format of block query can be pretty printed.

{
"block": [3],
"prettyPrint": true
}