# GetBlock Bitcoin 历史查询失败：检查 txindex 与端点认证

整理：链小知（AI 辅助）
资料核对日期：2026-10-12
引用地址：https://lianxiaozhi.com/tools/guides/getblock-check-bitcoin-node-index
难度：进阶
核验方式：官方文档整理，未执行真实账户操作

读取已有 getindexinfo 记录，把索引未同步、错误网络和 token 失败分开；不拿索引状态代替单笔交易确认。

## 使用工具
- [GetBlock](https://lianxiaozhi.com/tools/getblock) · [官方入口](https://getblock.io/)

## 前置条件
- 准备 Bitcoin 网络、当前账户 endpoint 标识、历史查询的原始错误及采样时间；所有 token 已脱敏。
- 准备相近时间同端点的 getindexinfo 响应；没有则将索引状态记为未取得，不自动创建额外调用。

## 1. 确认 BTC 网络与当前 token 位置

在配置或已有控制台截图核对 endpoint 所选的是 Bitcoin Mainnet/Testnet，不是 Bitcoin SV、Gold 或 Cash。当前认证文档使用 shared.<region>.getblock.io/<ACCESS_TOKEN>/，要求路径 token，明确不能送在 header；旧方法页示例仍用 go.getblock.io，应以账户实际 endpoint 为准。

核对结果：链、网络、区域和端点标识都有记录，未混用其他 Bitcoin 分支或 header token。
依据：[GetBlock：当前 access token 认证位置](https://docs.getblock.io/getting-started/authentication-with-access-tokens)
依据：[GetBlock：Bitcoin getindexinfo 与错误](https://docs.getblock.io/api-reference/bitcoin-btc/btc_getindexinfo)

## 2. 检查 getindexinfo 输入

getindexinfo 可不带过滤器，即 params:[]；只查交易索引用 params:["txindex"]。对照已有请求，确认 method 名与参数位置。HTTP 403/Forbidden 或 token 无效先归为认证问题；未知索引名的 -8 与业务查询未找到不是同一个错误。

核对结果：现有请求是正确方法及索引名，认证和 JSON-RPC 错误分别记录。
依据：[GetBlock：Bitcoin getindexinfo 与错误](https://docs.getblock.io/api-reference/bitcoin-btc/btc_getindexinfo)

## 3. 读取索引同步字段

在成功响应 result 中查看 txindex 对象、synced 和 best_block_height。synced=false 表示该记录中的索引还未同步完；没有返回 txindex 时，只写该响应未列出交易索引，再核对配置和过滤器，不能补写为 synced=true。示例高度不是当前节点高度。

核对结果：保存索引是否返回、synced 原值、best_block_height 和时间，不替缺失字段造数。
依据：[GetBlock：Bitcoin getindexinfo 与错误](https://docs.getblock.io/api-reference/bitcoin-btc/btc_getindexinfo)

## 4. 限定索引证据能说明的范围

将上述记录与原历史查询失败时间、网络和端点对齐。索引未同步是继续查节点能力的线索；索引同步也不能单独证明某个 txid 一定存在、某笔交易有确认或收款已到账。需要单笔证明时保留 txid 与实际交易记录待查，不从 Bitcoin SV/Gold 方法页复制 BTC 参数来补缺失正文。

核对结果：结论停在索引能力与错误类别，单笔交易与到账状态保持独立待查。
依据：[GetBlock：Bitcoin getindexinfo 与错误](https://docs.getblock.io/api-reference/bitcoin-btc/btc_getindexinfo)

## 5. 复核 CU、RPS 与 Archive 模式

按当前账户看 Shared 的 CU 余额、RPS 和端点数量。CU 由链、方法和 Archive modifier 计算，Archive-enabled endpoint 的 modifier 作用于发往它的所有请求；不能仅凭方法名估费用。免费日额度与付费月额度周期不同，Limitless 仍受 RPS 档位约束。

核对结果：报告含网络、错误、索引状态和账户模式；缺失的交易证据与费用权重明确列待查。
依据：[GetBlock：CU、RPS、端点数及余额周期](https://docs.getblock.io/getting-started/plans-and-limits/cu-and-rate-limits)
依据：[GetBlock：方法权重与 Archive modifier](https://docs.getblock.io/getting-started/plans-and-limits/what-counts-as-a-cu.md)

## 常见错误
- synced=true 只对应查询时该节点索引状态，不是某笔交易确认数。
- BTC getrawtransaction 文档路径返回未找到时，应保留缺口，不能拿 BSV 的示例作替代。
- 每日 CU 与每月 CU 不能直接用相同除数估预算。

## 完成检查
- 输出可追踪的 BTC 网络、端点、认证状态、txindex 同步结果与单笔交易待查项。
- 本教程为官方文档核验，未调用账户端点或验证任一 txid。

## 相关知识
- [区块确认与最终性是什么？交易成功和充值到账为何不同步](https://lianxiaozhi.com/learn/confirmations-and-finality)

## 官方依据
- [GetBlock：Bitcoin getindexinfo 与错误](https://docs.getblock.io/api-reference/bitcoin-btc/btc_getindexinfo)
- [GetBlock：当前 access token 认证位置](https://docs.getblock.io/getting-started/authentication-with-access-tokens)
- [GetBlock：CU、RPS、端点数及余额周期](https://docs.getblock.io/getting-started/plans-and-limits/cu-and-rate-limits)
- [GetBlock：方法权重与 Archive modifier](https://docs.getblock.io/getting-started/plans-and-limits/what-counts-as-a-cu.md)
