bitcoindevkit / bdk-cli

A CLI wallet library and REPL tool to demo and test the BDK library
Other
108 stars 64 forks source link

Change default network to `Regtest` and default wallet db to `Sqlite` #84

Closed rajarshimaitra closed 2 years ago

rajarshimaitra commented 2 years ago

As discussed in https://github.com/bitcoindevkit/bdk-cli/pull/65#discussion_r842412324 we might want to change the default network value to regtest instead of testnet.

Rationale: bdk-cli is mostly used in testing and demo purpose as an easy way to interact with BDK without write separate wallet codes. In such environment most of the testing I have found myself and others doing are on regtest. So it makes sense to make regtest the default option. And user can switch to testnet with -n flag. And mainnet is not allowed in bdk-cli anyway.

Update: I also feel having Sqlite as default db would move us towards same direction.. Sqlite makes it really easy to real time observe database updates in terminal as devs test out different scenarios..

Required changes: Mostly documentation updates to reflected the new cli usage. Code change is simple.

rajarshimaitra commented 2 years ago

I have added this under 0.6 milestone.. Would love to get this thing in before #92..

@notmandatory if there's concept ack on this, I can get this done quickly..

notmandatory commented 2 years ago

@rajarshimaitra If we make regtest the default network that means that users will also need at least the new regtest-bitcoin feature right? and that mean's we'd need to include that feature in the default feature set? I'm trying to image what a user who is just doing a cargo install bdk-cli would expect. Concept ACK as long as you're also planning to add regtest-bitcoin to the default features, otherwise we should discuss more.

rajarshimaitra commented 2 years ago

If we make regtest the default network that means that users will also need at least the new regtest-bitcoin feature right?

I don't think that's the case.. They can run regtest just like they are running testnet right now.. By running a regtest backend node and connecting to the rpc port (which mostly works by default).. They don't need regtest-bitcoin to run it.. Thats only when they want the automated node feature..

As a user its easier for me to expect bdk-cli wallet <command> to just connect to my running regtest node without specifying anything else.. But thats mostly because I run my tests in regtests more than in testnets.. That was basically the motivation of this change..

But I have also observed most of the time the default testnet network also works fine with regtest node too.. And that's probably because the address formats for both of them are same.. But then they need to specify rpc port correctly..

My initial thought was, as bdk-cli is mostly used as a dev and testing ground, maybe it makes sense to connect to regtest with as minimal config possible..

Having sqlite by default is actually more useful.. Which is already done in #99 ..

But its also a good question if we should add regtest-bitcoin as default too.. I am not sure on that, but could a very wholesome experience for anyone running cargo install bdk-cli in that case.. They can just start doing wallet ops from get go, without needing to setup anything else.. And in that case we do need to make regtest default network.. I am open for suggestions here..

rajarshimaitra commented 2 years ago

closing in favor of #109 and we can carry on the discussion there on general default value set..