Documentation ¶
Index ¶
- type Client
- func (c *Client) CallView(contractHname coretypes.Hname, fname string, arguments dict.Dict) (dict.Dict, error)
- func (c *Client) GetChainRecord() (*registry.ChainRecord, error)
- func (c *Client) PostRequest(contractHname coretypes.Hname, entryPoint coretypes.Hname, ...) (*sctransaction.Transaction, error)
- func (c *Client) UploadBlob(fields dict.Dict, waspHosts []string, quorum int, optSize ...int) (hashing.HashValue, *sctransaction.Transaction, error)
- type PostRequestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Level1Client level1.Level1Client WaspClient *client.WaspClient ChainID coretypes.ChainID SigScheme signaturescheme.SignatureScheme }
Client allows to send webapi requests to a specific chain in the node
func New ¶
func New( level1Client level1.Level1Client, waspClient *client.WaspClient, chainID coretypes.ChainID, sigScheme signaturescheme.SignatureScheme, ) *Client
New creates a new chainclient.Client
func (*Client) CallView ¶
func (c *Client) CallView(contractHname coretypes.Hname, fname string, arguments dict.Dict) (dict.Dict, error)
CallView sends a request to call a view function of a given contract, and returns the result of the call
func (*Client) GetChainRecord ¶
func (c *Client) GetChainRecord() (*registry.ChainRecord, error)
GetChainRecord fetches the chain's ChainRecord
func (*Client) PostRequest ¶
func (c *Client) PostRequest( contractHname coretypes.Hname, entryPoint coretypes.Hname, params ...PostRequestParams, ) (*sctransaction.Transaction, error)
PostRequest sends a request transaction to the chain
func (*Client) UploadBlob ¶
func (c *Client) UploadBlob(fields dict.Dict, waspHosts []string, quorum int, optSize ...int) (hashing.HashValue, *sctransaction.Transaction, error)
UploadBlob implements an optimized blob upload protocol to the chain. It allows to avoid placing big data chunks into the request transaction - creates optimized RequestArgs, which contain hash references instead of too big binary parameters - uploads big binary data chunks to blob caches of at least `quorum` of `waspHosts` directly - posts a 'storeBlob' request to the 'blob' contract with optimized parameters - the chain reconstructs original parameters upn settlement of the request
type PostRequestParams ¶
type PostRequestParams struct { Transfer coretypes.ColoredBalances Args requestargs.RequestArgs }