bitcoin-cli
bitcoin-cli -chain=regtest
stdin からオプションを受け取るには -stdin を指定する必要がある
loadwallet したあとに importdescriptor すると required field が怒られる
create wallet したあとだと、おなじ importdescriptor コマンドでも通る
password auth
code:shell
bitcoind -rpcuser=username -rpcpassword=pass
curl --user=username:pass
これと cookie の併用はできない?
cli から呼び出せなくなる
cli のオプションで username passwd はいけるはずだけど、cli はそのままデフォルトの cookie 使いたい
cli で rpcauth の credential を使う場合は
code:shell
bitcoin-cli --rpcuser=<user name> --rpcpassword=<password>
code:logging
code:sendrawtransaction
bitcoin-cli sendrawtransaction "hex transaction"
Error: bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1
code:generatetodescriptor
❯ bitcoin-cli --regtest generatetodescriptor 101 "wpkh(tprv8ZgxMBicQKsPeEouTKKKxFXWfBzkPVnUphbBGZ1E2UHRjMZnG6LmwYDubJZeCLdHwcmx7znafY2Ub6RQUEw48UiEAYNWpooFQq6RU2FBtFX/84'/1'/0'/0/*)"
error code: -8
error message:
Ranged descriptor not accepted. Maybe pass through deriveaddresses first?
❯ bitcoin-cli --regtest generatetodescriptor 101 "wpkh(tprv8ZgxMBicQKsPeEouTKKKxFXWfBzkPVnUphbBGZ1E2UHRjMZnG6LmwYDubJZeCLdHwcmx7znafY2Ub6RQUEw48UiEAYNWpooFQq6RU2FBtFX/84'/1'/0'/0/0)"
code:createwallet
createwallet accepts a new passphrase parameter. If set, this will create the new wallet encrypted with the given passphrase. If unset (the default) or set to an empty string, no encryption will be used. (#16394) since v0.19.0.1
bitcoin-cli createwallet pool false false "" false true
code:importdescriptors
bitcoin-cli importdescriptors '"desc": "wpkh(tprv8ZgxMBicQKsPeEouTKKKxFXWfBzkPVnUphbBGZ1E2UHRjMZnG6LmwYDubJZeCLdHwcmx7znafY2Ub6RQUEw48UiEAYNWpooFQq6RU2FBtFX/84h/1h/0h/0/*)#7swry5a5", "timestamp":1455191478 }, { "desc": "wpkh(tprv8ZgxMBicQKsPeEouTKKKxFXWfBzkPVnUphbBGZ1E2UHRjMZnG6LmwYDubJZeCLdHwcmx7znafY2Ub6RQUEw48UiEAYNWpooFQq6RU2FBtFX/84h/1h/1h/0/*)#5te9s6mf", "timestamp":1455191478, "internal": true }'