Filecoin RPC 接口之获取最新块信息

yufei       6 天, 16 小时 前       15

Filecoin RPC 接口之获取最新块信息 ,调用的 RPC 方法名是 Filecoin.ChainHead

Curl 发起的请求为

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

返回的信息如下

{
    "jsonrpc":"2.0",
    "result":{
        "Cids":[
            {
                "/":"bafy2bzacebtpmfbqiw4rzg7m4ytgkis4uhcytu772qzhuqxjmnhb4fdvyudoe"
            }
        ],
        "Blocks":[
            {
                "Miner":"t01000",
                "Ticket":{
                    "VRFProof":"p/EE8Ju3Ze0au1874hhGdMemVQQSUYzTRdYybYSBg1NDimVNFlStd0BNXor9oKevCI97lWdA3awXGy9VLfdY4sXJf5TZJhW9OicRyp6vhRBZgSkQWeaTDrNIkbdwwqVH"
                },
                "ElectionProof":{
                    "WinCount":5,
                    "VRFProof":"hCCrFoCLe30pdhhzVBBTa6f5hAPV+CaImrekyvcjG1nAXlnxDLqdFbP+Mu8VhtyMBAjqOk6TEb9rEIYRG9fFiQ8DV+Xjl9ftZ6B0EXkthRHEp3Dq9RuSxjPO2AaH1ifj"
                },
                "BeaconEntries":null,
                "WinPoStProof":[
                    {
                        "PoStProof":0,
                        "ProofBytes":"dmFsaWQgcHJvb2Y="
                    }
                ],
                "Parents":[
                    {
                        "/":"bafy2bzacedblysefipqbk2ry7lupw5pwbit57nlbeqb56zxwv34zanpmndbt2"
                    }
                ],
                "ParentWeight":"8281344",
                "Height":1443,
                "ParentStateRoot":{
                    "/":"bafy2bzaceb7afjjhi3nkqvt27sw4xyk4pla5vnzbl3gdwjm4me7b66kfetu52"
                },
                "ParentMessageReceipts":{
                    "/":"bafy2bzacedswlcz5ddgqnyo3sak3jmhmkxashisnlpq6ujgyhe4mlobzpnhs6"
                },
                "Messages":{
                    "/":"bafy2bzacecmda75ovposbdateg7eyhwij65zklgyijgcjwynlklmqazpwlhba"
                },
                "BLSAggregate":{
                    "Type":2,
                    "Data":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                },
                "Timestamp":1595833163,
                "BlockSig":{
                    "Type":2,
                    "Data":"rsuKT5MWz3L9voIkvU8CETV9+Op6i7+rGw05ig8jiVwsfX12oNRn0FTJTa2ZusvkC9/mEI+vmIu6Nfdle3lG6tRwrvXzPjZQP3DLUlUCia55dQ/whfHrdHPBnBa2gn6I"
                },
                "ForkSignaling":0
            }
        ],
        "Height":1443
    },
    "id":3
}
目前尚无回复
简单教程 = 简单教程,简单编程
简单教程 是一个关于技术和学习的地方
现在注册
已注册用户请 登入
关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

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

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