> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockx.chaintable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 内部协议

> Worker、Executor、Coordinator 与后端适配器之间的协议归属。

内部协议连接任务执行组件。对外请求与结果字段集中在[服务 API](/zh/reference/service-api)和[结果参考](/zh/reference/results-and-errors)。

## 协议边界

| 边界 | 职责 | BlockX 仓库中的来源 |
| - | - | - |
| 调用方与执行服务 | 提交、选址、结果订阅和同步调用 | `api/grpc/` |
| Worker 与 Python Executor | 派发、完成和挂起的后端操作 | `api/uds/`、`pyhost/src/proto.c` |
| Coordinator 与 Worker 发现 | 注册与心跳数据 | `api/etcd/` |
| Worker 与数据后端 | BlockDB 操作与 EVM 节点请求 | `internal/sdk/` |

## 经运行时执行 EVM 读取

函数通过公开的 EVM 对象提供链与区块上下文。`python/blockx_runtime/noderpc_bridge.py` 将节点请求路由到宿主桥接。Worker IO 派发对应后端操作，再将响应返回给挂起的计算。

BlockX Call 标识跟踪函数执行。链、区块、合约与查询参数属于后端请求；修改路由或缓存行为时应保留这些信息。

## 协议与领域模型

* Protobuf 消息定义服务输入与输出。
* Worker adapter 在 `internal/worker/adapters/wire.go` 中将消息转换为内部任务类型。
* Call Builder 与 Writer Plugin 配置保持 JSON 形式，字段由 Plugin 定义。
* 任务失败详情与 RPC 状态通过不同通道表达；调用方契约见[结果与错误](/zh/reference/results-and-errors)。

## 修改协议

修改字段或消息处理时，同步更新生产方与消费方。共享定义放在 `api/`，并运行对应编解码、adapter 与进程测试。源码位置与测试入口见负责该协议的组件页。

BlockX 仓库中的设计参考：`docs/specs/code-style.md`、`docs/specs/worker.md` 和 `docs/specs/sync-invoker.md`。

## 相关文档

* [Python Executor](/zh/components/python-executor)
* [后端适配器](/zh/components/backend-adapter)
* [Task 生命周期](/zh/architecture/task-lifecycle)
* [测试](/zh/development/testing)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.