rpc

package
v0.0.0-...-1c741c1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package rpc project rpc.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Faucet

func Faucet(addr btcutil.Address, amt btcutil.Amount) error

Faucet sends bitcion to a given address

func Generate

func Generate(n uint32) ([]*chainhash.Hash, error)

Generate generates n blocks in regtest

func GetBlockCount

func GetBlockCount() (int64, error)

GetBlockCount returns the current block height

Types

type Client

type Client interface {
	ListUnspentMinMaxAddresses(
		minConf, maxConf int, addrs []btcutil.Address,
	) ([]btcjson.ListUnspentResult, error)
	ImportAddressRescan(address string, account string, rescan bool) error
	SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
	SendToAddress(address btcutil.Address, amount btcutil.Amount) (*chainhash.Hash, error)
	Generate(numBlocks uint32) ([]*chainhash.Hash, error)
	GetBlockCount() (int64, error)
	RawRequest(method string, params []json.RawMessage) (json.RawMessage, error)
}

Client is an interface that provides access to certain methods of type rpcclient.Client

func NewClient

func NewClient(cfgPath string) (Client, error)

NewClient returns Client interface object

func NewTestRPCClient

func NewTestRPCClient() (Client, error)

NewTestRPCClient creates a RPC client for testing

Jump to

Keyboard shortcuts

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