TIP 查询
Ceramic流通过称为StreamIds的URI进行标识。想要同步流的节点需要使用其StreamId查询网络以获取该流的Tip。Tip是指给定流Tip的最近的初始化、数据或时间事件。
协议
查询消息
type QueryMessage = {
typ: MsgType.QUERY // 1
id: string
stream: StreamID
}
其中
typ
消息为查询消息,枚举值为1stream
- 正在查询或解析的 streamIdid -
- multihash base64url.encode(sha265(dagCBOR({typ:1, streamId: stream}))),通常可以视为用于将查询与响应配对的随机字符串
响应消息
type ResponseMessage = {
typ: MsgType.RESPONSE // 2
id: string
tips: Map<StreamId, CID>
}
Where:
typ
- 该消息是响应消息,枚举值为22
id
- 此消息响应的查询IDtips
- StreamID到流末端CID的映射表
Last updated