forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
58 lines (51 loc) · 1.89 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package resource
import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
common "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common"
pb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer"
)
// CreateChannelRequest requests channel creation on the network
type CreateChannelRequest struct {
// required - The name of the new channel
Name string
// required - The Orderer to send the update request
Orderer fab.Orderer
// optional - the envelope object containing all
// required settings and signatures to initialize this channel.
// This envelope would have been created by the command
// line tool "configtx"
Envelope []byte
// optional - ConfigUpdate object built by the
// buildChannelConfig() method of this package
Config []byte
// optional - the list of collected signatures
// required by the channel create policy when using the `apiconfig` parameter.
// see signChannelConfig() method of this package
Signatures []*common.ConfigSignature
}
// InstallChaincodeRequest requests chaincode installation on the network
type InstallChaincodeRequest struct {
// required - name of the chaincode
Name string
// required - path to the location of chaincode sources (path from GOPATH/src folder)
Path string
// chaincodeVersion: required - version of the chaincode
Version string
// required - package (chaincode package type and bytes)
Package *CCPackage
}
// JoinChannelRequest allows a set of peers to transact on a channel on the network
type JoinChannelRequest struct {
// The name of the channel to be joined.
Name string
GenesisBlock *common.Block
}
// CCPackage contains package type and bytes required to create CDS
type CCPackage struct {
Type pb.ChaincodeSpec_Type
Code []byte
}