{"id":18674083,"url":"https://github.com/nervosnetwork/ckb-indexer","last_synced_at":"2025-09-11T21:21:41.534Z","repository":{"id":37984244,"uuid":"254012689","full_name":"nervosnetwork/ckb-indexer","owner":"nervosnetwork","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-07T02:08:09.000Z","size":260,"stargazers_count":29,"open_issues_count":3,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T01:55:26.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nervosnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-08T07:12:11.000Z","updated_at":"2024-04-17T14:48:31.000Z","dependencies_parsed_at":"2024-06-20T11:54:41.024Z","dependency_job_id":"ca3e6a68-22e2-41e8-b41b-626d9af3602c","html_url":"https://github.com/nervosnetwork/ckb-indexer","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/nervosnetwork/ckb-indexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fckb-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fckb-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fckb-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fckb-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervosnetwork","download_url":"https://codeload.github.com/nervosnetwork/ckb-indexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fckb-indexer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274707093,"owners_count":25334868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T09:17:27.935Z","updated_at":"2025-09-11T21:21:41.487Z","avatar_url":"https://github.com/nervosnetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduce\n\nckb-indexer is a standalone service to index the live cells and transactions in the ckb blockchain. It provides a RPC service to query the indexed data. This service has been merged into the ckb node since v0.106.0, we recommend you to use the ckb node instead of this standalone service if you are running ckb v0.106.0 or later, which is more efficient and easier to setup, it can be enabled by `--indexer` command line option when starting the ckb node or by setting `Indexer` module in the ckb.toml config file's `rpc` section.\n\n## Usage\n\nBuild binary from source\n\n```bash\ncargo build --release\n```\n\nConnect to default ckb rpc service at `http://127.0.0.1:8114` and stores the indexer data at `/tmp/ckb-indexer-test` folder\n```bash\nRUST_LOG=info ./target/release/ckb-indexer -s /tmp/ckb-indexer-test\n```\n\nOr connect to ckb rpc service at `tcp://127.0.0.1:18114`\n```bash\nRUST_LOG=info ./target/release/ckb-indexer -s /tmp/ckb-indexer-test -c tcp://127.0.0.1:18114\n```\n\nIndexing the pending txs in the ckb tx-pool\n```bash\nRUST_LOG=info ./target/release/ckb-indexer -s /tmp/ckb-indexer-test -c tcp://127.0.0.1:18114 --index-tx-pool\n```\n\nIndexer will index all txs and store all data in local folder by default, if you want to customize the index rules, you may use the `--block-filter` and `--cell-filter` option. The rule is written in [rhai](https://rhai.rs/book/) syntax and indexer expose the following variables to the rule: block, output and output_data.\n\nOnly index the txs which block height is greater than 1000000\n```bash\nRUST_LOG=info ./target/release/ckb-indexer -s /tmp/ckb-indexer-test --block-filter 'block.header.number.to_uint() \u003e \"1000000\".to_uint()'\n```\n\nOnly index the txs which output script is a specific type\n```bash\nRUST_LOG=info ./target/release/ckb-indexer -s /tmp/ckb-indexer-test --cell-filter 'let script = output.lock; script.code_hash == \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\" \u0026\u0026 script.hash_type == \"type\" \u0026\u0026 script.args == \"0xa897829e60ee4e3fb0e4abe65549ec4a5ddafad7\"'\n```\n\nRun `ckb-indexer --help` for more information\n\n## RPC\n\n### `get_tip`\n\nReturns the indexed tip block\n\n#### Parameters\n    null\n\n#### Returns\n\n    block_hash - indexed tip block hash\n    block_number - indexed tip block number\n\n#### Examples\n\nget indexed tip block hash and number\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_tip\"\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"block_hash\": \"0x4959d6e764a2edc6038dbf03d61ebcc99371115627b186fdcccb2161fbd26edc\",\n    \"block_number\": \"0x5b513e\"\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### `get_cells`\n\nReturns the live cells collection by the lock or type script.\n\n#### Parameters\n\n    search_key:\n        script - Script, supports prefix search\n        script_type - enum, lock | type\n        script_search_mode - enum, prefix | exact, optional default is `prefix`, controls the search mode of script\n        filter - filter cells by following conditions, all conditions are optional\n            script: if search script type is lock, filter cells by type script prefix, and vice versa\n            script_len_range: [u64; 2], filter cells by script len range, [inclusive, exclusive]\n            output_data_len_range: [u64; 2], filter cells by output data len range, [inclusive, exclusive]\n            output_capacity_range: [u64; 2], filter cells by output capacity range, [inclusive, exclusive]\n            block_range: [u64; 2], filter cells by block number range, [inclusive, exclusive]\n        with_data - bool, optional default is `true`, if with_data is set to false, the field of returning cell.output_data is null in the result\n    order: enum, asc | desc\n    limit: result size limit\n    after_cursor: pagination parameter, optional\n\n#### Returns\n\n    objects:\n        cells - live cells collection\n            output: the fields of an output cell\n            output_data: the cell data\n            out_point: reference to a cell via transaction hash and output index\n            block_number: the number of the transaction committed in the block\n            tx_index: the position index of the transaction committed in the block\n    last_cursor: pagination parameter\n\n#### Examples\n\nget cells by lock script\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_cells\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\"\n            },\n            \"script_type\": \"lock\"\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x409bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8015989ae415bb667931a99896e5fbbfad9ba53a22300000000005b0f8c0000000100000000\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x5b0e6d\",\n        \"out_point\": {\n          \"index\": \"0x0\",\n          \"tx_hash\": \"0xe8f2180dfba0cb15b45f771d520834515a5f8d7aa07f88894da88c22629b79e9\"\n        },\n        \"output\": {\n          \"capacity\": \"0x189640200\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0e90\",\n        \"out_point\": {\n          \"index\": \"0x0\",\n          \"tx_hash\": \"0xece3a27409bde2914fb7a1555d6bfca453ee46af73e665149ef549fd46ec1fc6\"\n        },\n        \"output\": {\n          \"capacity\": \"0x189640200\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0ead\",\n        \"out_point\": {\n          \"index\": \"0x1\",\n          \"tx_hash\": \"0x5c48768f91e3795b418c53211c76fd038c464a24c4aa7e35bbbb6ac5b219f581\"\n        },\n        \"output\": {\n          \"capacity\": \"0xe36dceec20\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0eeb\",\n        \"out_point\": {\n          \"index\": \"0x0\",\n          \"tx_hash\": \"0x90e6981d6a5692d92e54344dc0e12d213447710fa069cc19ddea874619b9ba48\"\n        },\n        \"output\": {\n          \"capacity\": \"0x174876e800\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0f8c\",\n        \"out_point\": {\n          \"index\": \"0x0\",\n          \"tx_hash\": \"0x9ea14510219ae97afa0275215fa77c3c015905281c953a3917a7fd036767429c\"\n        },\n        \"output\": {\n          \"capacity\": \"0x189640200\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nget cells by lock script and filter by type script\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_cells\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x2a49720e721553d0614dff29454ee4e1f07d0707\"\n            },\n            \"script_type\": \"lock\",\n            \"filter\": {\n                \"script\": {\n                    \"code_hash\": \"0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4\",\n                    \"hash_type\": \"type\",\n                    \"args\": \"0x8462b20277bcbaa30d821790b852fb322d55c2b12e750ea91ad7059bc98dda4b\"\n                }\n            }\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x4058c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63012a49720e721553d0614dff29454ee4e1f07d070700000000002adf870000000100000001\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x2adf87\",\n        \"out_point\": {\n          \"index\": \"0x1\",\n          \"tx_hash\": \"0x04ecbc2df39e3682326a3b23c1bd2465e07eae2379ac0cc713834a1f79753779\"\n        },\n        \"output\": {\n          \"capacity\": \"0x436d81500\",\n          \"lock\": {\n            \"args\": \"0x2a49720e721553d0614dff29454ee4e1f07d0707\",\n            \"code_hash\": \"0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": {\n            \"args\": \"0x8462b20277bcbaa30d821790b852fb322d55c2b12e750ea91ad7059bc98dda4b\",\n            \"code_hash\": \"0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4\",\n            \"hash_type\": \"type\"\n          }\n        },\n        \"output_data\": \"0x0040d20853d746000000000000000000\",\n        \"tx_index\": \"0x1\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nget cells by lock script and filter empty type script by setting script_len_range to [0, 1), script_len is caculated by (code_hash + hash_type + args).len\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_cells\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x2a49720e721553d0614dff29454ee4e1f07d0707\"\n            },\n            \"script_type\": \"lock\",\n            \"filter\": {\n                \"script_len_range\": [\"0x0\", \"0x1\"]\n            }\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x4058c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63012a49720e721553d0614dff29454ee4e1f07d070700000000002adf830000000200000001\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x2adf83\",\n        \"out_point\": {\n          \"index\": \"0x1\",\n          \"tx_hash\": \"0x23ec897027c1d2a2b39e2446162bac182f18581be048cb3896ad695559b6839e\"\n        },\n        \"output\": {\n          \"capacity\": \"0x54b42b70b4\",\n          \"lock\": {\n            \"args\": \"0x2a49720e721553d0614dff29454ee4e1f07d0707\",\n            \"code_hash\": \"0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x2\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nget cells by lock script and filter capacity range\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_cells\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\"\n            },\n            \"script_type\": \"lock\",\n            \"filter\": {\n                \"output_capacity_range\": [\"0x0\", \"0x174876e801\"]\n            }\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x409bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8015989ae415bb667931a99896e5fbbfad9ba53a22300000000005b59df0000000100000001\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x5b59df\",\n        \"out_point\": {\n          \"index\": \"0x1\",\n          \"tx_hash\": \"0x21c4632a41140b828e9347ff80480b3e07be4e0a0b8d577565e7421fd5473194\"\n        },\n        \"output\": {\n          \"capacity\": \"0xe815b81c0\",\n          \"lock\": {\n            \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\",\n            \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n            \"hash_type\": \"type\"\n          },\n          \"type\": null\n        },\n        \"output_data\": \"0x\",\n        \"tx_index\": \"0x1\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### `get_transactions`\n\nReturns the transactions collection by the lock or type script.\n\n#### Parameters\n\n    search_key:\n        script - Script, supports prefix search when group_by_transaction is false\n        script_type - enum, lock | type\n        script_search_mode - enum, prefix | exact, optional default is `prefix`, controls the search mode of script\n        filter - filter cells by following conditions, all conditions are optional\n            script: if search script type is lock, filter cells by type script, and vice versa\n            block_range: [u64; 2], filter cells by block number range, [inclusive, exclusive]\n        group_by_transaction - bool, optional default is `false`, if group_by_transaction is set to true, the returning objects will be grouped by the tx hash\n    order: enum, asc | desc\n    limit: result size limit\n    after_cursor: pagination parameter, optional\n\n#### Returns\n\n    objects - enum, ungrouped TxWithCell | grouped TxWithCells\n        TxWithCell:\n            tx_hash: transaction hash,\n            block_number: the number of the transaction committed in the block\n            tx_index: the position index of the transaction committed in the block\n            io_type: enum, input | output\n            io_index: the position index of the cell in the transaction inputs or outputs\n\n        TxWithCells:\n            tx_hash: transaction hash,\n            block_number: the number of the transaction committed in the block\n            tx_index: the position index of the transaction committed in the block\n            cells: Array [[io_type, io_index]]\n\n    last_cursor - pagination parameter\n\n#### Examples\n\nget transactions by lock script\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_transactions\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\"\n            },\n            \"script_type\": \"lock\"\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x809bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8015989ae415bb667931a99896e5fbbfad9ba53a22300000000005b59df000000010000000101\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x5b033a\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x556060b62d16386da53f8a4b458314dfa2d1988a7bcc5c96c3bb2a350a3453a1\",\n        \"tx_index\": \"0x4\"\n      },\n      {\n        \"block_number\": \"0x5b0671\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x8205b2b4cd6380d7e332c7a5b49bf776a0322ba19f46dc6ca1f8c59f7daee08d\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0671\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x8205b2b4cd6380d7e332c7a5b49bf776a0322ba19f46dc6ca1f8c59f7daee08d\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0e6d\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0xe8f2180dfba0cb15b45f771d520834515a5f8d7aa07f88894da88c22629b79e9\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0e90\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0xece3a27409bde2914fb7a1555d6bfca453ee46af73e665149ef549fd46ec1fc6\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0ead\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x5c48768f91e3795b418c53211c76fd038c464a24c4aa7e35bbbb6ac5b219f581\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0ead\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x5c48768f91e3795b418c53211c76fd038c464a24c4aa7e35bbbb6ac5b219f581\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0eeb\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x90e6981d6a5692d92e54344dc0e12d213447710fa069cc19ddea874619b9ba48\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0f8c\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x9ea14510219ae97afa0275215fa77c3c015905281c953a3917a7fd036767429c\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b5638\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x9346da4caa846cc035c182ecad0c17326a587983d25fb1e12a388f1a9c5c56b4\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b5638\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x9346da4caa846cc035c182ecad0c17326a587983d25fb1e12a388f1a9c5c56b4\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b5638\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x9346da4caa846cc035c182ecad0c17326a587983d25fb1e12a388f1a9c5c56b4\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b5638\",\n        \"io_index\": \"0x2\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x9346da4caa846cc035c182ecad0c17326a587983d25fb1e12a388f1a9c5c56b4\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59c2\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x5b58f90fb3309333bf0bec878f3a05038c7fe816747300ecdac37a9da76c4128\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59c2\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x5b58f90fb3309333bf0bec878f3a05038c7fe816747300ecdac37a9da76c4128\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59cc\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x57ca2822c28e02b199424a731b2efd2c9bf752f07b7309f555f2e71abe83ba26\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59cc\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x57ca2822c28e02b199424a731b2efd2c9bf752f07b7309f555f2e71abe83ba26\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59cc\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x57ca2822c28e02b199424a731b2efd2c9bf752f07b7309f555f2e71abe83ba26\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59df\",\n        \"io_index\": \"0x0\",\n        \"io_type\": \"input\",\n        \"tx_hash\": \"0x21c4632a41140b828e9347ff80480b3e07be4e0a0b8d577565e7421fd5473194\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59df\",\n        \"io_index\": \"0x1\",\n        \"io_type\": \"output\",\n        \"tx_hash\": \"0x21c4632a41140b828e9347ff80480b3e07be4e0a0b8d577565e7421fd5473194\",\n        \"tx_index\": \"0x1\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\nget transactions by lock script and group by tx hash\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_transactions\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\"\n            },\n            \"script_type\": \"lock\",\n            \"group_by_transaction\": true\n        },\n        \"asc\",\n        \"0x64\"\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"last_cursor\": \"0x809bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8015989ae415bb667931a99896e5fbbfad9ba53a22300000000005b59df000000010000000101\",\n    \"objects\": [\n      {\n        \"block_number\": \"0x5b033a\",\n        \"cells\": [\n          [\n            \"output\",\n            \"0x0\"\n          ]\n        ],\n        \"tx_hash\": \"0x556060b62d16386da53f8a4b458314dfa2d1988a7bcc5c96c3bb2a350a3453a1\",\n        \"tx_index\": \"0x4\"\n      },\n      {\n        \"block_number\": \"0x5b0671\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ]\n        ],\n        \"tx_hash\": \"0x8205b2b4cd6380d7e332c7a5b49bf776a0322ba19f46dc6ca1f8c59f7daee08d\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0e6d\",\n        \"cells\": [\n          [\n            \"output\",\n            \"0x0\"\n          ]\n        ],\n        \"tx_hash\": \"0xe8f2180dfba0cb15b45f771d520834515a5f8d7aa07f88894da88c22629b79e9\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0e90\",\n        \"cells\": [\n          [\n            \"output\",\n            \"0x0\"\n          ]\n        ],\n        \"tx_hash\": \"0xece3a27409bde2914fb7a1555d6bfca453ee46af73e665149ef549fd46ec1fc6\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0ead\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ]\n        ],\n        \"tx_hash\": \"0x5c48768f91e3795b418c53211c76fd038c464a24c4aa7e35bbbb6ac5b219f581\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0eeb\",\n        \"cells\": [\n          [\n            \"output\",\n            \"0x0\"\n          ]\n        ],\n        \"tx_hash\": \"0x90e6981d6a5692d92e54344dc0e12d213447710fa069cc19ddea874619b9ba48\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b0f8c\",\n        \"cells\": [\n          [\n            \"output\",\n            \"0x0\"\n          ]\n        ],\n        \"tx_hash\": \"0x9ea14510219ae97afa0275215fa77c3c015905281c953a3917a7fd036767429c\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b5638\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"input\",\n            \"0x1\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ],\n          [\n            \"input\",\n            \"0x2\"\n          ]\n        ],\n        \"tx_hash\": \"0x9346da4caa846cc035c182ecad0c17326a587983d25fb1e12a388f1a9c5c56b4\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59c2\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ]\n        ],\n        \"tx_hash\": \"0x5b58f90fb3309333bf0bec878f3a05038c7fe816747300ecdac37a9da76c4128\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59cc\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"input\",\n            \"0x1\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ]\n        ],\n        \"tx_hash\": \"0x57ca2822c28e02b199424a731b2efd2c9bf752f07b7309f555f2e71abe83ba26\",\n        \"tx_index\": \"0x1\"\n      },\n      {\n        \"block_number\": \"0x5b59df\",\n        \"cells\": [\n          [\n            \"input\",\n            \"0x0\"\n          ],\n          [\n            \"output\",\n            \"0x1\"\n          ]\n        ],\n        \"tx_hash\": \"0x21c4632a41140b828e9347ff80480b3e07be4e0a0b8d577565e7421fd5473194\",\n        \"tx_index\": \"0x1\"\n      }\n    ]\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### `get_cells_capacity`\n\nReturns the live cells capacity by the lock or type script.\n\n#### Parameters\n\n    search_key:\n        script - Script\n        script_type - enum, lock | type\n        script_search_mode - enum, prefix | exact, optional default is `prefix`, controls the search mode of script\n        filter - filter cells by following conditions, all conditions are optional\n            script: if search script type is lock, filter cells by type script prefix, and vice versa\n            output_data_len_range: [u64; 2], filter cells by output data len range, [inclusive, exclusive]\n            output_capacity_range: [u64; 2], filter cells by output capacity range, [inclusive, exclusive]\n            block_range: [u64; 2], filter cells by block number range, [inclusive, exclusive]\n\n#### Returns\n\n    capacity - total capacity\n    block_hash - indexed tip block hash\n    block_number - indexed tip block number\n\n#### Examples\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_cells_capacity\",\n    \"params\": [\n        {\n            \"script\": {\n                \"code_hash\": \"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8\",\n                \"hash_type\": \"type\",\n                \"args\": \"0x5989ae415bb667931a99896e5fbbfad9ba53a223\"\n            },\n            \"script_type\": \"lock\"\n        }\n    ]\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"block_hash\": \"0xbc52444952dc5eb01a7826aaf6bb1b660db01797414e259e7a6e6d636de8fc7c\",\n    \"block_number\": \"0x5b727a\",\n    \"capacity\": \"0xf0e8e4b4a0\"\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### `get_indexer_info`\n\nReturns the indexer service information.\n\n#### Returns\n\n    version - indexer version\n\n#### Examples\n\n```bash\necho '{\n    \"id\": 2,\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"get_indexer_info\",\n    \"params\": []\n}' \\\n| curl -H 'content-type: application/json' -d @- \\\nhttp://localhost:8116\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eclick to expand result\u003c/summary\u003e\n\u003cp\u003e\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"result\": {\n    \"version\": \"0.4.2\"\n  },\n  \"id\": 2\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Fckb-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervosnetwork%2Fckb-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Fckb-indexer/lists"}