goshimmer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0, BSD-2-Clause Imports: 18 Imported by: 8

Documentation

Overview

Implements a very simple wrapper for GoShimmer's web API .

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest          = errors.New("bad request")
	ErrInternalServerError = errors.New("internal server error")
	ErrNotFound            = errors.New("not found")
	ErrUnauthorized        = errors.New("unauthorized")
	ErrUnknownError        = errors.New("unknown error")
	ErrNotImplemented      = errors.New("operation not implemented/supported/available")
)

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.

Jump to

Keyboard shortcuts

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