Block

Object schema

The block object inherits it’s properties from the web3 API:

  • number: Number - the block number.
  • hash: String - hash of the block.
  • parentHash: String - hash of the parent block.
  • nonce: String - hash of the generated proof-of-work.
  • sha3Uncles: String - SHA3 of the uncles data in the block.
  • logsBloom: String - the bloom filter for the logs of the block.
  • transactionsRoot: String- the root of the transaction trie of the block
  • stateRoot: String - the root of the final state trie of the block.
  • miner: String - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: BigNumber - integer of the difficulty for this block.
  • totalDifficulty: BigNumber - integer of the total difficulty of the chain until this block.
  • extraData: String - the “extra data” field of this block.
  • size: Number - integer the size of this block in bytes.
  • gasLimit: Number - the maximum gas allowed in this block.
  • gasUsed: Number - the total used gas by all transactions in this block.
  • timestamp: Number - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction hashes
  • uncles: Array - Array of uncle hashes.

Mapping

For some fields, there are multiple encodings available, which are nested as properties on the field. More information on those data types can be found here.

The following is the output of the Elasticsearch mapping for the Block type:

{
  "difficulty": {
    "properties": {
      "padded": {
        "type": "keyword",
        "ignore_above": 256
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "extraData": {
    "type": "keyword",
    "ignore_above": 256
  },
  "gasLimit": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "gasUsed": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "hash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "step": {
    "type": "keyword",
    "ignore_above": 256
  },
  "signature": {
    "type": "keyword",
    "ignore_above": 256
  },
  "logsBloom": {
    "type": "keyword",
    "ignore_above": 256
  },
  "miner": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "nonce": {
    "type": "keyword",
    "ignore_above": 256
  },
  "mixHash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "number": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "parentHash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "receiptsRoot": {
    "type": "keyword",
    "ignore_above": 256
  },
  "sha3Uncles": {
    "type": "keyword",
    "ignore_above": 256
  },
  "size": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "stateRoot": {
    "type": "keyword",
    "ignore_above": 256
  },
  "timestamp": {
    "type": "date",
    "format": "epoch_second"
  },
  "totalDifficulty": {
    "properties": {
      "padded": {
        "type": "keyword",
        "ignore_above": 256
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "transactionsRoot": {
    "type": "keyword",
    "ignore_above": 256
  },
  "uncles": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "sealFields": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  }
}