Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Block Query Fields

Akhila Raju edited this page Jul 26, 2018 · 2 revisions

The following fields can be queried on a block. For information on each field, search the Document Explorer in the EthQL demo for the 'Block' field. Fiddle with this query.

{
  block(number: 5450945) {
    number
    hash
    parent {
      number
    }
    nonce
    transactionsRoot
    transactionCount
    stateRoot
    receiptsRoot
    miner
    extraData
    gasLimit
    gasUsed
    timestamp
    logsBloom
    mixHash
    difficulty
    totalDifficulty
    ommers
    transactionAt(index: 10) {
      status
    }
    transactions(filter: { contractCreation: false, withInput: false, withLogs: false }) {
      nonce
      inputData
      logs
    }
    transactionsInvolving(participants: ["0x4156D3342D5c385a87D264F90653733592000581", "0x0D17Ed2bBB242173d72B28bBc42216AC2fE53a88"]) {
      from {
        address
      }
      to {
        address
      }
    }
    transactionsRoles(from: "0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE", to: "0x0D17Ed2bBB242173d72B28bBc42216AC2fE53a88") {
      from {
        address
      }
      to {
        address
      }
      value
    }
  }
}

The example query above returns the following:

Note: transactions under transactions(filter) were omitted to save space

{
  block(number: 5450945) {
    number: 5450945
    hash: "0x7265fe158123e5cc8fa433c6c82e377cd62aa4efad94a1f7224770f492ca82ad"
    parent: {
      number: 5450944
    }
    nonce: "0x549fdfc401e89aed"
    transactionsRoot: "0x78588ee21334e0f2fad06c1a30c7e6bad9f24fc6727ae31646ec2107407101b8"
    transactionCount: 154
    stateRoot: "0xfb2e3816a7508c11b18895024bb3e416bf830959ff944ac4d5aa9657ec01d520"
    receiptsRoot: "0x98860063878e14384c0e98e2a05395601e7943d08aeb40f92d013d1a70be9e2d"
    miner: {
      address: "0x829BD824B016326A401d083B33D092293333A830"
    }
    extraData: "0xe4b883e5bda9e7a59ee4bb99e9b1bc"
    gasLimit: 8000000
    gasUsed: 7984342
    timestamp: "1523882396"
    logsBloom: "0x00022080004100004a00000240a64000601000481803007701cd0460403c0148008200808024c9380036420200e91c0188800808448c42004940000100620014b80000c21a14819b001354a82080008112500804000c00090081a0864c650820a4a04120274502c0548040000100470578210800a88e012062024514e0002060654208640d670b00a0000214100211200282800004d044308406004020140060520363400840010088a4311082528205001046018201c846c00800c1c01108cc24809406018c080000101402001c642228540144180800048c000000840c40002114004300b142082000008800c0a2045a0400006408062000221c0122848180"
    mixHash: "0x977183bfb7d02e5acba7732b156d28e6b53f5022dc9b23481942a7130c14f3ef"
    difficulty: 3150344077203649
    totalDifficulty: 3.6724454067695114e+21
    ommers: null
    transactionAt: {
      status: "SUCCESS"
    }
    transactions: [
      {
        nonce: 330595
        inputData: null
        logs: []
      },
            .
            .
            .
      {
        nonce: 36,
        inputData: null
        logs: []
      }
    ]
    transactionsInvolving: {
      {
        from: {
          address: "0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE"
        }
        to: {
          address: "0x0D17Ed2bBB242173d72B28bBc42216AC2fE53a88"
        }
      },
      {
        from: {
          address: "0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE"
        }
        to: {
          address: "0x4156D3342D5c385a87D264F90653733592000581"
        }
      }
    }
    transactionsRoles: {
      from: {
        address: "0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE"
      }
      to: {
        address: "0x0D17Ed2bBB242173d72B28bBc42216AC2fE53a88"
      }
      value: 314916320000000000
    }
  }
}