Overview
Product Features
Underlying Engine
Strengths
Scenarios
Basic Concepts
go get -u github.com/tencentcloud/tencentcloud-sdk-go
$GOPATH/src/github.com/tencentcloud.package mainimport ("fmt""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"tbaas "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tbaas/v20180416")func main() {// Instantiate an authentication object. Input parameters need to be passed in with the SecretId and SecretKey of your Tencent Cloud account. Here, you also need to pay attention to keeping the confidentiality of the key pair.credential := common.NewCredential("","",)// Instantiate a client option, optional, which can be skipped if there is no special requirement.cpf := profile.NewClientProfile()cpf.HttpProfile.Endpoint = "tbaas.intl.tencentcloudapi.com"// Instantiate the client object to request the product, and clientProfile is optional.client, _ := tbaas.NewClient(credential, "ap-hongkong", cpf)// Instantiate a request object. Each interface will correspond to a request object.request := tbaas.NewInvokeFabricChaincodeRequest()request.ClusterId = common.StringPtr("fabric-65z42qi150")request.ChannelId = common.StringPtr("channel-9xej4d")request.ChaincodeName = common.StringPtr("fact")request.FuncName = common.StringPtr("Set")request.FuncParam = common.StringPtrs([]string{ "key", "value" })request.WithAsyncResult = common.BoolPtr(false)// The returned resp is an instance of InvokeFabricChaincodeResponse, corresponding to the request object.response, err := client.InvokeFabricChaincode(request)if _, ok := err.(*errors.TencentCloudSDKError); ok {fmt.Printf("An API error has returned: %s", err)return}if err != nil {panic(err)}// Output string in json format.fmt.Printf("%s", response.ToJsonString())}
フィードバック