sdkfabric

package
v0.0.0-...-1a1319b Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHosts

func AddHosts(hostName string, ip string) bool

func GenerateAllCfg

func GenerateAllCfg(netCfg public.DeployNetConfig, p GenerateParaSt) (string, error)

func GenerateCfg

func GenerateCfg(netCfg public.DeployNetConfig, p GenerateParaSt) (string, error)

func GenerateOrgCfg

func GenerateOrgCfg(netCfg public.DeployNetConfig, p GenerateParaSt) (string, error)

func LoadChainCfg

func LoadChainCfg(chainId string) (public.DeployPara, error)

func Prettyprint

func Prettyprint(b []byte) ([]byte, error)

Prettyprint print json

func ReWriteFileLine

func ReWriteFileLine(filePath string, content []string) bool

func ReadFileLine

func ReadFileLine(filePath string) (bool, []string)

func ReadFileLine2

func ReadFileLine2(filePath string) (bool, []string)

func UpdateAddOrgAllCfg

func UpdateAddOrgAllCfg(netCfg public.DeployNetConfig, p GenerateParaSt, chList public.ChannelList) (string, error)

func UpdateAddOrgCfg

func UpdateAddOrgCfg(netCfg public.DeployNetConfig, p GenerateParaSt, chList public.ChannelList) (string, error)

func UpdateChannelCfg

func UpdateChannelCfg(netCfg public.DeployNetConfig, p GenerateParaSt) (string, error)

func UpdateOrgCfg

func UpdateOrgCfg(netCfg public.DeployNetConfig, p GenerateParaSt, chList public.ChannelList) (string, error)

Types

type BCCSPSt

type BCCSPSt struct {
	Security SecuritySt `json:"security"`
}

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 BlockInfo

