Skip to content

Data Sources API ​

Data source endpoints 用于管理 custom EVM/Substrate/Solana sources、runtime status 和 logs。

GET /api/custom-sources ​

返回 custom data sources。

参数:

参数位置说明
workspaceQuery可选 workspace fullname 过滤器。

Payload: 无。

响应:CustomSourceListView[]。

GET /api/custom-sources/create-capability ​

检查当前 account/workspace 是否可以创建 custom source。

参数:无。

Payload: 无。

响应:CustomSourceCreateCapability。

POST /api/custom-sources/verify ​

保存前验证 custom source config。

参数:无。

Payload:

字段必填说明
workspace是Workspace fullname。
name是Source name。
public否Source 是否作为 public 提议/发布。
kind是evm、substrate 或 solana。
endpoints是RPC/indexer endpoint URLs 数组。
substrate.extensions否Substrate metadata/extensions config。

响应:CustomSourceVerifyResult。

GET /api/custom-sources/:fullname ​

返回 custom source。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: 无。

响应:CustomSource。

PUT /api/custom-sources/:fullname ​

创建或更新 custom source。

参数:

参数位置说明
fullnamePathCustom source fullname。必须与 payload.fullname 一致。

Payload:

字段必填说明
mode是create 或 update。
name是Source name。
fullname是Source fullname。
workspace是Workspace fullname。
public否Source 是否为 public。
kind是evm、substrate 或 solana。
endpoints是Endpoint URLs 数组。
batchMaxCount否Runtime batch max count。
blockProcessingConcurrency否Runtime block processing concurrency。
maxQueuedBlocks否Runtime queued block limit。
substrate.extensions否Substrate extensions/types/rpc config。
meta.title是可见标题。
meta.description否描述。
meta.icons.default否Icon URL。

响应:CustomSource。

DELETE /api/custom-sources/:fullname ​

删除 custom source。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: 无。

响应:OperationResult。

GET /api/custom-sources/:fullname/logs ​

返回 custom source logs。

参数:

参数位置说明
fullnamePathCustom source fullname。
limitQuery50、100、250 或 500。
levelQueryinfo、warn 或 error。
directionQuerybefore 或 after。
datetimeQueryCursor date-time。

Payload: 无。

响应:CustomSourceLogsResult。

POST /api/custom-sources/:fullname/test-status ​

检查或模拟 custom source status transition。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload:

字段必填说明
type是error 或 recovered。

响应:CustomSourceStatusTestResult。

POST /api/custom-sources/:fullname/restart ​

重启 custom source runtime。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: {}。

响应:CustomSourceRuntimeActionResult。

POST /api/custom-sources/:fullname/reset-lag ​

重置 custom source lag。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: {}。

响应:CustomSourceResetLagResult。