调用某些块祖先
1 个回答
- 投票数
-
- 2019-12-26
您可以调用检查点rpc:
http://mainnet.tezos.cryptium.ch:8732/chains/main/checkpoint
返回
{"block": {"level":729089, "proto":5, "predecessor":"BMF3ELahUsKsvSfct9qVFWX3Pf6aV2sLpKRgWkwTePpmo3tNjEG", "timestamp":"2019-12-09T21:56:50Z", "validation_pass":4, "operations_hash":"LLob8aa16cFyHG1rCrMQ2NrLDtCDegMNQLXmRWCHFD86KmYefbwbi", "fitness":["01","0000000000012001"], "context":"CoWPc7UaEHYdXJ3PEpp6CyKB11K9XgX4n87cJpAMuFzbyAerrHSD", "protocol_data": "0000756e6b6f8a3562bc00f131365318490b14b69329500a1f6e2000f0f767edf777ec9c6f33c6ff149eee289f642b2bdcbfdd8d54013da72eeedea56c1b828ba11c8adbd67f63f5e93578"}, "save_point":729089, "caboose":0, "history_mode":"full" }
history_mode为"已满",并且已满节点从当前检查点之前从块中修剪数据(块的标头和操作除外).
在完全模式下仅查询块的标头可以在任何级别上使用,例如:
curl -v http://mainnet.tezos.cryptium.ch:8732/chains/main/blocks/BKrq16vch5v3iEE1hHSMENLh54vBikkmqYLDv4j7hANx6ZE3Rmb~72755/header
正常工作.不幸的是,块在完全模式下的操作的RPC端点当前已损坏-请参阅问题"全节点无法从最近检查点之前的块中查询操作数据" :mainnet.smartpy.io(这是一个存档节点)当前未显示.
编辑:rpc现在也在mainnet.smartpy.io上打开(并显示"存档").
{ "block": { "level": 729089, "proto": 5, "predecessor": "BMF3ELahUsKsvSfct9qVFWX3Pf6aV2sLpKRgWkwTePpmo3tNjEG", "timestamp": "2019-12-09T21:56:50Z", "validation_pass": 4, "operations_hash": "LLob8aa16cFyHG1rCrMQ2NrLDtCDegMNQLXmRWCHFD86KmYefbwbi", "fitness": [ "01", "0000000000012001" ], "context": "CoWPc7UaEHYdXJ3PEpp6CyKB11K9XgX4n87cJpAMuFzbyAerrHSD", "protocol_data": "0000756e6b6f8a3562bc00f131365318490b14b69329500a1f6e2000f0f767edf777ec9c6f33c6ff149eee289f642b2bdcbfdd8d54013da72eeedea56c1b828ba11c8adbd67f63f5e93578" }, "save_point": 0, "caboose": 0, "history_mode": "archive" }```
You can call the checkpoint rpc:
http://mainnet.tezos.cryptium.ch:8732/chains/main/checkpoint
which returns
{"block": {"level":729089, "proto":5, "predecessor":"BMF3ELahUsKsvSfct9qVFWX3Pf6aV2sLpKRgWkwTePpmo3tNjEG", "timestamp":"2019-12-09T21:56:50Z", "validation_pass":4, "operations_hash":"LLob8aa16cFyHG1rCrMQ2NrLDtCDegMNQLXmRWCHFD86KmYefbwbi", "fitness":["01","0000000000012001"], "context":"CoWPc7UaEHYdXJ3PEpp6CyKB11K9XgX4n87cJpAMuFzbyAerrHSD", "protocol_data": "0000756e6b6f8a3562bc00f131365318490b14b69329500a1f6e2000f0f767edf777ec9c6f33c6ff149eee289f642b2bdcbfdd8d54013da72eeedea56c1b828ba11c8adbd67f63f5e93578"}, "save_point":729089, "caboose":0, "history_mode":"full" }
history_mode for this node is "full" and full nodes prune data other than block's headers and operations from blocks before the current checkpoint.
Querying only the block's header in full mode works at any level, e.g.:
curl -v http://mainnet.tezos.cryptium.ch:8732/chains/main/blocks/BKrq16vch5v3iEE1hHSMENLh54vBikkmqYLDv4j7hANx6ZE3Rmb~72755/header
works. Unfortunately, the RPC endpoint for block's operations in full mode is currently broken - see issue "Full node unable to query operation data from blocks prior to most recent checkpoint":This is currently not shown for mainnet.smartpy.io (which is an archive node).
Edit: the rpc is now opened as well on mainnet.smartpy.io (and shows "archive").
{ "block": { "level": 729089, "proto": 5, "predecessor": "BMF3ELahUsKsvSfct9qVFWX3Pf6aV2sLpKRgWkwTePpmo3tNjEG", "timestamp": "2019-12-09T21:56:50Z", "validation_pass": 4, "operations_hash": "LLob8aa16cFyHG1rCrMQ2NrLDtCDegMNQLXmRWCHFD86KmYefbwbi", "fitness": [ "01", "0000000000012001" ], "context": "CoWPc7UaEHYdXJ3PEpp6CyKB11K9XgX4n87cJpAMuFzbyAerrHSD", "protocol_data": "0000756e6b6f8a3562bc00f131365318490b14b69329500a1f6e2000f0f767edf777ec9c6f33c6ff149eee289f642b2bdcbfdd8d54013da72eeedea56c1b828ba11c8adbd67f63f5e93578" }, "save_point": 0, "caboose": 0, "history_mode": "archive" }```
-
SmartPy节点检查点:https://mainnet.smartpy.io/chains/main/checkpointSmartPy node checkpoint : https://mainnet.smartpy.io/chains/main/checkpoint
- 2
- 2019-12-26
- RoMarQ
-
@RoMarQ,我编辑了答案,将检查点rpc的输出包含在mainnet.smartpy.io上.@RoMarQ, I edited my answer to include the output of the checkpoint rpc on mainnet.smartpy.io.
- 2
- 2019-12-26
- FFF
-
谢谢!根据https://blog.nomadic-labs.com/introducing-snapshots-and-history-modes-for-the-tezos-node.html的说明,全套操作都保存在完整节点中.这是否意味着偏移被视为上下文的一部分?编辑:有关更多详细信息,请参见https://tezos.stackexchange.com/questions/1422/tezos-rpc-doesnt-respond-with-blocks-below-the-current-checkpointThanks! According to https://blog.nomadic-labs.com/introducing-snapshots-and-history-modes-for-the-tezos-node.html the full set of operations are saved in full node. Does it mean offset is considered part of context ? EDIT: see https://tezos.stackexchange.com/questions/1422/tezos-rpc-doesnt-respond-with-blocks-below-the-current-checkpoint for more details
- 0
- 2019-12-26
- Ezy
我在某些rpc通话中观察到不同的行为
不提供任何数据(错误404)
但是我什么时候
我获得了有关块
BLeam7Xqdw7w7ydU7g38gs82XJE6wNZMfm61cArUPaSFBzJ6q5r
的信息.为什么会这样?请注意,如果我请求更新的偏移量(如
~1
),都将返回块BLN3bh4ZCpBtade3VGbGbFWz2Nhvah3SqGKYZkdL6tbQ7FMD6f6
编辑:有关此RPC调用的完整节点和存档节点有何不同的性质的一个相关问题可用此处