Installation and usage of the platform
REST API: information about network blocks¶
A group of blocks
methods is provided to get information about the different blocks on the network.
GET /blocks/height¶
The method returns the number of the current block in the blockchain (block height).
Response example:
GET /blocks/height/{signature}¶
The method returns the block height by its {signature}
.
The method response contains the height
field, like the GET /blocks/height
method.
GET /blocks/first¶
The method returns information about the genesis block of the network.
The response contains the following parameters:
reference
– hash sum of the genesis block;blocksize
– size of the genesis block;signature
– signature of the genesis block;fee
– fees for the transactions included in the genesis block;generator
– address of creator of the genesis block;transactionCount
– number of 1 and 101 transactions included in genesis block;transactions
– array with the bodies of 1 and 101 transactions included in the genesis block;version
– version of the genesis block;timestamp
– Unix Timestamp of the genesis block (in milliseconds);height
– height of the genesis block (1).
Response example:
GET /blocks/last¶
The method returns the contents of the current block of the blockchain.
The current block is in the process of creation, until it is accepted by the miner nodes, the number of transactions in it may vary.
Parameters returned in the method response:
reference
– hash sum of the block;blocksize
– size of the block;features
– features running at the time of block creation;signature
– block signature;fee
– fees for transactions included in the block;``generator’’ – address of creator of the block;
transactionCount
– number of 1 и 101 transactions included in genesis block;transactions
– array with bodies of transactions included in the block;version
– version of the block;poa-consensus.overall-skipped-rounds
– number of missed mining rounds, when using the PoA consensus algorithm;timestamp
– Unix Timestamp of the block (in milliseconds);height
– height of the block.
Response example for an empty current block:
GET /blocks/at/{height}¶
The method returns the contents of the block at height
.
Parameters returned in the method response:
reference
– hash sum of the block;blocksize
– size of the block;features
– features running at the time of block creation;signature
– block signature;fee
– fees for transactions included in the block;``generator’’ – address of creator of the block;
transactionCount
– the number of transactions included in the block;transactions
– array with bodies of transactions included in the block;version
– version of the block;poa-consensus.overall-skipped-rounds
– number of missed mining rounds, when using the PoA consensus algorithm;timestamp
– Unix Timestamp of the block (in milliseconds);height
– height of the block.
Response example:
GET /blocks/seq/{from}/{to}¶
The method returns the contents of blocks from height {from}
to height {to}
.
Parameters identical to the GET /blocks/at/{height}
method are returned for each block.
GET /blocks/seqext/{from}/{to}¶
The method returns the contents of blocks with extended transaction information from height {from}
to height {to}
.
Other parameters returned for each block are identical to the GET /blocks/at/{height}
method.
GET /blocks/signature/{signature}¶
The method returns the block content by its {signature}
.
Parameters returned for each block are identical to the GET /blocks/at/{height}
method.
GET /blocks/address/{address}/{from}/{to}¶
The method returns the contents of all blocks generated by the {address}
from height {from}
to height {to}
.
The method response returns parameters identical to the GET /blocks/at/{height}
method for each block.
GET /blocks/child/{signature}¶
The method returns an inherited block from the block with {signature}
.
Parameters returned for each block are identical to the GET /blocks/at/{height}
method.
GET /blocks/headers/at/{height}¶
The method returns the header of the block at height
.
Parameters returned in the method response:
reference
– hash sum of the block;blocksize
– size of the block;features
– features running at the time of block creation;signature
– block signature;fee
– fees for transactions included in the block;``generator’’ – address of creator of the block;
pos-consensus.base-target
– the coefficient adjusting the block release time when using the PoS consensus algorithm;pos-consensus.generation-signature
– the signature needed to validate the block miner;poa-consensus.overall-skipped-rounds
– number of missed mining rounds, when using the PoA consensus algorithm;version
– version of the block;timestamp
– Unix Timestamp of the block (in milliseconds);height
– height of the block.
Response example:
GET /blocks/headers/seq/{from}/{to}¶
The method returns the headers of blocks from height {from}
to height {to}
.
The method response returns parameters identical to the GET /headers/at/{height}
method for each block.
GET /blocks/headers/last¶
The method returns the header of the current block.
The method response returns parameters identical to the GET /headers/at/{height}
method for each block.