org

package
v0.0.0-...-b6b001a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OrgList []OrgSetup
View Source
var OrgNames []string

Functions

func CToGoString

func CToGoString(c []byte) string

func DiscoverLocalPeers

func DiscoverLocalPeers(ctxProvider context.ClientProvider, expectedPeers int) ([]fabAPI.Peer, error)

func LoadOrgPeers

func LoadOrgPeers(ctxProvider context.ClientProvider) error

func QueryInstalledCC

func QueryInstalledCC(orgID string, resMgmt *resmgmt.Client,
	ccName, ccVersion string, peers []fab.Peer) (bool, error)

func QueryInstantiatedCC

func QueryInstantiatedCC(orgID string, resMgmt *resmgmt.Client, channelID, ccName, ccVersion string, peers []fab.Peer) (bool, error)

func WaitForOrdererConfigUpdate

func WaitForOrdererConfigUpdate(client *resmgmt.Client, channelID string, genesis bool, lastConfigBlock uint64) (uint64, error)

WaitForOrdererConfigUpdate waits until the config block update has been committed. In Fabric 1.0 there is a bug that panics the orderer if more than one config update is added to the same block. This function may be invoked after each config update as a workaround.

Types

type OrgSetup

type OrgSetup struct {

	// Network parameters
	OrdererID             string
	OrdererAdmin          string
	OrdererName           string
	OrdererClientContext  contextAPI.ClientProvider
	OrdererChannelContext contextAPI.ChannelProvider
	OrdererResmgmt        *resmgmt.Client

	// Channel parameters
	ChannelID     string
	ChannelConfig string

	// Chaincode parameters
	ChaincodeGoPath  string
	ChaincodePath    string
	ChaincodeId      string
	ChainCodeVersion string
	ChainCodePolicy  string

	CCPkg *resource.CCPackage

	ConfigFile          string
	OrgCaID             string
	OrgName             string
	OrgAdmin            string
	UserName            string
	OrgCollection       string
	OrgCollectionPolicy string
	OrgCollectionConfig *pr.CollectionConfig

	Sdk               *fabsdk.FabricSDK
	CaClient          *caMsp.Client
	Resmgmt           *resmgmt.Client
	Ctx               contextAPI.ClientProvider
	MspClient         *mspclient.Client
	Peers             []fabAPI.Peer
	ChannelContext    contextAPI.ChannelProvider
	ChannelClient     *channel.Client
	Event             *event.Client
	SigningIdentity   msp.SigningIdentity
	SigningIdentities []msp.SigningIdentity
}
var Orderer OrgSetup

func InitiateOrderer

func InitiateOrderer() (OrgSetup, error)

func InitiateOrg

func InitiateOrg(obj OrgSetup) (OrgSetup, error)

func (*OrgSetup) AddAffiliationOrg

func (s *OrgSetup) AddAffiliationOrg() error

func (*OrgSetup) ChangePassword

func (s *OrgSetup) ChangePassword(email, role, oldPwd, newPwd string) error

func (*OrgSetup) ChooseORG

func (s *OrgSetup) ChooseORG(org string) *OrgSetup

func (*OrgSetup) CreateCCPackage

func (s *OrgSetup) CreateCCPackage() (*resource.CCPackage, error)

func (*OrgSetup) CreateChannelClient

func (s *OrgSetup) CreateChannelClient(sdk *fabsdk.FabricSDK, org string, email string, caClient *caMsp.Client) (*channel.Client, *event.Client, error)

func (*OrgSetup) CreateChannelForOrg

func (s *OrgSetup) CreateChannelForOrg() error

func (*OrgSetup) ExecuteChaincodeTranctionEvent

func (s *OrgSetup) ExecuteChaincodeTranctionEvent(eventID, fcnName string, args [][]byte, chaincodeId string, channelClient *channel.Client, ccEvent *event.Client) (*channel.Response, error)

func (*OrgSetup) FilteredOrgNames

func (s *OrgSetup) FilteredOrgNames() []string

func (*OrgSetup) GetOrgNames

func (s *OrgSetup) GetOrgNames() []string

func (*OrgSetup) GetOrgUser

func (s *OrgSetup) GetOrgUser() *OrgUser

func (*OrgSetup) Init

func (s *OrgSetup) Init(processAll bool) error

func (*OrgSetup) InitializeAllOrgs

func (s *OrgSetup) InitializeAllOrgs() error

func (*OrgSetup) InitializeOrg

func (s *OrgSetup) InitializeOrg(org string) (OrgSetup, error)

func (*OrgSetup) InstallCCForOrg

func (s *OrgSetup) InstallCCForOrg(ccPkg *resource.CCPackage) error

func (*OrgSetup) InstantiateCCForOrg

func (s *OrgSetup) InstantiateCCForOrg(orgPeers []fab.Peer) error

func (*OrgSetup) IsJoinedChannel

func (s *OrgSetup) IsJoinedChannel(orgResmgmt *resmgmt.Client, peer fabAPI.Peer) (bool, error)

func (*OrgSetup) JoinChannelForOrg

func (s *OrgSetup) JoinChannelForOrg() error

func (*OrgSetup) LoginUserWithCA

func (s *OrgSetup) LoginUserWithCA(email, password string) (*OrgUser, error)

func (*OrgSetup) QueryInstalledCCForOrg

func (s *OrgSetup) QueryInstalledCCForOrg() error

func (*OrgSetup) QueryInstantiatedCCForOrg

func (s *OrgSetup) QueryInstantiatedCCForOrg() error

func (*OrgSetup) ReEnrollUser

func (s *OrgSetup) ReEnrollUser(email string) error

func (*OrgSetup) RegisterUserWithCA

func (s *OrgSetup) RegisterUserWithCA(org, email, password, role string) (*OrgUser, error)

func (*OrgSetup) SetupCollConfig

func (s *OrgSetup) SetupCollConfig() ([]*pr.CollectionConfig, error)

func (*OrgSetup) TestInvoke

func (s *OrgSetup) TestInvoke(org string) error

func (*OrgSetup) UpgradeCCForOrg

func (s *OrgSetup) UpgradeCCForOrg(orgPeers []fab.Peer) error

type OrgUser

type OrgUser struct {
	Username      string
	ChannelClient *channel.Client
	Event         *event.Client
	Setup         OrgSetup
}

func (*OrgUser) Logout

func (s *OrgUser) Logout()

func (*OrgUser) RemoveUser

func (s *OrgUser) RemoveUser(email string, caID string, caClient *caMsp.Client) error

func (*OrgUser) RemoveUserFromCA

func (s *OrgUser) RemoveUserFromCA(email string, caID string, caClient *caMsp.Client) error

func (*OrgUser) RevokeUser

func (s *OrgUser) RevokeUser(email string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL