system info
➜ bark git:(master) ✗ which bitcoind
/nix/store/42mvg2m90wn7pn4z2wb80q189j0340a5-bitcoin-28.0/bin/bitcoind
➜ bark git:(master) ✗ bitcoind -version
Bitcoin Core version v28.0.0
Copyright (C) 2009-2024 The Bitcoin Core developers
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
➜ bark git:(master) ✗ which sqlite3
/nix/store/qdnnfnxzg70yavi08jw0z4s9skjrwhn9-sqlite-3.45.3-bin/bin/sqlite3
➜ bark git:(master) ✗ sqlite3 --version
3.45.3 2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355 (64-bit)
➜ bark git:(master) ✗ bitcoind -regtest
➜ bark git:(master) ✗ time bitcoin-cli -regtest generatetoaddress 100 $(hal address create --regtest --pubkey $(hal key generate | jq -r '.public_key') | jq -r '.p2pkh')
...
bitcoin-cli -regtest generatetoaddress 100 0.01s user 0.01s system 4% cpu 0.322 total
➜ bark git:(master) ✗ time bitcoin-cli -regtest generatetoaddress 100 $(bitcoin-cli -regtest getnewaddress)
...
bitcoin-cli -regtest generatetoaddress 100 0.01s user 0.00s system 0% cpu 5.413 total
It's solved when I run bitcoind with
➜ bark git:(master) ✗ bitcoind -regtest -unsafesqlitesync
➜ bark git:(master) ✗ time bitcoin-cli -regtest generatetoaddress 100 $(bitcoin-cli -regtest getnewaddress)
...
bitcoin-cli -regtest generatetoaddress 100 0.01s user 0.00s system 3% cpu 0.313 total