了解如何实现 ClientState 接口。

ClientType 方法

ClientType 应返回轻客户端的唯一字符串标识符。该标识符会在生成客户端标识符时使用。 其格式如下:{client-type}-{N},其中 {N} 是与特定客户端关联的全局唯一 nonce(例如 07-tendermint-0)。

Validate 方法

Validate 应校验客户端状态中的每个字段,并在任意值无效时返回错误。轻客户端实现者需要负责确定哪些校验是必需的。可参考 Tendermint 轻客户端实现。
Learn how to implement the ClientState interface.

ClientType method

ClientType should return a unique string identifier of the light client. This will be used when generating a client identifier. The format is created as follows: {client-type}-{N} where {N} is the unique global nonce associated with a specific client (e.g 07-tendermint-0).

Validate method

Validate should validate every client state field and should return an error if any value is invalid. The light client implementer is in charge of determining which checks are required. See the Tendermint light client implementation as a reference.