Documentation ¶
Index ¶
- Constants
- func AsBytes(args []string) [][]byte
- func ConvertPrivateKeyToBase58Check(privateKey ed25519.PrivateKey) string
- func ConvertPublicKeyToBase58(publicKey ed25519.PublicKey) string
- func ConvertSignatureToBase58(publicKey []byte) string
- func EncodedPrivKeyToEd25519(secretKey string) (ed25519.PrivateKey, ed25519.PublicKey, error)
- func GenerateMessage(validatorPublicKeys []string, channelID string, chaincodeName string, ...) string
- func GeneratePrivateAndPublicKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GeneratePrivateKey() (string, error)
- func GetAddress(secretKey string) (string, error)
- func GetAddressByPublicKey(publicKey ed25519.PublicKey) (string, error)
- func GetBase58PubKey(secretKey string) (string, error)
- func GetNonce() string
- func GetNonceInt64() int64
- func GetPrivateKeySKFromBase58(secretKey string) (ed25519.PrivateKey, ed25519.PublicKey, error)
- func GetPrivateKeySKFromBase58Check(secretKey string) (ed25519.PrivateKey, ed25519.PublicKey, error)
- func GetPrivateKeySKFromHex(secretKey string) (ed25519.PrivateKey, ed25519.PublicKey, error)
- func NowMillisecond() int64
- func Sign(privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey, channel string, ...) ([]string, string, error)
- func SignACL(signerInfoArray []SignerInfo, methodName string, address string, reason string, ...) ([]string, string, error)
- func SignMessage(signerInfo SignerInfo, result []string) ([]byte, [32]byte, error)
- type HLFClient
- func (hlf *HLFClient) AddAfterInvokeHandler(afterInvokeHandler HlfAfterInvokeHandler)
- func (hlf *HLFClient) AddBeforeInvokeHandler(beforeInvokeHandler HlfBeforeInvokeHandler)
- func (hlf *HLFClient) AddChannel(channelID string, events ...string) error
- func (hlf *HLFClient) AddFabsdk(configProvider core2.ConfigProvider, opts ...fabsdk.Option) error
- func (hlf *HLFClient) ChaincodeVersion(chaincode string, peer string) (string, error)
- func (hlf *HLFClient) ChaincodeVersion14(client *resmgmt.Client, chaincode string, peer string) (string, error)
- func (hlf *HLFClient) ChaincodeVersion23Lifecycle(client *resmgmt.Client, chaincode string, peer string) (string, error)
- func (hlf *HLFClient) GetBlockchainInfo(channelID string, peer string) (*fab.BlockchainInfoResponse, error)
- func (hlf *HLFClient) GetCCEventNotifier(client *channel.Client, chaincodeName string, event string) (<-chan *fab.CCEvent, error)
- func (hlf *HLFClient) GetTransactionByID(channelID string, transactionID string, peer string) (*peer.ProcessedTransaction, error)
- func (hlf *HLFClient) Invoke(channelID string, chaincodeName string, methodName string, methodArgs []string, ...) (*channel.Response, error)
- func (hlf *HLFClient) InvokeWithPublicAndPrivateKey(privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey, channelID string, ...) (*channel.Response, error)
- func (hlf *HLFClient) InvokeWithSecretKey(channelID string, chaincodeName string, methodName string, methodArgs []string, ...) (*channel.Response, error)
- func (hlf *HLFClient) Query(channelID string, chaincodeName string, methodName string, methodArgs []string) (*channel.Response, error)
- func (hlf *HLFClient) QueryBlock(channelID string, blockID string, endpoints string) (*common.Block, error)
- func (hlf *HLFClient) QueryBlockByTxID(channelID string, transactionID string, peer string) (*common.Block, error)
- func (hlf *HLFClient) Request(methodArgs []string, chaincodeName string, methodName string, noBatch bool, ...) (*channel.Response, error)
- func (hlf *HLFClient) SignArgs(channelID string, chaincodeName string, methodName string, methodArgs []string, ...) ([]string, error)
- type HlfAfterInvokeHandler
- type HlfBeforeInvokeHandler
- type SignerInfo
Constants ¶
const ( KeyEvent = "key" BatchExecuteEvent = "batchExecute" )
Variables ¶
This section is empty.
Functions ¶
func ConvertPrivateKeyToBase58Check ¶
func ConvertPrivateKeyToBase58Check(privateKey ed25519.PrivateKey) string
ConvertPrivateKeyToBase58Check - use privateKey with standard encoded type - Base58Check
func ConvertPublicKeyToBase58 ¶
ConvertPublicKeyToBase58 - use publicKey with standard encoded type - Base58
func ConvertSignatureToBase58 ¶
ConvertSignatureToBase58 - use signature with standard encoded type - Base58
func EncodedPrivKeyToEd25519 ¶
EncodedPrivKeyToEd25519 - get private key type Ed25519 by encoded private key in string secretKey string - private key in base58check, base58 or hex
func GenerateMessage ¶
func GeneratePrivateAndPublicKey ¶
func GeneratePrivateAndPublicKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
func GeneratePrivateKey ¶
func GetAddress ¶
GetAddress - get address by encoded string in standard encoded for project is 'base58.Check' secretKey string - private key in base58check, or hex or base58
func GetAddressByPublicKey ¶
GetAddressByPublicKey - get address by encoded string in standard encoded for project is 'base58.Check' secretKey string - private key in base58check, or hex or base58
func GetBase58PubKey ¶
GetBase58PubKey returns base58-encoded pubkey. secretKey string - private key in base58check, or hex or base58
func GetNonceInt64 ¶
func GetNonceInt64() int64
func GetPrivateKeySKFromBase58 ¶
GetPrivateKeySKFromBase58 - get private key type Ed25519 by string - Base58 encoded private key secretKey string - private key in Base58
func GetPrivateKeySKFromBase58Check ¶
func GetPrivateKeySKFromBase58Check(secretKey string) (ed25519.PrivateKey, ed25519.PublicKey, error)
GetPrivateKeySKFromBase58Check - get private key type Ed25519 by string - Base58Check encoded private key secretKey string - private key in Base58Check
func GetPrivateKeySKFromHex ¶
GetPrivateKeySKFromHex - get private key type Ed25519 by string - hex encoded private key secretKey string - private key in hex
func NowMillisecond ¶
func NowMillisecond() int64
func SignMessage ¶
func SignMessage(signerInfo SignerInfo, result []string) ([]byte, [32]byte, error)
Types ¶
type HLFClient ¶
type HLFClient struct { NotifierChaincodeEvents map[string]<-chan *fab.CCEvent ContextOptions []fabsdk.ContextOption // contains filtered or unexported fields }
func (*HLFClient) AddAfterInvokeHandler ¶
func (hlf *HLFClient) AddAfterInvokeHandler(afterInvokeHandler HlfAfterInvokeHandler)
func (*HLFClient) AddBeforeInvokeHandler ¶
func (hlf *HLFClient) AddBeforeInvokeHandler(beforeInvokeHandler HlfBeforeInvokeHandler)
func (*HLFClient) AddChannel ¶
func (*HLFClient) ChaincodeVersion ¶
ChaincodeVersion - only for admin user, get version for chaincode, firstly try to get version for 1.4, secondly try to get for 2.3 lifecycle
func (*HLFClient) ChaincodeVersion14 ¶
func (hlf *HLFClient) ChaincodeVersion14(client *resmgmt.Client, chaincode string, peer string) (string, error)
ChaincodeVersion14 - only for admin user, get version for chaincode for 1.4 hlf
func (*HLFClient) ChaincodeVersion23Lifecycle ¶
func (hlf *HLFClient) ChaincodeVersion23Lifecycle(client *resmgmt.Client, chaincode string, peer string) (string, error)
ChaincodeVersion23Lifecycle - only for admin user, get version for Committed chaincode for 2.3 hlf - lifecycle
func (*HLFClient) GetBlockchainInfo ¶
func (hlf *HLFClient) GetBlockchainInfo(channelID string, peer string) (*fab.BlockchainInfoResponse, error)
GetBlockchainInfo queries and return information about ledger (height, current block hash, and previous block hash) from peer.
func (*HLFClient) GetCCEventNotifier ¶
func (*HLFClient) GetTransactionByID ¶
func (hlf *HLFClient) GetTransactionByID(channelID string, transactionID string, peer string) (*peer.ProcessedTransaction, error)
GetTransactionByID - return transaction
func (*HLFClient) Invoke ¶
func (hlf *HLFClient) Invoke(channelID string, chaincodeName string, methodName string, methodArgs []string, noBatch bool, peers ...string) (*channel.Response, error)
Invoke - method to sign arguments and send invoke request to hlf channelID string - channel name for invoke chaincodeName string - chaincode name for invoke methodName string - chaincode method name for invoke methodArgs []string - noBatch bool - if wait batchTransaction set 'true' peers string - target peer for invoke, if empty use default peer count by policy
func (*HLFClient) InvokeWithPublicAndPrivateKey ¶
func (hlf *HLFClient) InvokeWithPublicAndPrivateKey(privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey, channelID string, chaincodeName string, methodName string, methodArgs []string, noBatch bool, peers string) (*channel.Response, error)
InvokeWithPublicAndPrivateKey - method to sign arguments and send invoke request to hlf privateKey string - private key in ed25519 publicKey string - private key in ed25519 channelID string - channel name for invoke chaincodeName string - chaincode name for invoke methodName string - chaincode method name for invoke methodArgs []string - noBatch bool - if wait batchTransaction set 'true' peers string - peer0.testnet
func (*HLFClient) InvokeWithSecretKey ¶
func (hlf *HLFClient) InvokeWithSecretKey(channelID string, chaincodeName string, methodName string, methodArgs []string, secretKey string, noBatch bool, peers string) (*channel.Response, error)
InvokeWithSecretKey - method to sign arguments and send invoke request to hlf methodArgs []string - secretKey string - private key ed25519 - in base58check, or hex or base58 chaincodeName string - chaincode name for invoke methodName string - chaincode method name for invoke noBatch bool - if wait batchTransaction set 'true' peers string - peer0.testnet.anoideaopen
func (*HLFClient) QueryBlock ¶
func (*HLFClient) QueryBlockByTxID ¶
type HlfAfterInvokeHandler ¶
type HlfBeforeInvokeHandler ¶
type SignerInfo ¶
type SignerInfo struct { PrivateKey ed25519.PrivateKey PublicKey ed25519.PublicKey }