fabric

package
v0.0.0-...-21946b5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Setup

type Setup struct {
	ChannelID           string
	ChannelConfig       string
	ChaincodeID         string
	ChaincodeGoPath     string
	ChaincodePath       string
	ChaincodeVersion    string
	OrgID               string
	OrgMspID            string
	OrgAdminUser        string
	OrdererOrgID        string
	OrdererOrgAdminUser string
	OrdererID           string
	CaID                string
	ConfigFile          string
	// contains filtered or unexported fields
}

Setup implementation of the Hyperledger Fabric blockchain SDK

func (*Setup) CloseSDK

func (s *Setup) CloseSDK()

CloseSDK allow to close communication between the initialized blockchain client and the network

func (*Setup) Initialize

func (s *Setup) Initialize() error

Initialize reads the configuration stored in the Setup struct and sets up the blockchain client

func (*Setup) Install

func (s *Setup) Install() error

Install reads the configuration stored in the Setup struct and sets up the blockchain channel and chaincode

func (*Setup) LogUser

func (s *Setup) LogUser(username, password string) (*User, error)

LogUser allow to login a user using credentials provided and retrieve the blockchain user related

func (*Setup) RegisterUser

func (s *Setup) RegisterUser(username, password, userType string) error

RegisterUser register a user to the Fabric CA client and into the blockchain using invoke on the chaincode

type User

type User struct {
	Username        string
	Fabric          *Setup
	ChannelClient   *channel.Client
	SigningIdentity msp.SigningIdentity
}

User stuct that allow a registered user to query and invoke the blockchain

func (*User) QueryAdmin

func (u *User) QueryAdmin() (*model.Admin, error)

QueryAdmin query the blockchain chaincode to retrieve information about the current admin user connected

func (*User) QueryConsumer

func (u *User) QueryConsumer() (*model.Consumer, error)

QueryConsumer query the blockchain chaincode to retrieve information about the current consumer user connected

func (*User) QueryResource

func (u *User) QueryResource(resourceID string) (*model.Resource, model.ResourceHistories, error)

QueryResource query the blockchain chaincode to get resource details

func (*User) QueryResources

func (u *User) QueryResources(filter string) ([]model.Resource, error)

QueryResources query the blockchain chaincode to retrieve resources

func (*User) QueryResourcesDeleted

func (u *User) QueryResourcesDeleted() (model.ResourcesDeleted, error)

QueryResourcesDeleted query the blockchain chaincode to delete a resource

func (*User) UpdateAcquire

func (u *User) UpdateAcquire(resourceID string, mission string) error

UpdateAcquire allow to acquire a resource into the blockchain

func (*User) UpdateAdd

func (u *User) UpdateAdd(resourceID, resourceDescription string) error

UpdateAdd allow to add a resource into the blockchain

func (*User) UpdateDelete

func (u *User) UpdateDelete(resourceID string) error

UpdateDelete allow to delete a resource into the blockchain

func (*User) UpdateRegister

func (u *User) UpdateRegister() error

UpdateRegister allow to register a user into the blockchain

func (*User) UpdateRelease

func (u *User) UpdateRelease(resourceID string) error

UpdateRelease allow to release a resource into the blockchain

Jump to

Keyboard shortcuts

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