Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to start regtest bitcoind and electrsd #55

Closed
notmandatory opened this issue Nov 23, 2021 · 1 comment · Fixed by #65
Closed

Add options to start regtest bitcoind and electrsd #55

notmandatory opened this issue Nov 23, 2021 · 1 comment · Fixed by #65
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@notmandatory
Copy link
Member

For users who are manually testing bdk with bdk-cli in regtest mode, add a new regtest-net cargo feature that will automatically start and stop a bitcoind and if needed an electrsd daemon with electrum or esplora support. The regtest net daemons will only be started if the --network regtest option is enabled.

The feature should work similarly to the bdk integration tests but store node data in the users ~/.bdk-bitcoin directory and not a random temp directory, and use standard regtest network ports.

Using this feature would look something like this:

# start regtest `bitcoind` and `electrs` and stop daemons when repl (or wallet command) finishes
cargo run --features regtest-net,electrum -- --network regtest repl --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" 

By enabling the regtest-net feature when running or installing bdk-cli a localhost bitcoind and (if electrum or esplora features enabled) electrsd daemon would be started and stopped for each command. This will be most convenient when running multiple commands via the repl shell but still usable (but slow) for single wallet commands.

The bitcoind and electrsd crates provide most of what is needed to download, start, and stop the needed daemons. This will only work on linux and macos systems.

It may also be useful to add additional wallet commands to get a new address from bitcoind or trigger bitcoind to send regtest coins to the bdk-cli wallet.

@notmandatory notmandatory added the enhancement New feature or request label Nov 23, 2021
@rajarshimaitra
Copy link
Contributor

This would be really helpful to make bdk-cli testing process more seamless..

@rajarshimaitra rajarshimaitra self-assigned this Mar 7, 2022
@rajarshimaitra rajarshimaitra moved this to In Progress in BDK-CLI Roadmap Mar 7, 2022
@notmandatory notmandatory added this to the Release 0.5.x milestone Mar 14, 2022
@rajarshimaitra rajarshimaitra moved this from In Progress to Ready to Review in BDK-CLI Roadmap Mar 21, 2022
Repository owner moved this from Ready to Review to Done in BDK-CLI Roadmap Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants