CKB Pulse

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

Use indexer matched cell indexes to limit input parent fetchesPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 2026-11-19

With CCC client.findTransactionsPaged (scriptSearchMode 'prefix', groupByTransaction: true), each returned transaction has a cells list of {isInput, cellIndex} entries for the cells that matched the searched script. If your logic only needs the matched inputs, fetch parent transactions with getTransaction only for those indexes (plus siblings from a parent you already hold) and skip unrelated inputs such as wallet funding. OpenSwap's market scanner did this together with raising read concurrency to 16, and its first scan went from about 8 to 10 s to about 5.3 s; the gain from this change alone was not measured.

Porque importa: Without it, every input's parent transaction is fetched with getTransaction, including wallet funding cells the logic never uses, which multiplies RPC reads and slows the scan.

Padrão

Preferir
for(const c of t.cells)if(c.isInput)f.inputs.add(Number(c.cellIndex));

Tirado do commit, encurtado.

Um teste mudou no mesmo commit

Está ao lado da correcção. Nós não o corremos.

Conceitos
Indexer queries and cell collection, Network and RPC reliability
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-29
Última mudança
2026-10-29
Ú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 (1)

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, "Use indexer matched cell indexes to limit input parent fetches", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/use-indexer-matched-cell-indexes-to-limit-input-parent-fetch, CC BY 4.0, last changed 2026-10-29.

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.