type BlockInfo struct {
	Header struct {
		Number       int    `json:"number"`
		PreviousHash string `json:"previous_hash"`
		DataHash     string `json:"data_hash"`
	} `json:"header"`
	Transactions []struct {
		Signature     string `json:"signature"`
		ChannelHeader struct {
			Type        int    `json:"type"`
			ChannelID   string `json:"channel_id"`
			TxID        string `json:"tx_id"`
			ChaincodeID struct {
				Name string `json:"name"`
			} `json:"chaincode_id"`
		} `json:"channel_header"`
		SignatureHeader struct {
			Certificate struct {
				Raw                     string `json:"Raw"`
				RawTBSCertificate       string `json:"RawTBSCertificate"`
				RawSubjectPublicKeyInfo string `json:"RawSubjectPublicKeyInfo"`
				RawSubject              string `json:"RawSubject"`
				RawIssuer               string `json:"RawIssuer"`
				Signature               string `json:"Signature"`
				SignatureAlgorithm      int    `json:"SignatureAlgorithm"`
				PublicKeyAlgorithm      int    `json:"PublicKeyAlgorithm"`
				PublicKey               struct {
					Curve struct {
						P       int64  `json:"P"`
						N       int64  `json:"N"`
						B       int64  `json:"B"`
						Gx      int64  `json:"Gx"`
						Gy      int64  `json:"Gy"`
						BitSize int    `json:"BitSize"`
						Name    string `json:"Name"`
					} `json:"Curve"`
					X int64 `json:"X"`
					Y int64 `json:"Y"`
				} `json:"PublicKey"`
				Version      int   `json:"Version"`
				SerialNumber int64 `json:"SerialNumber"`
				Issuer       struct {
					Country            []string    `json:"Country"`
					Organization       []string    `json:"Organization"`
					OrganizationalUnit interface{} `json:"OrganizationalUnit"`
					Locality           []string    `json:"Locality"`
					Province           []string    `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Issuer"`
				Subject struct {
					Country            interface{} `json:"Country"`
					Organization       interface{} `json:"Organization"`
					OrganizationalUnit []string    `json:"OrganizationalUnit"`
					Locality           interface{} `json:"Locality"`
					Province           interface{} `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Subject"`
				NotBefore  time.Time `json:"NotBefore"`
				NotAfter   time.Time `json:"NotAfter"`
				KeyUsage   int       `json:"KeyUsage"`
				Extensions []struct {
					ID       []int  `json:"Id"`
					Critical bool   `json:"Critical"`
					Value    string `json:"Value"`
				} `json:"Extensions"`
				ExtraExtensions             interface{} `json:"ExtraExtensions"`
				UnhandledCriticalExtensions interface{} `json:"UnhandledCriticalExtensions"`
				ExtKeyUsage                 interface{} `json:"ExtKeyUsage"`
				UnknownExtKeyUsage          interface{} `json:"UnknownExtKeyUsage"`
				BasicConstraintsValid       bool        `json:"BasicConstraintsValid"`
				IsCA                        bool        `json:"IsCA"`
				MaxPathLen                  int         `json:"MaxPathLen"`
				MaxPathLenZero              bool        `json:"MaxPathLenZero"`
				SubjectKeyID                string      `json:"SubjectKeyId"`
				AuthorityKeyID              string      `json:"AuthorityKeyId"`
				OCSPServer                  interface{} `json:"OCSPServer"`
				IssuingCertificateURL       interface{} `json:"IssuingCertificateURL"`
				DNSNames                    []string    `json:"DNSNames"`
				EmailAddresses              interface{} `json:"EmailAddresses"`
				IPAddresses                 interface{} `json:"IPAddresses"`
				URIs                        interface{} `json:"URIs"`
				PermittedDNSDomainsCritical bool        `json:"PermittedDNSDomainsCritical"`
				PermittedDNSDomains         interface{} `json:"PermittedDNSDomains"`
				ExcludedDNSDomains          interface{} `json:"ExcludedDNSDomains"`
				PermittedIPRanges           interface{} `json:"PermittedIPRanges"`
				ExcludedIPRanges            interface{} `json:"ExcludedIPRanges"`
				PermittedEmailAddresses     interface{} `json:"PermittedEmailAddresses"`
				ExcludedEmailAddresses      interface{} `json:"ExcludedEmailAddresses"`
				PermittedURIDomains         interface{} `json:"PermittedURIDomains"`
				ExcludedURIDomains          interface{} `json:"ExcludedURIDomains"`
				CRLDistributionPoints       interface{} `json:"CRLDistributionPoints"`
				PolicyIdentifiers           interface{} `json:"PolicyIdentifiers"`
			} `json:"Certificate"`
			Nonce string `json:"nonce"`
		} `json:"signature_header"`
		TxActionSignatureHeader struct {
			Certificate struct {
				Raw                     string `json:"Raw"`
				RawTBSCertificate       string `json:"RawTBSCertificate"`
				RawSubjectPublicKeyInfo string `json:"RawSubjectPublicKeyInfo"`
				RawSubject              string `json:"RawSubject"`
				RawIssuer               string `json:"RawIssuer"`
				Signature               string `json:"Signature"`
				SignatureAlgorithm      int    `json:"SignatureAlgorithm"`
				PublicKeyAlgorithm      int    `json:"PublicKeyAlgorithm"`
				PublicKey               struct {
					Curve struct {
						P       int64  `json:"P"`
						N       int64  `json:"N"`
						B       int64  `json:"B"`
						Gx      int64  `json:"Gx"`
						Gy      int64  `json:"Gy"`
						BitSize int    `json:"BitSize"`
						Name    string `json:"Name"`
					} `json:"Curve"`
					X int64 `json:"X"`
					Y int64 `json:"Y"`
				} `json:"PublicKey"`
				Version      int   `json:"Version"`
				SerialNumber int64 `json:"SerialNumber"`
				Issuer       struct {
					Country            []string    `json:"Country"`
					Organization       []string    `json:"Organization"`
					OrganizationalUnit interface{} `json:"OrganizationalUnit"`
					Locality           []string    `json:"Locality"`
					Province           []string    `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Issuer"`
				Subject struct {
					Country            interface{} `json:"Country"`
					Organization       interface{} `json:"Organization"`
					OrganizationalUnit []string    `json:"OrganizationalUnit"`
					Locality           interface{} `json:"Locality"`
					Province           interface{} `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Subject"`
				NotBefore  time.Time `json:"NotBefore"`
				NotAfter   time.Time `json:"NotAfter"`
				KeyUsage   int       `json:"KeyUsage"`
				Extensions []struct {
					ID       []int  `json:"Id"`
					Critical bool   `json:"Critical"`
					Value    string `json:"Value"`
				} `json:"Extensions"`
				ExtraExtensions             interface{} `json:"ExtraExtensions"`
				UnhandledCriticalExtensions interface{} `json:"UnhandledCriticalExtensions"`
				ExtKeyUsage                 interface{} `json:"ExtKeyUsage"`
				UnknownExtKeyUsage          interface{} `json:"UnknownExtKeyUsage"`
				BasicConstraintsValid       bool        `json:"BasicConstraintsValid"`
				IsCA                        bool        `json:"IsCA"`
				MaxPathLen                  int         `json:"MaxPathLen"`
				MaxPathLenZero              bool        `json:"MaxPathLenZero"`
				SubjectKeyID                string      `json:"SubjectKeyId"`
				AuthorityKeyID              string      `json:"AuthorityKeyId"`
				OCSPServer                  interface{} `json:"OCSPServer"`
				IssuingCertificateURL       interface{} `json:"IssuingCertificateURL"`
				DNSNames                    []string    `json:"DNSNames"`
				EmailAddresses              interface{} `json:"EmailAddresses"`
				IPAddresses                 interface{} `json:"IPAddresses"`
				URIs                        interface{} `json:"URIs"`
				PermittedDNSDomainsCritical bool        `json:"PermittedDNSDomainsCritical"`
				PermittedDNSDomains         interface{} `json:"PermittedDNSDomains"`
				ExcludedDNSDomains          interface{} `json:"ExcludedDNSDomains"`
				PermittedIPRanges           interface{} `json:"PermittedIPRanges"`
				ExcludedIPRanges            interface{} `json:"ExcludedIPRanges"`
				PermittedEmailAddresses     interface{} `json:"PermittedEmailAddresses"`
				ExcludedEmailAddresses      interface{} `json:"ExcludedEmailAddresses"`
				PermittedURIDomains         interface{} `json:"PermittedURIDomains"`
				ExcludedURIDomains          interface{} `json:"ExcludedURIDomains"`
				CRLDistributionPoints       interface{} `json:"CRLDistributionPoints"`
				PolicyIdentifiers           interface{} `json:"PolicyIdentifiers"`
			} `json:"Certificate"`
			Nonce string `json:"nonce"`
		} `json:"tx_action_signature_header"`
		ChaincodeSpec struct {
			Type        int `json:"type"`
			ChaincodeID struct {
				Name string `json:"name"`
			} `json:"chaincode_id"`
			Input struct {
				Args []string `json:"Args"`
			} `json:"input"`
		} `json:"chaincode_spec"`
		Endorsements []struct {
			SignatureHeader struct {
				Certificate interface{} `json:"Certificate"`
				Nonce       string      `json:"nonce"`
			} `json:"signature_header"`
			Signature string `json:"signature"`
		} `json:"endorsements"`
		ProposalHash string `json:"proposal_hash"`
		Events       struct {
		} `json:"events"`
		Response struct {
			Status int `json:"status"`
		} `json:"response"`
		NsReadWriteSet []struct {
			Namespace string `json:"Namespace"`
			KVRWSet   struct {
				Reads []struct {
					Key     string `json:"key"`
					Version struct {
						BlockNum int `json:"block_num"`
					} `json:"version"`
				} `json:"reads"`
				Writes []struct {
					Key   string `json:"key"`
					Value string `json:"value"`
				} `json:"writes"`
			} `json:"KVRWSet"`
		} `json:"ns_read_write_Set"`
		ValidationCode     int    `json:"validation_code"`
		ValidationCodeName string `json:"validation_code_name"`
	} `json:"transactions"`
	BlockCreatorSignature struct {
		SignatureHeader struct {
			Certificate struct {
				Raw                     string `json:"Raw"`
				RawTBSCertificate       string `json:"RawTBSCertificate"`
				RawSubjectPublicKeyInfo string `json:"RawSubjectPublicKeyInfo"`
				RawSubject              string `json:"RawSubject"`
				RawIssuer               string `json:"RawIssuer"`
				Signature               string `json:"Signature"`
				SignatureAlgorithm      int    `json:"SignatureAlgorithm"`
				PublicKeyAlgorithm      int    `json:"PublicKeyAlgorithm"`
				PublicKey               struct {
					Curve struct {
						P       int64  `json:"P"`
						N       int64  `json:"N"`
						B       int64  `json:"B"`
						Gx      int64  `json:"Gx"`
						Gy      int64  `json:"Gy"`
						BitSize int    `json:"BitSize"`
						Name    string `json:"Name"`
					} `json:"Curve"`
					X int64 `json:"X"`
					Y int64 `json:"Y"`
				} `json:"PublicKey"`
				Version      int   `json:"Version"`
				SerialNumber int64 `json:"SerialNumber"`
				Issuer       struct {
					Country            []string    `json:"Country"`
					Organization       []string    `json:"Organization"`
					OrganizationalUnit interface{} `json:"OrganizationalUnit"`
					Locality           []string    `json:"Locality"`
					Province           []string    `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Issuer"`
				Subject struct {
					Country            []string    `json:"Country"`
					Organization       interface{} `json:"Organization"`
					OrganizationalUnit interface{} `json:"OrganizationalUnit"`
					Locality           []string    `json:"Locality"`
					Province           []string    `json:"Province"`
					StreetAddress      interface{} `json:"StreetAddress"`
					PostalCode         interface{} `json:"PostalCode"`
					SerialNumber       string      `json:"SerialNumber"`
					CommonName         string      `json:"CommonName"`
					Names              []struct {
						Type  []int  `json:"Type"`
						Value string `json:"Value"`
					} `json:"Names"`
					ExtraNames interface{} `json:"ExtraNames"`
				} `json:"Subject"`
				NotBefore  time.Time `json:"NotBefore"`
				NotAfter   time.Time `json:"NotAfter"`
				KeyUsage   int       `json:"KeyUsage"`
				Extensions []struct {
					ID       []int  `json:"Id"`
					Critical bool   `json:"Critical"`
					Value    string `json:"Value"`
				} `json:"Extensions"`
				ExtraExtensions             interface{} `json:"ExtraExtensions"`
				UnhandledCriticalExtensions interface{} `json:"UnhandledCriticalExtensions"`
				ExtKeyUsage                 interface{} `json:"ExtKeyUsage"`
				UnknownExtKeyUsage          interface{} `json:"UnknownExtKeyUsage"`
				BasicConstraintsValid       bool        `json:"BasicConstraintsValid"`
				IsCA                        bool        `json:"IsCA"`
				MaxPathLen                  int         `json:"MaxPathLen"`
				MaxPathLenZero              bool        `json:"MaxPathLenZero"`
				SubjectKeyID                interface{} `json:"SubjectKeyId"`
				AuthorityKeyID              string      `json:"AuthorityKeyId"`
				OCSPServer                  interface{} `json:"OCSPServer"`
				IssuingCertificateURL       interface{} `json:"IssuingCertificateURL"`
				DNSNames                    interface{} `json:"DNSNames"`
				EmailAddresses              interface{} `json:"EmailAddresses"`
				IPAddresses                 interface{} `json:"IPAddresses"`
				URIs                        interface{} `json:"URIs"`
				PermittedDNSDomainsCritical bool        `json:"PermittedDNSDomainsCritical"`
				PermittedDNSDomains         interface{} `json:"PermittedDNSDomains"`
				ExcludedDNSDomains          interface{} `json:"ExcludedDNSDomains"`
				PermittedIPRanges           interface{} `json:"PermittedIPRanges"`
				ExcludedIPRanges            interface{} `json:"ExcludedIPRanges"`
				PermittedEmailAddresses     interface{} `json:"PermittedEmailAddresses"`
				ExcludedEmailAddresses      interface{} `json:"ExcludedEmailAddresses"`
				PermittedURIDomains         interface{} `json:"PermittedURIDomains"`
				ExcludedURIDomains          interface{} `json:"ExcludedURIDomains"`
				CRLDistributionPoints       interface{} `json:"CRLDistributionPoints"`
				PolicyIdentifiers           interface{} `json:"PolicyIdentifiers"`
			} `json:"Certificate"`
			Nonce string `json:"nonce"`
		} `json:"signature_header"`
		Signature string `json:"signature"`
	} `json:"block_creator_signature"`
	LastConfigBlockNumber struct {
		SignatureData struct {
			SignatureHeader struct {
				Certificate struct {
					Raw                     string `json:"Raw"`
					RawTBSCertificate       string `json:"RawTBSCertificate"`
					RawSubjectPublicKeyInfo string `json:"RawSubjectPublicKeyInfo"`
					RawSubject              string `json:"RawSubject"`
					RawIssuer               string `json:"RawIssuer"`
					Signature               string `json:"Signature"`
					SignatureAlgorithm      int    `json:"SignatureAlgorithm"`
					PublicKeyAlgorithm      int    `json:"PublicKeyAlgorithm"`
					PublicKey               struct {
						Curve struct {
							P       int64  `json:"P"`
							N       int64  `json:"N"`
							B       int64  `json:"B"`
							Gx      int64  `json:"Gx"`
							Gy      int64  `json:"Gy"`
							BitSize int    `json:"BitSize"`
							Name    string `json:"Name"`
						} `json:"Curve"`
						X int64 `json:"X"`
						Y int64 `json:"Y"`
					} `json:"PublicKey"`
					Version      int   `json:"Version"`
					SerialNumber int64 `json:"SerialNumber"`
					Issuer       struct {
						Country            []string    `json:"Country"`
						Organization       []string    `json:"Organization"`
						OrganizationalUnit interface{} `json:"OrganizationalUnit"`
						Locality           []string    `json:"Locality"`
						Province           []string    `json:"Province"`
						StreetAddress      interface{} `json:"StreetAddress"`
						PostalCode         interface{} `json:"PostalCode"`
						SerialNumber       string      `json:"SerialNumber"`
						CommonName         string      `json:"CommonName"`
						Names              []struct {
							Type  []int  `json:"Type"`
							Value string `json:"Value"`
						} `json:"Names"`
						ExtraNames interface{} `json:"ExtraNames"`
					} `json:"Issuer"`
					Subject struct {
						Country            []string    `json:"Country"`
						Organization       interface{} `json:"Organization"`
						OrganizationalUnit interface{} `json:"OrganizationalUnit"`
						Locality           []string    `json:"Locality"`
						Province           []string    `json:"Province"`
						StreetAddress      interface{} `json:"StreetAddress"`
						PostalCode         interface{} `json:"PostalCode"`
						SerialNumber       string      `json:"SerialNumber"`
						CommonName         string      `json:"CommonName"`
						Names              []struct {
							Type  []int  `json:"Type"`
							Value string `json:"Value"`
						} `json:"Names"`
						ExtraNames interface{} `json:"ExtraNames"`
					} `json:"Subject"`
					NotBefore  time.Time `json:"NotBefore"`
					NotAfter   time.Time `json:"NotAfter"`
					KeyUsage   int       `json:"KeyUsage"`
					Extensions []struct {
						ID       []int  `json:"Id"`
						Critical bool   `json:"Critical"`
						Value    string `json:"Value"`
					} `json:"Extensions"`
					ExtraExtensions             interface{} `json:"ExtraExtensions"`
					UnhandledCriticalExtensions interface{} `json:"UnhandledCriticalExtensions"`
					ExtKeyUsage                 interface{} `json:"ExtKeyUsage"`
					UnknownExtKeyUsage          interface{} `json:"UnknownExtKeyUsage"`
					BasicConstraintsValid       bool        `json:"BasicConstraintsValid"`
					IsCA                        bool        `json:"IsCA"`
					MaxPathLen                  int         `json:"MaxPathLen"`
					MaxPathLenZero              bool        `json:"MaxPathLenZero"`
					SubjectKeyID                interface{} `json:"SubjectKeyId"`
					AuthorityKeyID              string      `json:"AuthorityKeyId"`
					OCSPServer                  interface{} `json:"OCSPServer"`
					IssuingCertificateURL       interface{} `json:"IssuingCertificateURL"`
					DNSNames                    interface{} `json:"DNSNames"`
					EmailAddresses              interface{} `json:"EmailAddresses"`
					IPAddresses                 interface{} `json:"IPAddresses"`
					URIs                        interface{} `json:"URIs"`
					PermittedDNSDomainsCritical bool        `json:"PermittedDNSDomainsCritical"`
					PermittedDNSDomains         interface{} `json:"PermittedDNSDomains"`
					ExcludedDNSDomains          interface{} `json:"ExcludedDNSDomains"`
					PermittedIPRanges           interface{} `json:"PermittedIPRanges"`
					ExcludedIPRanges            interface{} `json:"ExcludedIPRanges"`
					PermittedEmailAddresses     interface{} `json:"PermittedEmailAddresses"`
					ExcludedEmailAddresses      interface{} `json:"ExcludedEmailAddresses"`
					PermittedURIDomains         interface{} `json:"PermittedURIDomains"`
					ExcludedURIDomains          interface{} `json:"ExcludedURIDomains"`
					CRLDistributionPoints       interface{} `json:"CRLDistributionPoints"`
					PolicyIdentifiers           interface{} `json:"PolicyIdentifiers"`
				} `json:"Certificate"`
				Nonce string `json:"nonce"`
			} `json:"signature_header"`
			Signature string `json:"signature"`
		} `json:"signature_data"`
	} `json:"last_config_block_number"`
	TransactionFilter    string `json:"transaction_filter"`
	OrdererKafkaMetadata struct {
		LastOffsetPersisted int64 `json:"last_offset_persisted"`
	} `json:"orderer_kafka_metadata"`
}

type CCInvokeResult

type CCInvokeResult struct {
	Proposal struct {
		TxnID   string `json:"TxnID"`
		Header  string `json:"header"`
		Payload string `json:"payload"`
	} `json:"Proposal"`
	Responses []struct {
		Endorser        string `json:"Endorser"`
		Status          int    `json:"Status"`
		ChaincodeStatus int    `json:"ChaincodeStatus"`
		Version         int    `json:"version"`
		Response        struct {
			Status int `json:"status"`
		} `json:"response"`
		Payload     string `json:"payload"`
		Endorsement struct {
			Endorser  string `json:"endorser"`
			Signature string `json:"signature"`
		} `json:"endorsement"`
	} `json:"Responses"`
	TransactionID    string      `json:"TransactionID"`
	TxValidationCode int         `json:"TxValidationCode"`
	ChaincodeStatus  int         `json:"ChaincodeStatus"`
	Payload          interface{} `json:"Payload"`
}

type CaField

type CaField struct {
	URL         string        `json:"url"`
	HTTPOptions HTTPOptionsSt `json:"httpOptions"`
	Registrar   RegistrarSt   `json:"registrar"`
	CaName      string        `json:"caName"`
	TLSCACerts  TLSCACertsSt  `json:"tlsCACerts"`
}

type ChainInfo

type ChainInfo struct {
	Height            uint64
	CurrentBlockHash  string
	PreviousBlockHash string
}

type ChaincodeInput

type ChaincodeInput struct {
	Args []string
}

ChaincodeInput ChaincodeInput in json format

type ChaincodeSetup

type ChaincodeSetup struct {
	ChainCodeID      string
	ChaincodeVersion string
	ChaincodeGoPath  string
	ChaincodePath    string
	InitOrg          string
	EndorsePolicy    string
	InitArgs         []string
}

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 ChannelField

type ChannelField struct {
	Orderers []string             `json:"orderers"`
	Peers    map[string]PeerField `json:"peers"`
	Policies PoliciesSt           `json:"policies"`
}

type ChannelHeader

type ChannelHeader struct {
	Type        int32                `json:"type,omitempty"`
	Version     int32                `json:"version,omitempty"`
	Timestamp   *timestamp.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 ChannnelSetup

type ChannnelSetup struct {
	ChannelID     string
	ChannelConfig string
}

type ClientCertSt

type ClientCertSt struct {
	Keyfile  string `json:"keyfile"`
	Certfile string `json:"certfile"`
}

type ClientSt

type ClientSt struct {
	Organization    string            `json:"organization"`
	Logging         LoggingSt         `json:"logging"`
	Cryptoconfig    CryptoconfigSt    `json:"cryptoconfig"`
	CredentialStore CredentialStoreSt `json:"credentialStore"`
	BCCSP           BCCSPSt           `json:"BCCSP"`
	TLSCerts        TLSCertsSt        `json:"tlsCerts"`
}

type ClientTLSCertsSt

type ClientTLSCertsSt struct {
	Key  CryptoconfigSt `json:"key"`
	Cert CryptoconfigSt `json:"cert"`
}

type CredentialStoreSt

type CredentialStoreSt struct {
	Path        string        `json:"path"`
	CryptoStore CryptoStoreSt `json:"cryptoStore"`
}

type CryptoStoreSt

type CryptoStoreSt struct {
	Path string `json:"path"`
}

type CryptoconfigSt

type CryptoconfigSt struct {
	Path string `json:"path"`
}

type DefaultSt

type DefaultSt struct {
	Provider string `json:"provider"`
}

type Endorsement

type Endorsement struct {
	SignatureHeader *SignatureHeader `json:"signature_header,omitempty"`
	Signature       []byte           `json:"signature,omitempty"`
}

Endorsement Endorsement in json format

type EntityMatchersSt

type EntityMatchersSt struct {
	Peer                   []MatchFieldSt `json:"peer"`
	Orderer                []MatchFieldSt `json:"orderer"`
	CertificateAuthorities []MatchFieldSt `json:"certificateAuthorities"`
}

type FabricSetup

type FabricSetup struct {
	ConfigFile string
	OrdererID  string
	ChannelId  string
	OrgAdmin   string
	OrgName    string
	Peers      []string
	Sdk        *fabsdk.FabricSDK
	ChClient   *channel.Client
	// contains filtered or unexported fields
}

FabricSetup implementation

func (*FabricSetup) CloseSDK

func (setup *FabricSetup) CloseSDK()

func (*FabricSetup) CreateChannel

func (setup *FabricSetup) CreateChannel(ch ChannnelSetup) error

func (*FabricSetup) ExecuteCC

func (setup *FabricSetup) ExecuteCC(ccId string, fcn string, paras []string, peers []string) ([]byte, error)

func (*FabricSetup) GetRegisteredUser

func (setup *FabricSetup) GetRegisteredUser(userName string, orgName string, secret string, identityTypeUser string) (string, error)

func (*FabricSetup) GetUserClient

func (setup *FabricSetup) GetUserClient(channelName string, userName string, orgName string) (*channel.Client, error)

func (*FabricSetup) Initialize

func (setup *FabricSetup) Initialize(chainId string) error

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

func (*FabricSetup) Initialize2

func (setup *FabricSetup) Initialize2() error

func (*FabricSetup) InstallCC

func (setup *FabricSetup) InstallCC(cc ChaincodeSetup) error

func (*FabricSetup) InstantiateCC

func (setup *FabricSetup) InstantiateCC(ch ChannnelSetup, cc ChaincodeSetup) error

func (*FabricSetup) JoinChannel

func (setup *FabricSetup) JoinChannel(ch ChannnelSetup) error

func (*FabricSetup) QueryBlockById

func (setup *FabricSetup) QueryBlockById(userName string, blockId uint64, peer string) (interface{}, error)

query block by block number

func (*FabricSetup) QueryCC

func (setup *FabricSetup) QueryCC(ccId string, fcn string, paras []string, peer string) ([]byte, error)

query chaincode

func (*FabricSetup) QueryChainInfo

func (setup *FabricSetup) QueryChainInfo(usrName string, peer string) (interface{}, error)

Query blockchain info

func (*FabricSetup) QueryChannels

func (setup *FabricSetup) QueryChannels(peer string) (interface{}, error)

QueryChannels query channels

func (*FabricSetup) QueryInstalledChaincodes

func (setup *FabricSetup) QueryInstalledChaincodes(peer string) (interface{}, error)

QueryInstalledChaincodes query installed chaincode

func (*FabricSetup) QueryInstantiatedChaincodes

func (setup *FabricSetup) QueryInstantiatedChaincodes(peer string) (interface{}, error)

QueryInstantiatedChaincodes query instantiated chaincode

func (*FabricSetup) QueryTransactionByID

func (setup *FabricSetup) QueryTransactionByID(userName string, txId string, peer string) (interface{}, error)

get transaction by transaction ID

func (*FabricSetup) SetupCA

func (setup *FabricSetup) SetupCA(orgName string) error

func (*FabricSetup) UpgradeCC

func (setup *FabricSetup) UpgradeCC(ch ChannnelSetup, cc ChaincodeSetup) error

type GenerateParaSt

type GenerateParaSt struct {
	ClusterId   string
	NamespaceId string
	BlockId     string
	OrgName     string
	ChannelName string
}

type GrpcOptionsSt

type GrpcOptionsSt struct {
	SslTargetNameOverride string `json:"ssl-target-name-override"`
	KeepAliveTime         string `json:"keep-alive-time"`
	KeepAliveTimeout      string `json:"keep-alive-timeout"`
	KeepAlivePermit       bool   `json:"keep-alive-permit"`
	FailFast              bool   `json:"fail-fast"`
	AllowInsecure         bool   `json:"allow-insecure"`
}

type HTTPOptionsSt

type HTTPOptionsSt struct {
	Verify bool `json:"verify"`
}

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 LoggingSt

type LoggingSt struct {
	Level string `json:"level"`
}

type MatchFieldSt

type MatchFieldSt struct {
	Pattern                             string `json:"pattern,omitempty"`
	URLSubstitutionExp                  string `json:"urlSubstitutionExp,omitempty"`
	EventURLSubstitutionExp             string `json:"eventUrlSubstitutionExp,omitempty"`
	SslTargetOverrideURLSubstitutionExp string `json:"sslTargetOverrideUrlSubstitutionExp,omitempty"`
	MappedHost                          string `json:"mappedHost,omitempty"`
}

type MemberField

type MemberField struct {
	URL         string        `json:"url"`
	EventURL    string        `json:"eventUrl,omitempty"`
	GrpcOptions GrpcOptionsSt `json:"grpcOptions"`
	TLSCACerts  TLSCACertsSt  `json:"tlsCACerts"`
}

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 OrgField

type OrgField struct {
	Mspid                  string   `json:"mspid"`
	CryptoPath             string   `json:"cryptoPath"`
	Peers                  []string `json:"peers,omitempty"`
	CertificateAuthorities []string `json:"certificateAuthorities,omitempty"`
}

type PeerField

type PeerField struct {
	EndorsingPeer  bool `json:"endorsingPeer"`
	ChaincodeQuery bool `json:"chaincodeQuery"`
	LedgerQuery    bool `json:"ledgerQuery"`
	EventSource    bool `json:"eventSource"`
}

type PoliciesSt

type PoliciesSt struct {
	QueryChannelConfig QueryChannelConfigSt `json:"queryChannelConfig"`
}

type QueryChannelConfigSt

type QueryChannelConfigSt struct {
	MinResponses int         `json:"minResponses"`
	MaxTargets   int         `json:"maxTargets"`
	RetryOpts    RetryOptsSt `json:"retryOpts"`
}

type RegistrarSt

type RegistrarSt struct {
	EnrollID     string `json:"enrollId"`
	EnrollSecret string `json:"enrollSecret"`
}

type RetryOptsSt

type RetryOptsSt struct {
	Attempts       int     `json:"attempts"`
	InitialBackoff string  `json:"initialBackoff"`
	MaxBackoff     string  `json:"maxBackoff"`
	BackoffFactor  float64 `json:"backoffFactor"`
}

type SdkFabricCfg

type SdkFabricCfg struct {
	Name                   string                  `json:"name"`
	Version                string                  `json:"version"`
	Client                 ClientSt                `json:"client"`
	Channels               map[string]ChannelField `json:"channels"`
	Organizations          map[string]OrgField     `json:"organizations"`
	Orderers               map[string]MemberField  `json:"orderers"`
	Peers                  map[string]MemberField  `json:"peers"`
	CertificateAuthorities map[string]CaField      `json:"certificateAuthorities"`
	EntityMatchers         EntityMatchersSt        `json:"entityMatchers"`
}

type SecuritySt

type SecuritySt struct {
	Enabled       bool      `json:"enabled"`
	Default       DefaultSt `json:"default"`
	HashAlgorithm string    `json:"hashAlgorithm"`
	SoftVerify    bool      `json:"softVerify"`
	Level         int       `json:"level"`
}

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 TLSCACertsSt

type TLSCACertsSt struct {
	Path   string           `json:"path"`
	Client ClientTLSCertsSt `json:"client,omitempty"`
}

type TLSCertsSt

type TLSCertsSt struct {
	SystemCertPool bool             `json:"systemCertPool"`
	Client         ClientTLSCertsSt `json:"client,omitempty"`
}

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

type UserClient

type UserClient struct {
	Secret            string
	IdentityTypeUser  string
	RegistrarUserName string
	RegistrarPassword string
}

Jump to

Keyboard shortcuts

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