Documentation ¶
Overview ¶
Package fabadmin handles administration commands for hyperledger fabric
Package fabadmin handles administration commands for hyperledger fabric ¶
Package fabadmin handles administration commands for hyperledger fabric
Index ¶
- func CloseConnection()
- func CreateChannel(channel, configRoot string, ordererOrg *Organization, peerOrgs []*Organization) (uint64, error)
- func GetClientOrgName() string
- func InitAdminContext(configPath, entityMatcherOverride string) error
- func ParseChaincodePath(path string) []string
- func Subst(path string) string
- type AdminContext
- type BackendConfig
- type CAConfig
- type ChaincodePackage
- type ClientConfig
- type EnrollCredentials
- type Organization
- func (org *Organization) InstallChaincode(pkg *ChaincodePackage, peerURLs ...string) error
- func (org *Organization) InstantiateChaincode(pkg *ChaincodePackage, channelID string, policy string, initArgs string) error
- func (org *Organization) IsCCInstalled(pkg *ChaincodePackage, peers ...fab.Peer) (bool, error)
- func (org *Organization) IsJoinedChannel(channel string, peers ...fab.Peer) (bool, error)
- func (org *Organization) JoinChannel(channel string) error
- func (org *Organization) UpdateChannelAnchor(channel, configRoot string, lastConfigBlock uint64) (uint64, error)
- func (org *Organization) UpgradeChaincode(pkg *ChaincodePackage, channelID string, policy string, initArgs string) error
- type PathConfig
- type TLSCAConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnection ¶
func CloseConnection()
CloseConnection cleans up cache and closes all connections
func CreateChannel ¶
func CreateChannel(channel, configRoot string, ordererOrg *Organization, peerOrgs []*Organization) (uint64, error)
CreateChannel creates a specified channel. This require multiple org admins' signature; this proecess should be separated into multiple steps, if nobody knows signing keys for all peer orgs
func GetClientOrgName ¶
func GetClientOrgName() string
GetClientOrgName returns the name of the configured client's org
func InitAdminContext ¶
InitAdminContext initialize SDK based on specified config.yaml and entity-matcher file
func ParseChaincodePath ¶
ParseChaincodePath separates path of format xxx/src/yyy, and returns [xxx, yyy] as array of 2 elements, or the original string with env replaced by Subst()
Types ¶
type AdminContext ¶
type AdminContext struct {
// contains filtered or unexported fields
}
AdminContext provides configuration of admin client
type BackendConfig ¶
type BackendConfig struct { Version string Client ClientConfig Channels map[string]fab.ChannelEndpointConfig Organizations map[string]fab.OrganizationConfig Orderers map[string]fab.OrdererConfig Peers map[string]fab.PeerConfig CertificateAuthorities map[string]CAConfig EntityMatchers map[string][]fab.MatchConfig }
BackendConfig provides the definition of backend configuration
func (*BackendConfig) GetClientOrgName ¶
func (bc *BackendConfig) GetClientOrgName() string
GetClientOrgName returns the name of the client's org
func (*BackendConfig) GetOrdererName ¶
func (bc *BackendConfig) GetOrdererName() string
GetOrdererName returns the name of first non-default orderer
func (*BackendConfig) GetOrganizationConfig ¶
func (bc *BackendConfig) GetOrganizationConfig(name string) *Organization
GetOrganizationConfig returns configured attributes of a specified organization
type CAConfig ¶
type CAConfig struct { URL string GRPCOptions map[string]interface{} Registrar EnrollCredentials CAName string TLSCACerts TLSCAConfig }
CAConfig defines a CA configuration
type ChaincodePackage ¶
ChaincodePackage contains chaincode and installation metadata
func CreateCCPackage ¶
func CreateCCPackage(ccPath, ccRoot, name, version string) (*ChaincodePackage, error)
CreateCCPackage creates a new golang chaincode package that contains source code under ${ccRoot}/src/${ccPath}
type ClientConfig ¶
type ClientConfig struct { Organization string CryptoConfig PathConfig TLSCerts fab.ClientTLSConfig }
ClientConfig provides the definition of the client configuration
type EnrollCredentials ¶
EnrollCredentials holds credentials used for enrollment
type Organization ¶
type Organization struct { Name string MSPID string CryptoPath string AdminUser string AdminContext context.ClientProvider Peers []fab.Peer // discovered peers; unique id peer.URL() CertificateAuthorities []string IsOrdererOrg bool }
Organization provides the definition of an organization in the network
func InitOrganization ¶
func InitOrganization(orgName, orgAdminUser string) *Organization
InitOrganization iniailizes admin client of a specified org
func (*Organization) InstallChaincode ¶
func (org *Organization) InstallChaincode(pkg *ChaincodePackage, peerURLs ...string) error
InstallChaincode installs a chaincode package on specified peers of an org. Install it on all peers of the org if peer URLs are not specified.
func (*Organization) InstantiateChaincode ¶
func (org *Organization) InstantiateChaincode(pkg *ChaincodePackage, channelID string, policy string, initArgs string) error
InstantiateChaincode instantiates a chaincode on all peers of the specified org
func (*Organization) IsCCInstalled ¶
func (org *Organization) IsCCInstalled(pkg *ChaincodePackage, peers ...fab.Peer) (bool, error)
IsCCInstalled returns true if the specified CC is already installed on all specified peers of an org. check all peers if peers are not specified
func (*Organization) IsJoinedChannel ¶
IsJoinedChannel returns true if the org joined a specified channel on specified peers. check all peers if peer is not specified.
func (*Organization) JoinChannel ¶
func (org *Organization) JoinChannel(channel string) error
JoinChannel makes the org join a specified channel
func (*Organization) UpdateChannelAnchor ¶
func (org *Organization) UpdateChannelAnchor(channel, configRoot string, lastConfigBlock uint64) (uint64, error)
UpdateChannelAnchor updates channel config to set anchor peer for an org
func (*Organization) UpgradeChaincode ¶
func (org *Organization) UpgradeChaincode(pkg *ChaincodePackage, channelID string, policy string, initArgs string) error
UpgradeChaincode instantiates a chaincode on all peers of the specified org
type PathConfig ¶
type PathConfig struct {
Path string
}
PathConfig provide the definition with a path attribute
type TLSCAConfig ¶
type TLSCAConfig struct { Path string Client endpoint.TLSKeyPair }
TLSCAConfig contains the TLS CA configuration