ExBitcoin v0.3.0 ExBitcoin.Generating View Source

Generating blocks and addresses

Link to this section Summary

Functions

generate nblocks ( maxtries )

generatetoaddress nblocks address (maxtries)

Link to this section Functions

Link to this function generate(nblocks, maxtries) View Source
generate(:"String.t", :"String.t") :: any()

generate nblocks ( maxtries )

Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.

Arguments:

  1. nblocks (numeric, required) How many blocks are generated immediately.
  2. maxtries (numeric, optional) How many iterations to try (default = 1000000).

Result: [ blockhashes ] (array) hashes of blocks generated

Examples:

Generate 11 blocks

bitcoin-cli generate 11

Link to this function generatetoaddress(nblocks, address, maxtries) View Source
generatetoaddress(:"String.t", :"String.t", :"String.t") :: any()

generatetoaddress nblocks address (maxtries)

Mine blocks immediately to a specified address (before the RPC call returns)

Arguments:

  1. nblocks (numeric, required) How many blocks are generated immediately.
  2. address (string, required) The address to send the newly generated bitcoin to.
  3. maxtries (numeric, optional) How many iterations to try (default = 1000000).

Result: [ blockhashes ] (array) hashes of blocks generated

Examples:

Generate 11 blocks to myaddress

bitcoin-cli generatetoaddress 11 “myaddress”