Skip to content

Blockchain blocks

ChMarina edited this page Mar 20, 2019 · 3 revisions

To achieve the optimal volume of data storage, archiving and blockchain multi-level high-speed validation MetaHash uses 3 types of blocks.

MetaHash blocks:

Genesis block is a primary block, containing information on the initial release of coins and their distribution.

State block is a snapshot of a blockchain state. A State block is generated once per billion of transactions (250 GB) and requires a vote by all verification nodes. State blocks make it possible for verification nodes not to store older blocks, freeing space for new data, leaving old data in the data storage archive.

Micro block is generated every second based on Genesis or State blocks. Micro blocks are validated by a number of nodes that are available to run validation during the cycle, and checked by all validators upon their generation.

Block types in MetaHash transaction

There are several methods to request info about blockchain blocks. Follow the link to find out more about the methods. To describe all possible block types we use the following method as the example:

get-block-by-number

This method returns info about the block by its number:

Method is called with the following params:

number - block number

type - type of requested info: 2 - full block dump, 1 - only hashes, 0 or there isn’t - only block name.

Example

// Request
curl -s -X POST --data '{"id":1, "version":"1.0.0", "method":"get-block-by-number", "params":{"number":7907, "type":0}}' 0.0.0.0:9999

// Result
{
  "jsonrpc":"2.0",
  "id":1,
  "result":
  {
    "type":"block",
    "hash":"1172121c30fa86757a193170966903ef7a3dbb9dcdbad906040730f90465fb82",
    "prev_hash":"5d21042bc72ccdef03e27881375668abb3be33579714db3dfec101eba1521646",
    "tx_hash":"45df25ee86ae2245bde6bdc05e5b9910e45518b8825e361f5848ceae5bbd66a6",
    "number":7907,
    "timestamp":1545252302,
    "size":275,
    "fileName":"/data/metahash/20181219.blk"
  }
}

Pay attention to the type field in this method’s response, the type of the requested block returns in this field.

There are the following block types: block, state, forging.

To find out more about this request/response description of fields see the page.

You can’t perform that action at this time.