rpcutils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: ISC Imports: 14 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBlockHeaderVerbose

func BuildBlockHeaderVerbose(header *wire.BlockHeader, params *chaincfg.Params,
	currentHeight int64, nextHash ...string) *dcrjson.GetBlockHeaderVerboseResult

BuildBlockHeaderVerbose creates a *dcrjson.GetBlockHeaderVerboseResult from an input *wire.BlockHeader and current best block height, which is used to compute confirmations. The next block hash may optionally be provided.

func ConnectNodeRPC

func ConnectNodeRPC(host, user, pass, cert string, disableTLS bool,
	ntfnHandlers ...*rpcclient.NotificationHandlers) (*rpcclient.Client, semver.Semver, error)

ConnectNodeRPC attempts to create a new websocket connection to a dcrd node, with the given credentials and optional notification handlers.

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func GetBlock added in v0.3.2

func GetBlock(ind int64, client *rpcclient.Client) (*dcrutil.Block, *chainhash.Hash, error)

GetBlock gets a block at the given height from a chain server.

func GetBlockHeaderVerbose

func GetBlockHeaderVerbose(client *rpcclient.Client, params *chaincfg.Params,
	idx int64) *dcrjson.GetBlockHeaderVerboseResult

GetBlockHeaderVerbose creates a *dcrjson.GetBlockHeaderVerboseResult for the block index specified by idx via an RPC connection to a chain server.

func GetBlockVerbose added in v0.7.0

func GetBlockVerbose(client *rpcclient.Client, params *chaincfg.Params,
	idx int64, verboseTx bool) *dcrjson.GetBlockVerboseResult

GetBlockVerbose creates a *dcrjson.GetBlockVerboseResult for the block index specified by idx via an RPC connection to a chain server.

func GetBlockVerboseByHash added in v0.7.0

func GetBlockVerboseByHash(client *rpcclient.Client, params *chaincfg.Params,
	hash string, verboseTx bool) *dcrjson.GetBlockVerboseResult

GetBlockVerboseByHash creates a *dcrjson.GetBlockVerboseResult for the specified block hash via an RPC connection to a chain server.

func GetStakeDiffEstimates

func GetStakeDiffEstimates(client *rpcclient.Client) *apitypes.StakeDiff

GetStakeDiffEstimates combines the results of EstimateStakeDiff and GetStakeDifficulty into a *apitypes.StakeDiff.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

This section is empty.

Jump to

Keyboard shortcuts

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