Documentation ¶
Overview ¶
Implements a very simple wrapper for GoShimmer's web API .
Index ¶
- Variables
- type GoShimmerAPI
- func (api *GoShimmerAPI) BroadcastData(targetAddress trinary.Trytes, data string) (trinary.Hash, error)
- func (api *GoShimmerAPI) FindTransactionHashes(query *webapi_findTransactionHashes.Request) ([]trinary.Hashes, error)
- func (api *GoShimmerAPI) GetNeighbors(knownPeers bool) (*webapi_getNeighbors.Response, error)
- func (api *GoShimmerAPI) GetTransactionObjectsByHash(txHashes trinary.Hashes) ([]webapi_getTransactionObjectsByHash.Transaction, error)
- func (api *GoShimmerAPI) GetTransactionTrytesByHash(txHashes trinary.Hashes) ([]trinary.Trytes, error)
- func (api *GoShimmerAPI) GetTransactionsToApprove() (*webapi_gtta.Response, error)
- func (api *GoShimmerAPI) Login(username string, password string) error
- func (api *GoShimmerAPI) ToggleSpammer(enable bool) (*webapi_spammer.Response, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GoShimmerAPI ¶
type GoShimmerAPI struct {
// contains filtered or unexported fields
}
GoShimmerAPI is an API wrapper over the web API of GoShimmer.
func NewGoShimmerAPI ¶
func NewGoShimmerAPI(node string, httpClient ...http.Client) *GoShimmerAPI
func (*GoShimmerAPI) BroadcastData ¶
func (api *GoShimmerAPI) BroadcastData(targetAddress trinary.Trytes, data string) (trinary.Hash, error)
BroadcastData sends the given data by creating a zero value transaction in the backend targeting the given address.
func (*GoShimmerAPI) FindTransactionHashes ¶
func (api *GoShimmerAPI) FindTransactionHashes(query *webapi_findTransactionHashes.Request) ([]trinary.Hashes, error)
FindTransactionHashes finds the given transaction hashes given the query.
func (*GoShimmerAPI) GetNeighbors ¶
func (api *GoShimmerAPI) GetNeighbors(knownPeers bool) (*webapi_getNeighbors.Response, error)
GetNeighbors gets the chosen/accepted neighbors. If knownPeers is set, also all known peers to the node are returned additionally.
func (*GoShimmerAPI) GetTransactionObjectsByHash ¶
func (api *GoShimmerAPI) GetTransactionObjectsByHash(txHashes trinary.Hashes) ([]webapi_getTransactionObjectsByHash.Transaction, error)
GetTransactionObjectsByHash gets the transaction objects given the transaction hashes.
func (*GoShimmerAPI) GetTransactionTrytesByHash ¶
func (api *GoShimmerAPI) GetTransactionTrytesByHash(txHashes trinary.Hashes) ([]trinary.Trytes, error)
GetTransactionTrytesByHash gets the corresponding transaction trytes given the transaction hashes.
func (*GoShimmerAPI) GetTransactionsToApprove ¶
func (api *GoShimmerAPI) GetTransactionsToApprove() (*webapi_gtta.Response, error)
GetTips executes the tip-selection on the node to retrieve tips to approve.
func (*GoShimmerAPI) Login ¶
func (api *GoShimmerAPI) Login(username string, password string) error
Login authorizes this API instance against the web API. You must call this function before any before any other call, if the web-auth plugin is enabled.
func (*GoShimmerAPI) ToggleSpammer ¶
func (api *GoShimmerAPI) ToggleSpammer(enable bool) (*webapi_spammer.Response, error)
ToggleSpammer toggles the node internal spammer.