怎么无法查询到cell信息

curl -X POST http://127.0.0.1:3383 -d ‘{“method”:“get_live_cells_by_lock_hash”,“id”:“5d850df8-f40f-448b-a3cc-a343550f8a70”,“jsonrpc”:“2.0”,“params”:[“0x472ae207cffa8c069f9ec8d50c1d9c5680d558918ff7b96f1d5dc35186e87c8c”,“0x0”,“0x1”]}’ -H ‘Content-Type: application/json’

返回
{“jsonrpc”:“2.0”,“result”:[],“id”:“5d850df8-f40f-448b-a3cc-a343550f8a70”}

目前节点高度是最新的

这个是 Indexer 相关的 rpc,需要先通过 index_lock_hash rpc 给对应的 lock_hash 做索引(索引需要扫描整条链,需要花费一些时间)。

index_lock_hash 我使用了 index_lock_hash 这个rpc了以后,再次去查询还是返回空数组,是什么原因啊?

因为这个:

可以用 get_lock_hash_index_states 这个 rpc 来查询当前索引到哪个高度了。

高度 425891

需要每次调用的时候都执行一次吗,还是说执行一次就好了

请注意 index_lock_hash 的第二个参数:

index_from - Create an index from starting block number (exclusive), an optional parameter, null means starting from tip and 0 means starting from genesis

如果不指定默认是从 tip 开始索引,对于你这个例子就索引不到,建议从 0 (也就是 0x0) 开始索引。

index lock hash 需要每次在查询cell的时候都需要提前执行吗? 比如 A->B转了ckb。则B需要重新执行index lock hash吗

没有 index 过的 lock hash 都需要先 index 才能查。

{version=‘0’, hash=‘null’, cellDeps=[org.nervos.ckb.type.cell.CellDep@69ee81fc], headerDeps=[], inputs=[CellInput{previousOutput=OutPoint{txHash=‘0x6dacf7e9e318abc4efbf5a5882e3b2a6069298476d844fdfe22a3d095a2e9a17’, index=‘0x0’}, since=‘0x0’}], outputs=[CellOutput{capacity=‘0x16b969d00’, type=null, lock=Script{codeHash=‘0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8’, args=‘0x47acae22f3d48b6c8373dca646bcda9d19a10092’, hashType=‘type’}}, CellOutput{capacity=‘0xbebc02d’, type=null, lock=Script{codeHash=‘0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8’, args=‘0x32bbfd0b3555d7ad7cecdc0d8951e3bbd178ba9d’, hashType=‘type’}}], outputsData=[0x, 0x], witnesses=[0x5500000010000000550000005500000041000000895006bdac590574f73f599184b66a2924d95175a8909156e56cba4946873b084211d1d8dfcf094601c584c60eb01adc2e6731ca56795827e35f5cb792b7bea401]}

广播的时候
{“code”:-3,“message”:“Transaction: InsufficientCellCapacity”}
是什么原因? 金额应该是够的input有63 ckb我转出去61 个ckb

第二个 CellOutput capacity=0xbebc02d 是不合法的,capacity 最小需要 61.0 CKB (6100000000 Shannons)

我在调用index_lock_hash 这个命令了以后 一直卡在0x874F3。然后无法查询到capacity。是什么原因啊

0x874F3 是当时的 tip block number 吧?

我最新的区块高度比 0x874F3这个高

0x874F3=554227,节点高度是最新的 554,620

你本地 ckb 节点的最新高度是多少?

ckb-cli rpc get_tip_block_number

0x876a3

节点高度没有问题,不知道为什么get_lock_hash_index_states 用这个命令查询出来的地址高度 一直没有更新 卡在 0x874F3这里,是什么原因啊

是我连续调用index_lock_hash 这个命令影响的吗。因为我同时间生成了很多地址

ckb 0.27.0 (6a1e118 2020-01-10) 我使用 的这个版本是不是有问题。测试环境我用的ckb 0.26.1 (71fc55f 2019-12-30) 是正常的