Documentation ¶
Index ¶
- func ConvertBytestoString(data [][]byte) []string
- func GetArgs(args []string) [][]byte
- func GetRegisteredUser(username, orgName, secret, identityTypeUser string, sdk *fabsdk.FabricSDK) (string, bool)
- func Prettyprint(b []byte) ([]byte, error)
- type Block
- type ChaincodeInput
- type ChaincodeSpec
- type ChannelHeader
- type Endorsement
- type FabricSetup
- func (hfc *FabricSetup) CreateChannel(user string, orgname string, channel string, filepath string) []byte
- func (hfc *FabricSetup) Init()
- func (hfc *FabricSetup) InstallChainCode(peers string, chainCodeName string, chainCodePath string, chainCodeType string, ...) []byte
- func (hfc *FabricSetup) InstantiateChainCode(user string, orgName string, channelName string, chainCodeName string, ...) []byte
- func (hfc *FabricSetup) InvokeChainCode(channelName, chainCodeID, username string, orgName string, fcn string, ...) []byte
- func (hfc *FabricSetup) JoinChannel(channelName string, peer string, orgname string) []byte
- func (hfc *FabricSetup) QueryBlockByID(channelName string, username string, orgName string, endpoint string, ...) []byte
- func (hfc *FabricSetup) QueryBlockHeight(channelName string, username string, orgName string, endpoint string) []byte
- func (hfc *FabricSetup) QueryChainCode(channelName string, chainCodeID string, username string, orgName string, ...) []byte
- type LastConfigMetadata
- type NsReadWriteSet
- type OrdererMetadata
- type SignatureHeader
- type SignatureMetadata
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBytestoString ¶
ConvertBytestoString converts [][]byte to []string
Types ¶
type Block ¶
type Block struct { Header *cb.BlockHeader `json:"header,omitempty"` Transactions []*Transaction `json:"transactions,omitempty"` BlockCreatorSignature *SignatureMetadata `json:"block_creator_signature,omitempty"` LastConfigBlockNumber *LastConfigMetadata `json:"last_config_block_number,omitempty"` TransactionFilter []uint8 `json:"transaction_filter,omitempty"` OrdererKafkaMetadata *OrdererMetadata `json:"orderer_kafka_metadata,omitempty"` }
Block Block in json format
type ChaincodeInput ¶
type ChaincodeInput struct {
Args []string
}
ChaincodeInput ChaincodeInput in json format
type ChaincodeSpec ¶
type ChaincodeSpec struct { Type pb.ChaincodeSpec_Type `json:"type,omitempty"` ChaincodeID *pb.ChaincodeID `json:"chaincode_id,omitempty"` Input *ChaincodeInput `json:"input,omitempty"` Timeout int32 `json:"timeout,omitempty"` }
ChaincodeSpec ChaincodeSpec in json format
type ChannelHeader ¶
type ChannelHeader struct { Type int32 `json:"type,omitempty"` Version int32 `json:"version,omitempty"` Timestamp *google_protobuf.Timestamp `json:"timestamp,omitempty"` ChannelID string `json:"channel_id,omitempty"` TxID string `json:"tx_id,omitempty"` Epoch uint64 `json:"epoch,omitempty"` ChaincodeID *pb.ChaincodeID `json:"chaincode_id,omitempty"` }
ChannelHeader ChannelHeader in json format
type Endorsement ¶
type Endorsement struct { SignatureHeader *SignatureHeader `json:"signature_header,omitempty"` Signature []byte `json:"signature,omitempty"` }
Endorsement Endorsement in json format
type FabricSetup ¶
type FabricSetup struct { AdminUser string OrdererOrgName string ConfigFileName string Secret []byte IdentityTypeUser string Sdk *fabsdk.FabricSDK RegistrarUsername string RegistrarPassword string ChannelID string Identity msp.Identity Targets []string }
FabricSetup struct
func (*FabricSetup) CreateChannel ¶
func (hfc *FabricSetup) CreateChannel(user string, orgname string, channel string, filepath string) []byte
CreateChannel creates the channel
func (*FabricSetup) InstallChainCode ¶
func (hfc *FabricSetup) InstallChainCode(peers string, chainCodeName string, chainCodePath string, chainCodeType string, chainCodeVersion string, orgname string, goPath string) []byte
InstallChainCode install chain codes on peers with the called Organization
func (*FabricSetup) InstantiateChainCode ¶
func (hfc *FabricSetup) InstantiateChainCode(user string, orgName string, channelName string, chainCodeName string, chainCodePath string, chainCodeVersion string, args [][]byte) []byte
InstantiateChainCode instantiates the installed chaincode on the network
func (*FabricSetup) InvokeChainCode ¶
func (hfc *FabricSetup) InvokeChainCode(channelName, chainCodeID, username string, orgName string, fcn string, args [][]byte, endpoints []string) []byte
InvokeChainCode invokes add, delete operations on the chaincode for transactions
func (*FabricSetup) JoinChannel ¶
func (hfc *FabricSetup) JoinChannel(channelName string, peer string, orgname string) []byte
JoinChannel joins peer(s) to a channel
func (*FabricSetup) QueryBlockByID ¶
func (hfc *FabricSetup) QueryBlockByID(channelName string, username string, orgName string, endpoint string, blockID uint64) []byte
QueryBlockByID queries blocks based on input ID
func (*FabricSetup) QueryBlockHeight ¶
func (hfc *FabricSetup) QueryBlockHeight(channelName string, username string, orgName string, endpoint string) []byte
QueryBlockHeight queries the blocks on ledger
type LastConfigMetadata ¶
type LastConfigMetadata struct { LastConfigBlockNum uint64 `json:"last_config_block_num,omitempty"` SignatureData *SignatureMetadata `json:"signature_data,omitempty"` }
LastConfigMetadata LastConfigMetadata in json format
type NsReadWriteSet ¶
type NsReadWriteSet struct { Namespace string `json: "namespace,omitempty"` KVRWSet *kvrwset.KVRWSet `json: "kVRWSet,omitempty"` }
NsReadWriteSet NsReadWriteSet in json format
type OrdererMetadata ¶
type OrdererMetadata struct { LastOffsetPersisted uint64 `json:"last_offset_persisted,omitempty"` SignatureData *SignatureMetadata `json:"signature_data,omitempty"` }
OrdererMetadata OrdererMetadata in json format
type SignatureHeader ¶
type SignatureHeader struct { Certificate *x509.Certificate Nonce []byte `json:"nonce,omitempty"` }
SignatureHeader SignatureHeader in json format
type SignatureMetadata ¶
type SignatureMetadata struct { SignatureHeader *SignatureHeader `json:"signature_header,omitempty"` Signature []byte `json:"signature,omitempty"` }
SignatureMetadata SignatureMetadata in json format
type Transaction ¶
type Transaction struct { Signature []byte `json:"signature,omitempty"` ChannelHeader *ChannelHeader `json:"channel_header,omitempty"` SignatureHeader *SignatureHeader `json:"signature_header,omitempty"` TxActionSignatureHeader *SignatureHeader `json:"tx_action_signature_header,omitempty"` ChaincodeSpec *ChaincodeSpec `json:"chaincode_spec,omitempty"` Endorsements []*Endorsement `json:"endorsements,omitempty"` ProposalHash []byte `json:"proposal_hash,omitempty"` Events *pb.ChaincodeEvent `json:"events,omitempty"` Response *pb.Response `json:"response,omitempty"` NsRwset []*NsReadWriteSet `json:"ns_read_write_Set,omitempty"` // Capture transaction validation code ValidationCode uint8 `json:"validation_code"` ValidationCodeName string `json:"validation_code_name,omitempty"` }
Transaction Transaction in json format