Skip to content

Data Sources API

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

GET /api/v2/custom-sources

返回 custom data sources。

参数:

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

Payload: 无。

响应:CustomSourceListView[]

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

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

参数:无。

Payload: 无。

响应:CustomSourceCreateCapability

POST /api/v2/custom-sources/verify

保存前验证 custom source config。

参数:无。

Payload:

字段必填说明
workspaceWorkspace fullname。
nameSource name。
publicSource 是否作为 public 提议/发布。
kindevmsubstrate
endpointsRPC/indexer endpoint URLs 数组。
substrate.extensionsSubstrate metadata/extensions config。

响应:CustomSourceVerifyResult

GET /api/v2/custom-sources/:fullname

返回 custom source。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: 无。

响应:CustomSource

PUT /api/v2/custom-sources/:fullname

创建或更新 custom source。

参数:

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

Payload:

字段必填说明
modecreateupdate
nameSource name。
fullnameSource fullname。
workspaceWorkspace fullname。
publicSource 是否为 public。
kindevmsubstrate
endpointsEndpoint URLs 数组。
batchMaxCountRuntime batch max count。
blockProcessingConcurrencyRuntime block processing concurrency。
maxQueuedBlocksRuntime queued block limit。
substrate.extensionsSubstrate extensions/types/rpc config。
meta.title可见标题。
meta.description描述。
meta.icons.defaultIcon URL。

响应:CustomSource

DELETE /api/v2/custom-sources/:fullname

删除 custom source。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: 无。

响应:OperationResult

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

返回 custom source logs。

参数:

参数位置说明
fullnamePathCustom source fullname。
limitQuery50100250500
levelQueryinfowarnerror
directionQuerybeforeafter
datetimeQueryCursor date-time。

Payload: 无。

响应:CustomSourceLogsResult

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

检查或模拟 custom source status transition。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload:

字段必填说明
typeerrorrecovered

响应:CustomSourceStatusTestResult

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

重启 custom source runtime。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: {}

响应:CustomSourceRuntimeActionResult

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

重置 custom source lag。

参数:

参数位置说明
fullnamePathCustom source fullname。

Payload: {}

响应:CustomSourceResetLagResult