我想创建一个应用程序,以获得有关每个块的历史股份和奖励变化的详细信息。我可以跟踪包含 delegator / validator 的任何股份余额变化的每个委托事件吗?包括像这样的信息:
委派者地址
验证器地址
获得委托、未委托或获得奖励的令牌数量
我发现this contract。然后我尝试解码事务的操作和收据。我仍然找不到有关金额的信息。
例如this transaction包含unstake_all
方法。我尝试使用近 REST API 或 Postgres DB 像
postgres://public_readonly:nearprotocol@mainnet.db.explorer.indexer.near.dev/mainnet_explorer
但是,它不包括有关金额的信息,但资源管理器:
@ojosdepez.near unstaking 211362599667478202066742666. Spent 186315320307823908119982990 staking shares. Total 211362599667478202066742667 unstaked balance and 0 staking shares
Contract total staked balance is 18374491513732210121091349309226. Total number of shares 16197043740284605773282183202762
所以我可以以某种方式使用 REST API 或 Postgres 获得这些日志,这些日志是可靠的来源吗?

首先
但是,它不包括有关金额的信息,但资源管理器:
@ojosdepez.near unstaking 211362599667478202066742666. Spent 186315320307823908119982990 staking shares. Total 211362599667478202066742667 unstaked balance and 0 staking shares
Contract total staked balance is 18374491513732210121091349309226. Total number of shares 16197043740284605773282183202762
资源管理器查询 RPC 并显示来自ExecutionOutcome
的日志。
在 Indexer for Explorer 的 PostgreSQL 数据库中,我们不存储日志,所以你在那里找不到它们。
要获得有关每个区块的历史股份和奖励变化的详细信息,我认为您应该自己索引区块链,以确保一切都按照您的预期计算。
为了做到这一点,你需要建立一个索引器。令人高兴的是,我们正在发布一个 MVP(但完全工作的解决方案)NEAR Lake Framework
这是一个微框架来构建索引器,但比现在更容易。
Please,have a look at the example projecthttps://github.com/near/near-lake-raw-printerwhich basically prints the data from each block.refer to this comment as an example of the structure that you can receive for each block (StreamerMessage
)https://github.com/near/near-lake/issues/1#issuecomment-1035285658
因此,主要思想是从奖励可用的块开始索引(第 2 阶段),并分析与放样 / 取消放样相关的每个块,交易和收据,以便您可以执行计算并记录有关历史股份和奖励变化的信息。
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(48条)