blockchain

package
v0.0.0-...-8fd614f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FabricSetup

type FabricSetup struct {

	// Network parameters
	OrdererID string

	// Channel parameters
	ChannelID     string
	ChannelConfig string

	// Chaincode parameters
	ChaincodeID     string
	ChaincodeGoPath string
	ChaincodePath   string
	OrgAdmin        string
	OrgName         string
	ConfigFile      string

	// CA parameters
	CaID     string
	CaClient *caMsp.Client
	// contains filtered or unexported fields
}

FabricSetup implementation

func (*FabricSetup) CloseSDK

func (setup *FabricSetup) CloseSDK()

func (*FabricSetup) EnrollUser

func (s *FabricSetup) EnrollUser(email, password string) error

func (*FabricSetup) Initialize

func (setup *FabricSetup) Initialize() error

Initialize reads the configuration file and sets up the client, chain and event hub

func (*FabricSetup) InstallAndInstantiateCC

func (setup *FabricSetup) InstallAndInstantiateCC() error

func (*FabricSetup) LoginUser

func (s *FabricSetup) LoginUser(email, password string) (*FabricUser, error)

func (*FabricSetup) ReEnrollUser

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

func (*FabricSetup) RegisterUser

func (s *FabricSetup) RegisterUser(name, email, company, occupation, salary, password, userType string) (*FabricUser, error)

func (*FabricSetup) RegisterWithCA

func (s *FabricSetup) RegisterWithCA(email, password, userType string) error

func (*FabricSetup) SessionUser

func (s *FabricSetup) SessionUser() (*FabricUser, error)

func (*FabricSetup) TestM

func (s *FabricSetup) TestM()

type FabricUser

type FabricUser struct {
	Username        string
	Fabric          *FabricSetup
	SigningIdentity msp.SigningIdentity
	ChannelClient   *channel.Client
}

FabricUser struct that allow a registered user to query and invoke the blockchain

func (*FabricUser) ChangePassword

func (s *FabricUser) ChangePassword(email, userType, oldPwd, newPwd string) error

func (*FabricUser) DeleteUserFromLedger

func (user *FabricUser) DeleteUserFromLedger(emailValue string) error

func (*FabricUser) ExecuteTranctionEvent

func (user *FabricUser) ExecuteTranctionEvent(eventID, fcnName string, args [][]byte) (*channel.Response, error)

func (*FabricUser) GetAllUsersFromLedger

func (user *FabricUser) GetAllUsersFromLedger() ([]model.UserData, error)

func (*FabricUser) GetUserFromLedger

func (user *FabricUser) GetUserFromLedger(emailValue string) (*model.UserData, error)

func (*FabricUser) Logout

func (s *FabricUser) Logout()

func (*FabricUser) RemoveUser

func (s *FabricUser) RemoveUser(email string) error

func (*FabricUser) RemoveUserFromCA

func (s *FabricUser) RemoveUserFromCA(email string) error

func (*FabricUser) RevokeUser

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

func (*FabricUser) UpdateUserData

func (u *FabricUser) UpdateUserData(userId, name, email, company, occupation, salary, userType string) error

func (*FabricUser) UpdateUserDataFromLedger

func (user *FabricUser) UpdateUserDataFromLedger(userId, name, email,
	company, occupation, salary, userType string) error

Jump to

Keyboard shortcuts

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