Solana 当前 epoch 走到哪,怎样读 slotIndex 和 slotsInEpoch

getEpochInfo 返回 epoch、slotIndex 和该 epoch 的 slotsInEpoch。评估周期内走过的 slot,可使用 slotIndex 与 slotsInEpoch,不能把 absoluteSlot 直接除以周期长度。

getEpochInfo 返回 epoch、slotIndex 和该 epoch 的 slotsInEpoch。评估周期内走过的 slot,可使用 slotIndex 与 slotsInEpoch,不能把 absoluteSlot 直接除以周期长度。

Solana 当前 epoch 走到哪,怎样读 slotIndex 和 slotsInEpoch
依据官方资料整理:条件和示例见正文 查看来源

例如样本里 slotIndex 是 200,周期长度 400,可展示这个位置约为周期中点。它描述 slot 进度;若要展示真实时间,还需依据观测到的时间数据。

记录时加上 commitment、取得响应的网络和 UTC 时间。用不同端点对照时先确保同一网络和查询口径。

原始资料

https://solana.com/docs/rpc/http/getepochinfo

本文来自网络,不代表本站立场,转载请注明出处: https://liantuzhi.com/article/1687.html
返回顶部