全部经验 · CKB node, RPC and indexer · 从这里开始 · 术语表
Indexer free cell discovery by block scan plus get_live_cell on a local chain实践来自一次修复
来自一次修复 · 核对结果:正确 · 核对于 2026-11-19
Without an indexer on a small local chain, cells for a lock can be found by walking get_block_by_number from 0 to the tip, matching output locks, and confirming each hit with get_live_cell (with_data true). The commit also checks get_block_hash per height and at the end, then rechecks each match, so the result is treated as a snapshot that a reorg or spend can invalidate.
为什么重要: Without the get_live_cell check, outputs that were already spent are returned as funding cells. The test shows this: after the genesis transaction, the owner's original cell at index 3 must drop out and only the new change cell at index 1 remain, otherwise a later transaction would try to spend a dead input.
代码模式
live=await rpc('get_live_cell',[outPoint,true]);if(live.status!=='live')continue;摘自提交,已缩短。
- 概念
- Indexer queries and cell collection, Testing and devnet
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-11-05
- 最近改动
- 2026-11-05
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(2)
- 2026-11-05 · Ticoworld/QuotaCell · 这个项目的更多经验
- 2026-11-05 · Ticoworld/QuotaCell · 这个项目的更多经验
更多关于CKB node, RPC and indexer
- Conflict an orphaned transaction's input on the winning branch when testing a reorg rollback
- Indexer RPC module must be listed in ckb.toml rpc modules for get_cells on devnet
- Never pass the terminal "0x" cursor back to indexer get_cells
引用这条经验
LusoCryptoLabs, "Indexer free cell discovery by block scan plus get_live_cell on a local chain", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/indexer-free-cell-discovery-by-block-scan-plus-get-live-cell, CC BY 4.0, last changed 2026-11-05.