Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit db358ac

Browse files
committed
[FAB-5115] Refactoring config and channel get methods.
Change-Id: I7e3555caab19e574b99c86e8db1b04db6f54e0fd Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
1 parent 1876110 commit db358ac

31 files changed

+560
-428
lines changed

api/channel.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ import (
2323
* primary orderer to retrieve the configuration settings for this channel.
2424
*/
2525
type Channel interface {
26-
GetName() string
26+
Name() string
2727
Initialize(data []byte) error
2828
IsInitialized() bool
2929
IsSecurityEnabled() bool
30-
GetTCertBatchSize() int
30+
TCertBatchSize() int
3131
SetTCertBatchSize(batchSize int)
3232
AddPeer(peer Peer) error
3333
RemovePeer(peer Peer)
34-
GetPeers() []Peer
35-
GetAnchorPeers() []OrgAnchorPeer
34+
Peers() []Peer
35+
AnchorPeers() []OrgAnchorPeer
3636
SetPrimaryPeer(peer Peer) error
37-
GetPrimaryPeer() Peer
37+
PrimaryPeer() Peer
3838
AddOrderer(orderer Orderer) error
3939
RemoveOrderer(orderer Orderer)
40-
GetOrderers() []Orderer
40+
Orderers() []Orderer
4141
SetMSPManager(mspManager msp.MSPManager)
42-
GetMSPManager() msp.MSPManager
43-
GetGenesisBlock(request *GenesisBlockRequest) (*common.Block, error)
42+
MSPManager() msp.MSPManager
43+
GenesisBlock(request *GenesisBlockRequest) (*common.Block, error)
4444
JoinChannel(request *JoinChannelRequest) error
4545
UpdateChannel() bool
4646
IsReadonly() bool
@@ -55,20 +55,20 @@ type Channel interface {
5555
CreateTransaction(resps []*TransactionProposalResponse) (*Transaction, error)
5656
SendTransaction(tx *Transaction) ([]*TransactionResponse, error)
5757
SendInstantiateProposal(chaincodeName string, channelID string, args []string, chaincodePath string, chaincodeVersion string, targets []Peer) ([]*TransactionProposalResponse, string, error)
58-
GetOrganizationUnits() ([]string, error)
58+
OrganizationUnits() ([]string, error)
5959
QueryExtensionInterface() ChannelExtension
6060
LoadConfigUpdateEnvelope(data []byte) error
6161
}
6262

6363
// The ChannelExtension interface allows extensions of the SDK to add functionality to Channel overloads.
6464
type ChannelExtension interface {
65-
GetClientContext() FabricClient
65+
ClientContext() FabricClient
6666

6767
SignPayload(payload []byte) (*SignedEnvelope, error)
6868
BroadcastEnvelope(envelope *SignedEnvelope) ([]*TransactionResponse, error)
6969

7070
// TODO: This should go somewhere else - see TransactionProposal.GetBytes(). - deprecated
71-
GetProposalBytes(tp *TransactionProposal) ([]byte, error)
71+
ProposalBytes(tp *TransactionProposal) ([]byte, error)
7272
}
7373

7474
// OrgAnchorPeer contains information about an anchor peer on this channel

api/config.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ import (
1515

1616
// Config fabric-sdk-go configuration interface
1717
type Config interface {
18-
GetCAConfig(org string) (*CAConfig, error)
19-
GetCAServerCertFiles(org string) ([]string, error)
20-
GetCAClientKeyFile(org string) (string, error)
21-
GetCAClientCertFile(org string) (string, error)
22-
GetMspID(org string) (string, error)
23-
GetFabricClientViper() *viper.Viper
24-
GetRandomOrdererConfig() (*OrdererConfig, error)
25-
GetOrdererConfig(name string) (*OrdererConfig, error)
26-
GetPeersConfig(org string) ([]PeerConfig, error)
27-
GetNetworkConfig() (*NetworkConfig, error)
18+
CAConfig(org string) (*CAConfig, error)
19+
CAServerCertFiles(org string) ([]string, error)
20+
CAClientKeyFile(org string) (string, error)
21+
CAClientCertFile(org string) (string, error)
22+
MspID(org string) (string, error)
23+
FabricClientViper() *viper.Viper
24+
RandomOrdererConfig() (*OrdererConfig, error)
25+
OrdererConfig(name string) (*OrdererConfig, error)
26+
PeersConfig(org string) ([]PeerConfig, error)
27+
NetworkConfig() (*NetworkConfig, error)
2828
IsTLSEnabled() bool
29-
GetTLSCACertPool(tlsCertificate string) (*x509.CertPool, error)
30-
GetTLSCACertPoolFromRoots(ordererRootCAs [][]byte) (*x509.CertPool, error)
29+
TLSCACertPool(tlsCertificate string) (*x509.CertPool, error)
30+
TLSCACertPoolFromRoots(ordererRootCAs [][]byte) (*x509.CertPool, error)
3131
IsSecurityEnabled() bool
3232
TcertBatchSize() int
33-
GetSecurityAlgorithm() string
34-
GetSecurityLevel() int
35-
GetKeyStorePath() string
36-
GetCAKeyStorePath() string
37-
GetCryptoConfigPath() string
38-
GetCSPConfig() *bccspFactory.FactoryOpts
33+
SecurityAlgorithm() string
34+
SecurityLevel() int
35+
KeyStorePath() string
36+
CAKeyStorePath() string
37+
CryptoConfigPath() string
38+
CSPConfig() *bccspFactory.FactoryOpts
3939
}

0 commit comments

Comments
 (0)