nervosnetwork / ckb-cli

CKB command line interface
MIT License
55 stars 35 forks source link

Indexer: Invalid params doesn't support search_key.filter.output_data parameter #594

Closed xrdavies closed 2 months ago

xrdavies commented 3 months ago

With the master branch, the example in readme reports error with API_URL https://testnet.ckb.dev

ckb-cli rpc get_transactions --json-path ./searchkey.json --order asc --limit 3
jsonrpc error: `Server error: Indexer: Invalid params doesn't support search_key.filter.output_data parameter`
EthanYuan commented 3 months ago

The "https://testnet.ckb.dev" node is currently enabled with the original Indexer ( not rich-indexer), and does not currently support the search_key.filter.output_data parameter of rpc get_transactions.

You can just modify searchkey.json to remove the output_data from the filter:

{
    "script": {
        "code_hash": "0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494",
        "hash_type": "data1",
        "args": "0x"
    },
    "script_type": "type",
    "script_search_mode": "prefix",
    "with_data": false
}

For CKB nodes with Rich-Indexer enabled, there will be corresponding support as follows:

INDEXER RPC Indexer Rich-Indexer
get_cells script args partial mode search ✔️
get_cells cell data filter(prefix\|exact\|partial) ✔️ ✔️
get_transactions script args partial mode search ✔️
get_transactions cell data filter(prefix\|exact\|partial) ✔️
get_cells_capacity script args partial mode search ✔️
get_cells_capacity cell data filter(prefix\|exact\|partial) ✔️ ✔️
doitian commented 2 months ago

Closed by #595