# 存证

Go SDK 支持存证的创建和查询。

# 导入

导入 Go SDK 存证模块:

Copy import ( "github.com/bianjieai/irita-sdk-go/modules/record" )

# 接口

# 创建存证

接口:

Copy client.Record.CreateRecord(request CreateRecordRequest, baseTx sdk.BaseTx) (string, sdk.Error)

参数:

  • request:创建存证请求对象

    Copy type CreateRecordRequest struct { Contents []Content } type Content struct { Digest string DigestAlgo string URI string Meta string }

返回值:

  • 存证 ID

# 查询存证

接口:

Copy client.Record.QueryRecord(recordID string) (QueryRecordResponse, sdk.Error)

参数:

  • recordID:存证 ID

返回值:

  • 查询存证响应

    Copy type QueryRecordResponse struct { TxHash string Contents []Content Creator string }