| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Bitcoin.Core.Regtest
Synopsis
- data NodeHandle = NodeHandle {}
- runBitcoind :: Manager -> NodeHandle -> BitcoindClient r -> IO (Either BitcoindException r)
- withBitcoind :: Int -> (NodeHandle -> IO r) -> IO r
- oneBitcoin :: Word64
- createOutput :: Address -> Word64 -> BitcoindClient (OutPoint, Word64)
- generate :: BitcoindClient (OutPoint, Word64)
- spendPackageOutputs :: [(OutPoint, Word64)] -> Address -> Word64 -> Either String (Tx, Word64)
- xprv :: XPrvKey
- keys :: [SecKey]
- pubKeys :: [PubKeyI]
- addrs :: [Address]
- textAddrs :: [Text]
Run an ephemeral regtest node
data NodeHandle Source #
Data needed to connect to a bitcoind-regtest ephemeral node
Constructors
| NodeHandle | |
Fields
| |
runBitcoind :: Manager -> NodeHandle -> BitcoindClient r -> IO (Either BitcoindException r) Source #
Run an RPC computation with an ephemeral node
Arguments
| :: Int | node port |
| -> (NodeHandle -> IO r) | |
| -> IO r |
Provide bracketed access to a fresh ephemeral node
Funding
oneBitcoin :: Word64 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.
Arguments
| :: [(OutPoint, Word64)] | outputs produced by |
| -> Address | recipient address |
| -> Word64 | amount to spend |
| -> Either String (Tx, Word64) |
Spend outputs created by generate