Last active
April 26, 2023 20:19
-
-
Save notmandatory/a7cade3468e90c699037292123a1ca1a to your computer and use it in GitHub Desktop.
Create core descriptor wallet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install bitcoind via your favorite method | |
# start regtest bitcoind | |
mkdir -p /tmp/regtest1/bitcoind | |
bitcoind -datadir=/tmp/regtest1/bitcoind -regtest -server -fallbackfee=0.0002 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -blockfilterindex=1 -peerblockfilters=1 -daemon | |
# cookie file location: /tmp/regtest1/bitcoind/regtest/.cookie | |
# create test bitcoind wallet | |
bitcoin-cli -datadir=/tmp/regtest1/bitcoind -regtest -named createwallet wallet_name="regtest1" disable_private_keys=true blank=true | |
# set descriptor env | |
export DESCRIPTOR="wpkh(tpubD6NzVbkrYhZ4WWGhiCNyq7EUNpoFdcVrxB4SqRUv55oSXHPAt47E5Et1xYM8S5ZqtwPuPZ5j2s1pFALLGg9uK5emMbKqdi8r2B2SRx9oQSk/*)#v7tylpae" | |
# import test descriptor | |
bitcoin-cli -rpcwallet="regtest1" -datadir=/tmp/regtest1/bitcoind -regtest importdescriptors '[{ "desc":"wpkh(tpubD6NzVbkrYhZ4WWGhiCNyq7EUNpoFdcVrxB4SqRUv55oSXHPAt47E5Et1xYM8S5ZqtwPuPZ5j2s1pFALLGg9uK5emMbKqdi8r2B2SRx9oQSk/*)#v7tylpae", "active":true, "timestamp":"now"}]' | |
# get test descriptor wallet info | |
bitcoin-cli -rpcwallet="regtest1" -datadir=/tmp/regtest1/bitcoind -regtest getwalletinfo | |
# get new address | |
bitcoin-cli -rpcwallet="regtest1" -datadir=/tmp/regtest1/bitcoind -regtest getnewaddress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment