Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Search for a script's cells under both its data hash and its type id code hashPráticoVerificada pelo dono
Verificada pelo dono · Verificação: certa · Verificada em 2026-11-19
A script deployed with a type id can be referenced by cells either as hashType data1 with the code's data hash or as hashType type with the deployment's type id hash (per network). An exact indexer search via client.findCells over only one form misses the other; here @ckbfs/api's useTypeID cells read as missing until the reader queried both forms and treated a combined count above one as an error.
Porque importa: Cells whose type script points at the code by its type id hash (here what @ckbfs/api writes with useTypeID) never match an exact search built on the data hash, so the reader reports existing files as missing.
Padrão
for (const s of ckbfsV3Scripts(client)) { const script = ccc.Script.from({ codeHash: s.codeHash, hashType: s.hashType, args: typeId })Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- LusoCryptoLabs/ckbfs-reader:
test/reader.test.ts
- Conceitos
- Indexer queries and cell collection, Type ID and upgrades
- Evidência
- Verificada pelo dono: verificada pelo dono do projeto de onde veio, que também publica estas lições
- Vista pela primeira vez
- 2026-10-24
- Última mudança
- 2026-10-24
- Ú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)
- 2026-10-24 · LusoCryptoLabs/ckbfs-reader · mais deste projeto
Mais sobre CKB node, RPC and indexer
- Check chain-wide script users before consuming a deployed code cell
- Filtering get_cells for plain, typeless, empty funding cells
- get_live_cell may return "unknown" rather than "dead" for a spent output
Verificada por @LusoCryptoLabs (dono do projeto), 2026-11-19.
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Search for a script's cells under both its data hash and its type id code hash", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/search-for-a-script-s-cells-under-both-its-data-hash-and-its, CC BY 4.0, last changed 2026-10-24.