mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-13 12:33:26 +02:00
* dev(regtest): use polarlightning/bitcoind docker image * dev(regtest): update bitcoin core from v26 to v27
18 lines
647 B
Bash
Executable file
18 lines
647 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
die() {
|
|
local code=${2-1} # default exit status 1
|
|
echo >&2 -e "${1-}"
|
|
exit "$code"
|
|
}
|
|
|
|
BLOCKS=${1:-1} # default to mine a single block
|
|
ADDRESS=${2:-bcrt1qrnz0thqslhxu86th069r9j6y7ldkgs2tzgf5wx} # default to a "random" address
|
|
|
|
[ -z "${BLOCKS//[\-0-9]}" ] || die "Invalid parameter: 'blocks' must be an integer"
|
|
[ "$BLOCKS" -ge 1 ] || die "Invalid parameter: 'blocks' must be a positve integer"
|
|
[ -z "${ADDRESS-}" ] && die "Missing required parameter: 'address'"
|
|
|
|
docker exec -t jm_regtest_bitcoind bitcoin-cli -datadir=/home/bitcoin/data -regtest -rpcport=43782 generatetoaddress "$BLOCKS" "$ADDRESS"
|