代码拉取完成,页面将自动刷新
/**
* @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)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。