1 Star 0 Fork 0

Codey/PCNGateway-Go-SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 1002 Bytes
一键复制 编辑 原始数据 按行查看 历史
chenxifun 提交于 2020-07-01 14:15 . 提交BSN节点网关Go版本SDK
/**
* @Author: Gao Chenxi
* @Description:
* @Date: 2020/4/1 4:35 PM
* @File: main
*/
package main
import (
"fmt"
"github.com/BSNDA/PCNGateway-Go-SDK/pkg/client/fabric"
"github.com/BSNDA/PCNGateway-Go-SDK/pkg/core/config"
"github.com/BSNDA/PCNGateway-Go-SDK/pkg/core/entity/req/fabric/user"
"log"
)
func main() {
fmt.Println("github.com/BSNDA/PCNGateway-Go-SDK")
api := "" //PCN gateway address
userCode := "" //user code
appCode := "" //DApp code
puk := "" //public key
prk := "" //private key
mspDir := "" //cert storage directory
cert := "" //cert
config, err := config.NewConfig(api, userCode, appCode, puk, prk, mspDir, cert)
if err != nil {
log.Fatal(err)
}
client, err := fabric.InitFabricClient(config)
if err != nil {
log.Fatal(err)
}
req := user.RegisterReqDataBody{
Name: "",
Secret: "",
}
res, err := client.RegisterUser(req)
if err != nil {
log.Fatal(err)
}
if res.Header.Code != 0 {
log.Fatal(res.Header.Msg)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/codey-repositories/PCNGateway-Go-SDK.git
[email protected]:codey-repositories/PCNGateway-Go-SDK.git
codey-repositories
PCNGateway-Go-SDK
PCNGateway-Go-SDK
master

搜索帮助