you_getBlockByNumber

描述:返回指定编号的块

parameter

数据类型 备注
String 块高度,或字符串标识 "earliest"、"latest" 或"pending"
Boolean 为 true 时区块中的 transactions字段返回完整交易对象数组,为 false 时区块中的 transactions 字段只返回交易哈希数组
"params": ["0x5107", true]

return

Object - 匹配的块对象,如果未找到块则返回 null,结构如下:

参数值 数据类型 备注
number String 块编号,挂起块为 null
hash String, 32 Bytes 块哈希,挂起块为 null
parentHash String, 32 Bytes 父块的哈希
logsBloom String, 256 Bytes 块日志的 bloom 过滤器,挂起块为 null
transactionsRoot String, 32 Bytes 块中的交易树根节点
stateRoot String, 32 Bytes 块最终状态树的根节点
receiptsRoot String, 32 Bytes 块交易收据树的根节点
stakingRoot String Staking 树树根节点
miner String, 20 Bytes 挖矿奖励的接收账户
consensus String 区块头共识相关数据
mixHash String UCon 共识信息摘要的哈希值
extraData String 块额外数据
size String 本块字节数
gasLimit String 本块允许的最大 gas 用量
gasUsed String 本块中所有交易使用的总 gas 用量
gasRewards String 本块中所有交易的总费用
subsidy String 区块补贴,以 lu 为单位
timestamp String 块时间戳
transactions Array 交易对象数组,或 32 字节长的交易哈希数组
slashData String 惩罚信息
signature String 区块提议者对区块的签名
bltRoot String BloomBits 树根,与 chtRoot 在相同块高出现
certificate String 对 chtRoot 和 bltRoot 的附加投票数据
chtRoot String 权威哈希树根,只在特定块高上出现(主网将会是 i*32768 )
valRoot String 验证者集合树根节点
validator String 投票信息
version String 当前共识协议版本
nextVersion String 下一个共识协议版本
nextApprovals String 下一轮投票的数量
nextSwitchOn String 如果超过投票阈值,在特定 round 切换版本
nextVoteBefore String 下一次投票到特定的轮数

example

Request:

curl -X POST \
  http://127.0.0.1:8283 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "you_getBlockByNumber", "params": ["0x11", true]}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "bltRoot": "0x",
        "certificate": "0xc701c0c0c0808080",
        "chtRoot": "0x",
        "consensus": "0xf9011381ee01a07d971adce82186240d828f8bd3a7a70643a9b99b93823832bffabe66094cc272b8813fcadde9a438962653d5c39f81a44072527ad5d6505b868ff6871028605e29af370afd5b51d52df7917a7a0afb919d72bc05d45d5898d9178d6143679a1094ed04892e9c9b2773f7ae550cfbfc46bcf38c2da937b0be910dc83203f4e518d8ced57ea71403bf4ad89dd1882f47db55d7e4d0b482a7f6163c49e928f494e42182d0a0ff27e2b96591bb771f51f67bce8c3509edf1d19f1f7348b3224d2763dbb2f2780bb8416e00f8e7bbc12034154269fdaa9096052f0fe0152316e9f6621eb27ef3fe43e72542cbbf79c6232fba44520c8fb11a2d38c5a7bbb3f5991c2c75850ffad9cca1001a8207d0820fa0",
        "extraData": "0x",
        "gasLimit": "0x87a238",
        "gasRewards": "0x0",
        "gasUsed": "0x0",
        "hash": "0x904034dba7c1f6af27266fc3f9a142d5340c59d822e05f99fdd375186a0af1f1",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000008000000000000000000000000000000000400000000000000000000000004000000000000000000000000000000000000000000000000000000",
        "miner": "0x0accc24e66523f71cad3ee75ca2af78fcffc8338",
        "mixHash": "0x87c71741b903194ab0eb0bd581d5c522f0328e979f3c1bf29f6068bd2797fdf8",
        "nextApprovals": "0x0",
        "nextSwitchOn": "0x0",
        "nextVersion": "0x0",
        "nextVoteBefore": "0x0",
        "number": "0xee",
        "parentHash": "0xb95633959f9ab011d1485127b6cc8cedfa35930c661096f6ee6d5019ed7a6676",
        "receiptsRoot": "0xb4bd9a040884b14da9a60fc344d971a53dd381b30f6e8563be1f3aca0cfe2295",
        "signature": "0xdadd88f2e9953a6f4ce8a8d224ad718a62afdaa98c5c28bf59f3c1982a61e7e01260c171a6cd48a162fec31256919267615df0cb13a720282162f63507bac59401",
        "size": "0x677",
        "slashData": "0x",
        "stakingRoot": "0x8692228215ecf55f9dab65ed9dddf6549bac96010a122732524ad2f6c7ea9602",
        "stateRoot": "0x07e1b6a9f358484116e1d2a9f2294e18c929871c7294d6a38687cc37c17105c1",
        "subsidy": "0x3e73362871420000",
        "timestamp": "0x5ec2a5e3",
        "transactions": [],
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "valRoot": "0xa2c380971688f1204b1c32dc3f0abbd66ee72e500d9f6eb7c5eaaa6a25b57d39",
        "validator": "0xf902e701f902aef8888082025e80b881c19606ae3ddeee2571042d891c0e4242544772b0a09bc226d8edc917b0e65d746f4494a6c1441d38dc0979a248b3e0c42df1fc879ef91c56804f3fdc1769822a0487cfea957bd428c182423a95b9014ea5e06dbcd6695b90c17344ec044a62857274c6b5b51e95e5735e04108b6e48e8ce811f8d092c945c40b7e48ec7b6d9bdeef8880282024080b881d85342065be23e43623e290d2c0f6f0c1ee103812490fdd180777f311e08aa87c754f8a2f5ed62b278be09d2c975493db570cf11fa6fd8fcf43d01ddd25488e20405a5a8c10b49878eca7a660cbcdc50aa8e5231e081cbba0fac6e98b26c28a204d4c7a9f8b93a11f6e5f355a4ed85ac6ce2dcdfbe0392681af87c077d37fe6c22f8880182024180b881d9bd539cc8e5ca8f20f16b5d3f1ddcf0b4238d804f0b55cf9775d44fb20ab6b40cc5b336a26b59f32e42b7e5b0610ff59d69fe772142fcb3965e647f360ae125046b4c356b3db8ff85560d83045a4c04aa0fca765ce4067078785343eeda0bfefdae0b4bac49baed23a187729b4bfacecc07adeca8799d09362a29d133f50ec505f886045f80b88128c361acb4f3ea68e726dcaede7a79f4ace1334ca52a5351024bae0a5e923263734d66501aedc97e556414ac758dfc64ef9737e6a53c4f6a5fa9bfe34bc6effb04cb877e5872313cebcf95fb009981f4987c0e4915524ea8545d0d3b9d1b725ce0e5b91400fe671f792da761a3a218130061836bb43d124d7c0cef840a18518832f886036880b8812ab9d814b1c70410647f691e4766e8f7a5924f0835cf5ec5dc23594db5247160148e4c23cb9279cf4d49313efe879ee601e6e3caacc2e889ed761b2333a9a54f04ccfecb7cd18c75d89822980beb182f67f73c0f43df9e5376a305fca0bafeee938c39dd476aa97b26773b5c9894912e3a87a23093a06c8a55a9e8041cb7b09302c0c0b0b7171cc14824d73611a049f56e8d8a9507dd191e02bb8660609efa3092a0335319109e2a584e518fbcbf8d263d618fd38080",
        "version": "0x1"
    }
}