bitcoind-regtest-0.1.0.0: A library for working with bitcoin-core regtest networks

Safe HaskellNone
LanguageHaskell2010

Bitcoin.Core.Regtest

Contents

Synopsis

Run an ephemeral regtest node

data NodeHandle Source #

Data needed to connect to a bitcoind-regtest ephemeral node

Constructors

NodeHandle 

runBitcoind :: Manager -> NodeHandle -> BitcoindClient r -> IO (Either BitcoindException r) Source #

Run an RPC computation with an ephemeral node

withBitcoind Source #

Arguments

:: Int

node port

-> (NodeHandle -> IO r) 
-> IO r 

Provide bracketed access to a fresh ephemeral node

Funding

createOutput Source #

Arguments

:: Address

address for the newly created output

-> Word64

target amount

-> BitcoindClient (OutPoint, Word64) 

Funds an output with the minimum of the given amount and 100 blocks of subsidies

generate :: BitcoindClient (OutPoint, Word64) Source #

A simplified block generator which does not require the tester to manage a wallet. Use spendPackageOutputs to spend.

spendPackageOutputs Source #

Arguments

:: [(OutPoint, Word64)]

outputs produced by generate

-> Address

recipient address

-> Word64

amount to spend

-> Either String (Tx, Word64) 

Spend outputs created by generate

Internal wallet

In the following lists, entries correspond to each other e.g. the p2pkh address for keys !! 1 is addrs !! 1.

xprv :: XPrvKey Source #

Root key for the package wallet

keys :: [SecKey] Source #

Example secret keys

pubKeys :: [PubKeyI] Source #

Example public keys

addrs :: [Address] Source #

Example p2pkh addresses

textAddrs :: [Text] Source #

Text versions of the example addresses