Skip to main content

GetBlockByHash

Query block information based on block hash

Parameter​

  • id: Transparent of information
  • jsonrpc: json version
  • params: parameter
    • blockHash: block hash
{
"id":"1",
"jsonrpc":"2.0",
"params":{"blockHash":"139009febd771d3f0d49d0ec179a8706e362af48a989dcfededb4aa2a18aaa08"}
}

Response​

  • id:
  • jsonrpc: json version
  • method: Call method name
  • result: result message
    • code: Return value number
      • 0 success
      • -1 Block hash error
    • message: Call information
    • blockInfo: Block information (see block information description for details)

Return to Example:​


{
"id": "1",
"jsonrpc": "2.0",
"method": "GetBlockByHash",
"result": {
"blockInfo": {
"block": {
"blocksign": [
{
"pub": "MCowBQYDK2VwAyEAvU/OXGoLVyRBFQe8V9FuD9xDVsTMhIkF6MQjCQjeaX4=",
"sign": "wL1MIpdaX1n6jwmt+Vt7NF+emCsCVkT1aOAw0jv2mhLMe3g4t1c/dNQ0zUBZWsbhnDDwIi7g30fG9S6ryanyAw==",
"signaddr": "0x116058AcF188BB96F9Da1317Bd11fD737E4f8Cd2"
},
{
"pub": "MCowBQYDK2VwAyEANFAhkjOUKAp0RbqjjiDetKQjcwQTXLRpL0Vh7uz3Sm0=",
"sign": "k469bWQ4LbkjpPtFIdIRbEaTCxIWm9PuSIypd47QbjrZW5FojwIs2cZi9pMbkVK+D6VGvmcG1jOPjw8WbUMTCg==",
"signaddr": "0x3b5AF36c2F269c4eA5ADffd12d65818A9cd94Dc2"
},
......
],
"bytes": 2399,
"data": {
"dependentCTx": ""
},
"hash": "0x139009febd771d3f0d49d0ec179a8706e362af48a989dcfededb4aa2a18aaa08",
"height": 541,
"merkleroot": "0x434026a97ff15f3519a95f3600c527d8b68cc72f279a4e36705b526900cbfbf0",
"prevhash": "0x96c1691d58d2cbec05eaf8792b2cd58fbbea0aad19ad3daf27b665fb5886f33c",
"time": 1716796707667741
},
"tx": [
{
"Consensus": 7,
"Type": "Tx",
"data": {
"TxInfo": {
"BonusAddr": "0x855052fa258B463AEAd1E5abD55F2ffbCBb3F022",
"InvestAmount": 1000000000000,
"InvestType": "Normal"
}
},
"identity": "0x116058AcF188BB96F9Da1317Bd11fD737E4f8Cd2",
"info": "MQ==",
"time": 1716796705692762,
"txHash": "0x434026a97ff15f3519a95f3600c527d8b68cc72f279a4e36705b526900cbfbf0",
"txType": 4,
"utxo": {
"multisign": [
{
"pub": "scIqQ/SPPhUc2egQgpEL21qk/NcnoH//xOv5h8M1hSXUGAM3CuitY1FEPI0QtRvXV5hmcajQlWDEDJ3bQDjVCg==",
"sign": "scIqQ/SPPhUc2egQgpEL21qk/NcnoH//xOv5h8M1hSXUGAM3CuitY1FEPI0QtRvXV5hmcajQlWDEDJ3bQDjVCg=="
}
],
"owner": [
"0x855052fa258B463AEAd1E5abD55F2ffbCBb3F022"
],
"vin": {
"prevout": {
"hash": [
"0x7637b67f47793d4bb9b017ead8d987971516e5b49a1073c8c6691f1e12c7ad6a"
]
},
"vinsign": [
{
"pub": "MCowBQYDK2VwAyEAwigpWZg9E0DRbbbNuE4PDHT7MJ9XIH2hh5yADHNa6jw=",
"sign": "wsdl+IJJ8aaC3q/em5cmUidQllESaePErugQT2xeUdRtohw7PQmi0X899BgZZE1sh8rhYnCC68kf19Y9W+ykAg=="
}
]
},
"vout": [
{
"addr": "VirtualInvest",
"value": 1000000000000
},
{
"addr": "0x855052fa258B463AEAd1E5abD55F2ffbCBb3F022",
"value": 1899998701374
},
{
"addr": "VirtualBurnGas",
"value": 32400
}
]
},
"verifySign": [
{
"pub": "MCowBQYDK2VwAyEAvU/OXGoLVyRBFQe8V9FuD9xDVsTMhIkF6MQjCQjeaX4=",
"sign": "yLr5Zft97qilx6KUPopmWwgVUG5WBG+rxU6gH+DtMKXNQkO7Fm+3/y3gAohj9UPhf7ECI+fTKczUz35tjC+/Bg==",
"signaddr": "0x116058AcF188BB96F9Da1317Bd11fD737E4f8Cd2"
},
{
"pub": "MCowBQYDK2VwAyEAh6RFUhVdsoE3MehHfFNlj4tWgyzLo+8F6SIPbW7zIYw=",
"sign": "",
"signaddr": "0x28bA6E30cB0d9372a18c80552eE11DFe47883FAd"
},
......
]
}
]
},
"code": 0,
"message": "success"
}
}

Example​

curl http://localhost:41517/GetBlockByHash -X POST -H "Content-Type: application/json" -d '
{
"id":"1",
"jsonrpc":"2.0",
"params":{"blockHash":"139009febd771d3f0d49d0ec179a8706e362af48a989dcfededb4aa2a18aaa08"}
}
'

Block detail info​

  • blocksign: Block flow signature
    • pub: Public key base64
    • sign: Signature based on 64
    • signaddr: Signature address
  • bytes: block size
  • hash: block hash
  • height: Block Height
  • merkleroot: Merkel Gen
  • prevhash: Pre block hash
  • tx: Transaction
  • data
    • Deploy contract
      • Transaction hash
        • creation: Contracts created within the contract
        • dependentCTx: Dependency relationship of contract
        • output: Binary code for deploying contracts
        • preHash: Pre hash of contract
        • storage: storage
    • Execute contract
      • Transaction hash
        • creation: Contracts created within the contract
        • dependentCTx: Dependency relationship of contract
        • destruction: Contract for destruction
        • log
          • creator: Contract address for generating logs
          • data: date
          • topics: topics
        • output: Output of the contract
        • preHash: Pre hash of contract
        • storage:storage