CKB Pulse

Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário

Indexer free cell discovery by block scan plus get_live_cell on a local chainPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 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.

Porque importa: 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.

Padrão

Preferir
live=await rpc('get_live_cell',[outPoint,true]);if(live.status!=='live')continue;

Tirado do commit, encurtado.

Conceitos
Indexer queries and cell collection, Testing and devnet
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-05
Última mudança
2026-11-05
Última verificação
2026-11-19
Verificação contra o commit
certa: a lição sai do commit e continua a valer no código de hoje

Fontes (2)

Mais sobre CKB node, RPC and indexer

Ver as 45 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.