Filecoin RPC 接口之根据块 CID 获取块的信息

yufei       4 年, 4 月 前       1113

Filecoin RPC 接口之根据块 CID 获取块的信息 ,调用的 RPC 方法名是 Filecoin.ChainGetBlock

Curl 发起的请求为

curl -X POST \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer $(cat ~/.lotusstorage/token)" \
     --data '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetBlock", "params": [{"/":"bafy2bzacec7bujc4alv7axu3o4jvqyc6qimxxrrqfnl2rowpkg4gwxtafvutg"}], "id": 3 }' \
     'http://127.0.0.1:1234/rpc/v0'

注意: 传递的参数是一个对象,而且键是 /

返回的信息如下

{
    "jsonrpc":"2.0",
    "result":{
        "Miner":"t01000",
        "Ticket":{
            "VRFProof":"mN1tUoV4Rb3zixnO10PpgVsjX0oQybCBexTZ3fQKsxUbWZFyYke7SwcvU9PrgVMfFf6d8FFhXcMIOXCeJ5b8CE2C7uOFeUO0kX7LMf7Lw5wM2Cfln9p/O/NxkpvnjYwA"
        },
        "ElectionProof":{
            "WinCount":6,
            "VRFProof":"jSlHmidan1a9m/JrRYWDdY1VI6mjT4inEkgVJEaFoZwaMUneH91ABGergkIp2+WnFDdlik/HRUwoA2HuhuMxbw/8MTxj3RDJXtsU64Cz1LbOWeGwE3Wygrmqj9Gy2yoB"
        },
        "BeaconEntries":null,
        "WinPoStProof":[
            {
                "PoStProof":0,
                "ProofBytes":"dmFsaWQgcHJvb2Y="
            }
        ],
        "Parents":[
            {
                "/":"bafy2bzacedqnlcxiif2yocaggj7l744gkfncl2f2qxv3wlq23xa5n6za2jeek"
            }
        ],
        "ParentWeight":"38784",
        "Height":7,
        "ParentStateRoot":{
            "/":"bafy2bzaceb6hmdvn6dzudxij7rs2tiessedvhn2ei5s3ddaaugj5ogvzio43k"
        },
        "ParentMessageReceipts":{
            "/":"bafy2bzacedswlcz5ddgqnyo3sak3jmhmkxashisnlpq6ujgyhe4mlobzpnhs6"
        },
        "Messages":{
            "/":"bafy2bzacecmda75ovposbdateg7eyhwij65zklgyijgcjwynlklmqazpwlhba"
        },
        "BLSAggregate":{
            "Type":2,
            "Data":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        },
        "Timestamp":1595830291,
        "BlockSig":{
            "Type":2,
            "Data":"qOrg2YrWtmcIsGyCZqO4ilPtlCG/gltMTXEteSIZQUd9ZLn1UlSrrcnjNEPSdGZODjBx7noqP2gvtcDbbHMVxQMLLOHkCtUaFj/P4sxPCPhLMawb/8tzq9mrjroSAbnH"
        },
        "ForkSignaling":0
    },
    "id":3
}
目前尚无回复
简单教程 = 简单教程,简单编程
简单教程 是一个关于技术和学习的地方
现在注册
已注册用户请 登入
关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.