# TIP 查询

Ceramic流通过称为StreamIds的[URI](https://developers.ceramic.network/protocol/networking/streams/uri-scheme)进行标识。想要同步流的节点需要使用其StreamId查询网络以获取该流的Tip。`Tip是指给定流Tip的最近的初始化、数据或时间事件。`

## **协议**

### **查询消息**

```JSON
type QueryMessage = {
  typ: MsgType.QUERY // 1
  id: string
  stream: StreamID
}
```

其中

* **`typ`** 消息为查询消息，枚举值为1
* **`stream`** - 正在查询或解析的 streamId
* **`id -`**- multihash base64url.encode(sha265(dagCBOR({typ:1, streamId: stream})))，通常可以视为用于将查询与响应配对的随机字符串

### **响应消息**

```JSON
type ResponseMessage = {
  typ: MsgType.RESPONSE // 2
  id: string
  tips: Map<StreamId, CID> 
}
```

Where:

* **`typ`** - 该消息是响应消息，枚举值为2 `2`
* **`id`** - 此消息响应的查询ID
* **`tips`** - StreamID到流末端CID的映射表


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ceramic-zhong-wen-wen-dang.gitbook.io/ceramic-zhong-wen-wen-dang/ceramic-xie-yi/wang-luo/tip-cha-xun.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
