Documentation ¶
Index ¶
- type Client
- func (c *Client) AddNode(address string) (int, error)
- func (c *Client) Close() error
- func (c *Client) DisconnectNode(address string) (int, error)
- func (c *Client) GetAddressUTXOs(address string) ([]tx.Output, error)
- func (c *Client) GetAddressesUTXOs(addresses []string) (map[string][]tx.Output, error)
- func (c *Client) GetBestHeight() (int32, error)
- func (c *Client) GetBlock(hash []byte) (block.Block, error)
- func (c *Client) GetLastBlock() (block.Block, error)
- func (c *Client) GetPeerInfo() ([]string, error)
- func (c *Client) GetRawMempool() ([]string, error)
- func (c *Client) GetTransaction(id []byte) (block.Block, tx.Tx, error)
- func (c *Client) ListBlocks() ([]block.Block, error)
- func (c *Client) SendPing() error
- func (c *Client) SendTx(params node.SendTxParams) ([]byte, error)
- func (c *Client) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the requester of the node's RPC server methods.
func NewClient ¶
NewClient creates a client that is connected to the node's RPC server.
Call Close to release the Client's associated resources when done.
func (*Client) DisconnectNode ¶
DisconnectNode removes a node from the peer list.
func (*Client) GetAddressUTXOs ¶
GetAddressUTXOs returns the unspent outputs of an address.
func (*Client) GetAddressesUTXOs ¶
GetAddressesUTXOs returns the UTXOs corresponding to a set of addresses.
func (*Client) GetBestHeight ¶
GetBestHeight returns the node's blockchain best height.
func (*Client) GetLastBlock ¶
GetLastBlock returns the last block (tip) of a chain.
func (*Client) GetPeerInfo ¶
GetPeerInfo returns data about each connected node.
func (*Client) GetRawMempool ¶
GetRawMempool returns the node's mempool transaction ids.
func (*Client) GetTransaction ¶
GetTransaction returns a transaction with the id provided.
func (*Client) ListBlocks ¶
ListBlocks returns all blocks from the chain.