Home | API

Blocks

Blocks are added every eight seconds to the blockchain by a Delegate Node. Due to network/technical errors, a Delegate might miss a block. The time between two blocks is then 16 seconds, as the round continues to the next Delegate.

All state changes to the blockchain are in the form of blocks; they contain a set of transactions and metadata. A block is rejected if one or more of the transactions is invalid; or if the metadata is invalid. Thus a block returned from the Public API is always valid.

Endpoints

List All Blocks

The Public API may be used to query for blocks. This dataset contains millions of blocks; thus for analytical purposes, we recommend you use the Elasticsearch plugin or query the database directly.

Endpoint

GET

Query Parameters

Name page
Description
The number of the page that will be returned.
Required No
Example 1
Name limit
Description
The number of resources per page.
Required No
Example 100
Name id
Description
The identifier of the block to be retrieved.
Required No
Example
Name height
Description
The height of the block to be retrieved.
Required No
Example

Retrieve a block

Blocks may be retrieved by ID or by height. The height is an incremental integer.

Endpoint

GET

Path Parameters

Name id
Description
The identifier of the block to be retrieved.
Required No
Example
Name height
Description
The height of the block to be retrieved.
Required No
Example

List All Transactions in a Block

Instead of deserializing the block’s payload; you can also obtain the transactions of each block as proper transaction objects directly.

Endpoint

GET

Path Parameters

Name id
Description
The identifier of the block to be retrieved.
Required No
Example
Name height
Description
The height of the block to be retrieved.
Required No
Example

Query Parameters

Name page
Description
The number of the page that will be returned.
Required No
Example 1
Name limit
Description
The number of resources per page.
Required No
Example 100

Search All Blocks

It is possible to filter for specifics blocks using the search resource. Filtering for blocks at the Node side is a lot more efficient than requesting a large payload and filtering it at the client side.

Endpoint

POST

Query Parameters

Name page
Description
The number of the page that will be returned.
Required No
Example 1
Name limit
Description
The number of resources per page.
Required No
Example 100

Body Parameters

Name id
Description
ID of the block.
Required No
Example
Name numberOfTransactions.to
Description
The number of transactions in the block must be smaller or equal to this.
Required No
Example
Name payloadLength.from
Description
Block payload length must be bigger or equal to this.
Required No
Example
Name payloadLength
Description
Range for block payload length. In bytes.
Required No
Example
Name reward.to
Description
Block reward must be smaller or equal to this.
Required No
Example
Name reward.from
Description
Block reward must be bigger or equal to this.
Required No
Example
Name reward
Description
Range for block reward. In arktoshi.
Required No
Example
Name totalFee.to
Description
The sum of all transactions' fees in the block must be smaller or equal to this.
Required No
Example
Name totalFee.from
Description
The sum of all transactions' fees in the block must be bigger or equal to this.
Required No
Example
Name totalFee
Description
Range for the sum of all transactions' fees in the block. In arktoshi.
Required No
Example
Name totalAmount.to
Description
Block total amount must be smaller or equal to this.
Required No
Example
Name totalAmount.from
Description
Block total amount must be bigger or equal to this.
Required No
Example
Name totalAmount
Description
Range for total amount transacted in the block, including block reward, transaction fees and transactions' amounts. In arktoshi.
Required No
Example
Name numberOfTransactions.from
Description
The number of transactions in the block must be bigger or equal to this.
Required No
Example
Name version
Description
Version of the block.
Required No
Example
Name numberOfTransactions
Description
Ranage for number of transactions contained in the block.
Required No
Example
Name height.to
Description
Block height must be smaller or equal to this.
Required No
Example
Name height.from
Description
Block height must be bigger or equal to this.
Required No
Example
Name height
Description
Height range of the block. The genesis block has height 1.
Required No
Example
Name timestamp.to
Description
Block creation time must be smaller or equal to this.
Required No
Example
Name timestamp.from
Description
Block creation time must be bigger or equal to this.
Required No
Example
Name timestamp
Description
Timestamp range for block creation time. Measured in number of seconds since the genesis block.
Required No
Example
Name blockSignature
Description
Signature of the block.
Required No
Example
Name generatorPublicKey
Description
Public key of the forger who forged the block.
Required No
Example
Name payloadHash
Description
Hash of the payload.
Required No
Example
Name previousBlock
Description
ID of the previous block.
Required No
Example
Name payloadLength.to
Description
Block payload length must be smaller or equal to this.
Required No
Example

2020 © ARK.io | All rights reserved | An ARK.io Product