5.4.4.5 密钥托管模式下调用智能合约接口

  链下业务系统在连接节点网关时,需要按照接口说明在请求中加 入相应的请求参数,调用节点网关以后,节点网关会返回智能合约的 执行结果。

  1. 接口地址:https://节点网关地址/api/fiscobcos/v1/node/reqChainCode

注:用户参与服务成功后可以在服务详情页面查看并下载应用链下业 务系统开发所需要的应用服务配置参数、节点网关地址和应用接入密钥对,如下图:

  2. 通讯方式:POST

  3. 签名算法:详见5.4.4.1 应用接入签名算法

  4. 请求参数

序号 字段名 字段 类型 必填 备注
1 信息头 header Map
2 信息体 body Map
3 签名值 mac String
header:
1 用户唯一标识 userCode String
2 应用唯一标识 appCode String
Body:
1 用户 ID userId String 通过用户注册接口注册的用户的 id
2 合约名称 contractName String
3 方法名称 funcName String
4 方法参数 funcParam String 将 array 格式的参数转 为 json 字符串赋值

  示例:

{
    "header":{
        "appCode":"cl0006202003181926573677572",
        "userCode":"USER0006202003181951281835816"
    },
    "body":{
        "contractName":"HelloWorld",
        "userId":"100003",
        "funcName":"set",
        "funcParam":[\"abc"\]
    },
    "mac":"MEUCIQDTFe2Gerdf7YJrG1a1Yt99M0ZQ3T1lGpsXdNmFV7WuTgIgSkZ19abUhAJbMrJMBoD8N7f26xhpQRuR4vNAfY7EEbs="
}

  5. 响应参数

序号 字段名 字段 类型 必填 备注
1 信息头 header Map
2 信息体 body Map
3 签名值 mac String
header:
1 响应标识 code int 0:校验成功
-1:校验失败
2 响应信息 msg String code=0 时可为 null
body:
1 调用类型 constant Bool
2 查询信息 queryInfo String constant 为 true 时,该 字段有值
3 交易hash txId String constant 为 false 时, 该字段有值并且有效
4 块哈希 blockHash String constant 为 false 时, 该字段有值并且有效
5 块号 blockNumber Int constant 为 false 时, 该字段有值并且有效
6 Gas使用值 gasUsed Int constant 为 false 时, 该字段有值并且有效
7 交易状态 status String constant 为 false 时, 该字段有值并且有 效,0x0 表示交易成功,状态值参考交易回执状态
8 发送者的地址 from String constant 为 false 时, 该字段有值并且有效
9 接收者的地址 to String constant 为 false 时, 该字段有值并且有效
10 输入 input String constant 为 false 时, 该字段有值并且有效
11 输出 output String constant 为 false 时, 该字段有值并且有效
Copyright 北京红枣科技有限公司

results matching ""

    No results matching ""

    results matching ""

      No results matching ""