Documentation ¶
Index ¶
- Constants
- func ChaincodeInvoke(chaincodeID string, argsArray []Args) (result string, err error)
- func ChaincodeInvokeByString(chaincodeID, argsStr string) string
- func ChaincodeQuery(chaincodeID string, argsArray []Args) (result string, err error)
- func ChaincodeQueryByString(chaincodeID, argsStr string) string
- func RegisterBlock(block *BlockRegister) string
- func RegisterTokenByString(chain, tokenAddress string) string
- func RegisterWalletByString(key, chain, token string) string
- type Action
- func (action *Action) AdminChannelClient() (*channel.Client, error)
- func (action *Action) ChannelClient(...channel.ClientOption) (*channel.Client, error)
- func (action *Action) ChannelMgmtClientForUser(channelID string, user mspapi.SigningIdentity) (*channel.Client, error)
- func (action *Action) ChannelProvider() (context.ChannelProvider, error)
- func (action *Action) Client(channelID string) (*channel.Client, error)
- func (action *Action) ClientForUser(channelID string, user mspapi.SigningIdentity) (*channel.Client, error)
- func (action *Action) CreateDiscoveryService(channelID string) (fab.DiscoveryService, error)
- func (action *Action) EndpointConfig() fab.EndpointConfig
- func (action *Action) EventClient(opts ...event.ClientOption) (*event.Client, error)
- func (action *Action) GetOrgID(mspID string) (string, error)
- func (action *Action) GetPeers() ([]fab.Peer, error)
- func (action *Action) Initialize() error
- func (action *Action) LedgerClient() (*ledger.Client, error)
- func (action *Action) LocalContext() (context.Local, error)
- func (action *Action) Orderers() ([]fab.Orderer, error)
- func (action *Action) OrgAdminChannelClient(orgID string) (*channel.Client, error)
- func (action *Action) OrgAdminUser(orgID string) (mspapi.SigningIdentity, error)
- func (action *Action) OrgID() string
- func (action *Action) OrgOfPeer(peerURL string) (string, error)
- func (action *Action) OrgUser(orgID, username string) (mspapi.SigningIdentity, error)
- func (action *Action) Peer() fab.Peer
- func (action *Action) PeerConfig() (*fab.PeerConfig, error)
- func (action *Action) PeerFromURL(url string) (fab.Peer, bool)
- func (action *Action) Peers() []fab.Peer
- func (action *Action) PeersByOrg() map[string][]fab.Peer
- func (action *Action) RandomOrderer() (fab.Orderer, error)
- func (action *Action) ResourceMgmtClient() (*resmgmt.Client, error)
- func (action *Action) ResourceMgmtClientForOrg(orgID string) (*resmgmt.Client, error)
- func (action *Action) ResourceMgmtClientForUser(user mspapi.SigningIdentity) (*resmgmt.Client, error)
- func (action *Action) Set(channelID, chaincodeID string, argsArray []Args)
- func (action *Action) Terminate()
- func (action *Action) User() (mspapi.SigningIdentity, error)
- type Args
- type BlockRegister
- type CallResult
- type FabConfig
- type QueryTask
- type TxInfo
- type TxRegister
Constants ¶
const (
// AutoDetectSelectionProvider indicates that a selection provider is to be automatically determined using channel capabilities
AutoDetectSelectionProvider = "auto"
)
Variables ¶
This section is empty.
Functions ¶
func ChaincodeInvoke ¶
ChaincodeInvoke invoke chaincode
func ChaincodeInvokeByString ¶
ChaincodeInvokeByString call chaincode invoke of hyperledger fabric
func ChaincodeQuery ¶
ChaincodeQuery call chaincode query of hyperledger fabric
func ChaincodeQueryByString ¶
ChaincodeQueryByString call chaincode query of hyperledger fabric
func RegisterBlock ¶
func RegisterBlock(block *BlockRegister) string
RegisterBlock register block of source chain into hyperledger fabric
func RegisterTokenByString ¶
RegisterTokenByString query token info from chain
func RegisterWalletByString ¶
RegisterWalletByString create a new account
Types ¶
type Action ¶
type Action struct { Writer io.Writer ChannelID string ChaincodeID string Args []Args // contains filtered or unexported fields }
Action is the base implementation of the Action interface.
func (*Action) AdminChannelClient ¶
AdminChannelClient creates a new channel client for performing administrative functions
func (*Action) ChannelClient ¶
ChannelClient creates a new channel client
func (*Action) ChannelMgmtClientForUser ¶
func (action *Action) ChannelMgmtClientForUser(channelID string, user mspapi.SigningIdentity) (*channel.Client, error)
ChannelMgmtClientForUser returns the Fabric client for the given user
func (*Action) ChannelProvider ¶
func (action *Action) ChannelProvider() (context.ChannelProvider, error)
ChannelProvider returns the ChannelProvider
func (*Action) ClientForUser ¶
func (action *Action) ClientForUser(channelID string, user mspapi.SigningIdentity) (*channel.Client, error)
ClientForUser returns the Channel client for the given user
func (*Action) CreateDiscoveryService ¶
func (action *Action) CreateDiscoveryService(channelID string) (fab.DiscoveryService, error)
CreateDiscoveryService returns a new DiscoveryService for the given channel. This is an implementation of the DiscoveryProvider interface
func (*Action) EndpointConfig ¶
func (action *Action) EndpointConfig() fab.EndpointConfig
EndpointConfig returns the endpoint configuration
func (*Action) EventClient ¶
EventClient returns the event hub.
func (*Action) GetPeers ¶
GetPeers returns the peers in context. This is an implementation of the DiscoveryService interface
func (*Action) Initialize ¶
Initialize initializes the action using the config
func (*Action) LedgerClient ¶
LedgerClient returns the Fabric client for the current user
func (*Action) LocalContext ¶
LocalContext creates a new local context
func (*Action) OrgAdminChannelClient ¶
OrgAdminChannelClient creates a new channel client for the given org in order to perform administrative functions
func (*Action) OrgAdminUser ¶
func (action *Action) OrgAdminUser(orgID string) (mspapi.SigningIdentity, error)
OrgAdminUser returns the pre-enrolled administrative user for the given organization
func (*Action) OrgUser ¶
func (action *Action) OrgUser(orgID, username string) (mspapi.SigningIdentity, error)
OrgUser returns an already enrolled user for the given organization
func (*Action) PeerConfig ¶
func (action *Action) PeerConfig() (*fab.PeerConfig, error)
PeerConfig returns the PeerConfig for the first peer in the current org
func (*Action) PeerFromURL ¶
PeerFromURL returns the peer for the given URL
func (*Action) PeersByOrg ¶
PeersByOrg returns the peers mapped by organization
func (*Action) RandomOrderer ¶
RandomOrderer chooses a random Orderer from the set of configured Orderers
func (*Action) ResourceMgmtClient ¶
ResourceMgmtClient returns a resource management client for the current user
func (*Action) ResourceMgmtClientForOrg ¶
ResourceMgmtClientForOrg returns a resource management client for the given org
func (*Action) ResourceMgmtClientForUser ¶
func (action *Action) ResourceMgmtClientForUser(user mspapi.SigningIdentity) (*resmgmt.Client, error)
ResourceMgmtClientForUser returns the Fabric client for the given user
type Args ¶
Args is used for marshalling arguments to chaincode invocations
type BlockRegister ¶
type BlockRegister struct { Height string `json:"height,omitempty"` Txs []*TxRegister `json:"transactions,omitempty"` }
BlockRegister registered block
type CallResult ¶
type CallResult struct { Code int `json:"code"` Message string `json:"message"` Result interface{} `json:"result"` }
CallResult api call result
type FabConfig ¶
type FabConfig struct { ConfigFile string UserName string ChainID string ChannelID string SelectionProvider string OrdererURL string IsLoggingEnabledFo bool // enable log ConfigProvider core.ConfigProvider // provider returns the config provider Concurrency uint16 OrgIDs []string PeerURL string PeerURLs []string MaxAttempts int InitialBackoff time.Duration MaxBackoff time.Duration BackoffFactor float64 Verbose bool Iterations int PrintPayloadOnly bool PrintFormat string Writer string Base64 bool }
FabConfig wrap configuration values
type QueryTask ¶
type QueryTask struct {
// contains filtered or unexported fields
}
QueryTask is the query task
type TxInfo ¶
type TxInfo struct { Contract string `json:"contract,omitempty"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` Amount string `json:"amount,omitempty"` GasUsed string `json:"gasUsed,omitempty"` GasPrice string `json:"gasPrice,omitempty"` TxHash string `json:"txHash,omitempty"` Height string `json:"height,omitempty"` Status string `json:"status,omitempty"` }
TxInfo info of Tx
type TxRegister ¶
type TxRegister struct { Key string `json:"key,omitempty"` ChainName string `json:"chain,omitempty"` TokenName string `json:"token,omitempty"` Addr string `json:"address,omitempty"` Amount string `json:"amount,omitempty"` GasUsed string `json:"gasUsed,omitempty"` GasPrice string `json:"gasPrice,omitempty"` Info *TxInfo `json:"info,omitempty"` }
TxRegister registered Tx