Skip to content

Commit

Permalink
[FAB-5115] Refactoring config and channel get methods.
Browse files Browse the repository at this point in the history
Change-Id: I7e3555caab19e574b99c86e8db1b04db6f54e0fd
Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Jun 29, 2017
1 parent 1876110 commit db358ac
Show file tree
Hide file tree
Showing 31 changed files with 560 additions and 428 deletions.
22 changes: 11 additions & 11 deletions api/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ import (
* primary orderer to retrieve the configuration settings for this channel.
*/
type Channel interface {
GetName() string
Name() string
Initialize(data []byte) error
IsInitialized() bool
IsSecurityEnabled() bool
GetTCertBatchSize() int
TCertBatchSize() int
SetTCertBatchSize(batchSize int)
AddPeer(peer Peer) error
RemovePeer(peer Peer)
GetPeers() []Peer
GetAnchorPeers() []OrgAnchorPeer
Peers() []Peer
AnchorPeers() []OrgAnchorPeer
SetPrimaryPeer(peer Peer) error
GetPrimaryPeer() Peer
PrimaryPeer() Peer
AddOrderer(orderer Orderer) error
RemoveOrderer(orderer Orderer)
GetOrderers() []Orderer
Orderers() []Orderer
SetMSPManager(mspManager msp.MSPManager)
GetMSPManager() msp.MSPManager
GetGenesisBlock(request *GenesisBlockRequest) (*common.Block, error)
MSPManager() msp.MSPManager
GenesisBlock(request *GenesisBlockRequest) (*common.Block, error)
JoinChannel(request *JoinChannelRequest) error
UpdateChannel() bool
IsReadonly() bool
Expand All @@ -55,20 +55,20 @@ type Channel interface {
CreateTransaction(resps []*TransactionProposalResponse) (*Transaction, error)
SendTransaction(tx *Transaction) ([]*TransactionResponse, error)
SendInstantiateProposal(chaincodeName string, channelID string, args []string, chaincodePath string, chaincodeVersion string, targets []Peer) ([]*TransactionProposalResponse, string, error)
GetOrganizationUnits() ([]string, error)
OrganizationUnits() ([]string, error)
QueryExtensionInterface() ChannelExtension
LoadConfigUpdateEnvelope(data []byte) error
}

// The ChannelExtension interface allows extensions of the SDK to add functionality to Channel overloads.
type ChannelExtension interface {
GetClientContext() FabricClient
ClientContext() FabricClient

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

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

// OrgAnchorPeer contains information about an anchor peer on this channel
Expand Down
36 changes: 18 additions & 18 deletions api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ import (

// Config fabric-sdk-go configuration interface
type Config interface {
GetCAConfig(org string) (*CAConfig, error)
GetCAServerCertFiles(org string) ([]string, error)
GetCAClientKeyFile(org string) (string, error)
GetCAClientCertFile(org string) (string, error)
GetMspID(org string) (string, error)
GetFabricClientViper() *viper.Viper
GetRandomOrdererConfig() (*OrdererConfig, error)
GetOrdererConfig(name string) (*OrdererConfig, error)
GetPeersConfig(org string) ([]PeerConfig, error)
GetNetworkConfig() (*NetworkConfig, error)
CAConfig(org string) (*CAConfig, error)
CAServerCertFiles(org string) ([]string, error)
CAClientKeyFile(org string) (string, error)
CAClientCertFile(org string) (string, error)
MspID(org string) (string, error)
FabricClientViper() *viper.Viper
RandomOrdererConfig() (*OrdererConfig, error)
OrdererConfig(name string) (*OrdererConfig, error)
PeersConfig(org string) ([]PeerConfig, error)
NetworkConfig() (*NetworkConfig, error)
IsTLSEnabled() bool
GetTLSCACertPool(tlsCertificate string) (*x509.CertPool, error)
GetTLSCACertPoolFromRoots(ordererRootCAs [][]byte) (*x509.CertPool, error)
TLSCACertPool(tlsCertificate string) (*x509.CertPool, error)
TLSCACertPoolFromRoots(ordererRootCAs [][]byte) (*x509.CertPool, error)
IsSecurityEnabled() bool
TcertBatchSize() int
GetSecurityAlgorithm() string
GetSecurityLevel() int
GetKeyStorePath() string
GetCAKeyStorePath() string
GetCryptoConfigPath() string
GetCSPConfig() *bccspFactory.FactoryOpts
SecurityAlgorithm() string
SecurityLevel() int
KeyStorePath() string
CAKeyStorePath() string
CryptoConfigPath() string
CSPConfig() *bccspFactory.FactoryOpts
}
Loading

0 comments on commit db358ac

Please sign in to comment.