refactor: replace examples with focused rustdoc examples
Closes #1973
Changes
- Removed
/examplesfolder containing CLI-heavy examples - Added focused rustdoc examples to key functions:
IndexedTxGraph::new()- graph initializationBdkElectrumClient::new()- client creationBdkElectrumClient::sync()- blockchain syncBdkElectrumClient::full_scan()- wallet restorationTxGraph::insert_tx()- transaction insertionTxGraph::balance()- balance calculationTxGraph::filter_chain_unspents()- UTXO retrievalKeychainTxOutIndex::reveal_next_spk()- address generationKeychainTxOutIndex::insert_descriptor()- descriptor setupIndexedTxGraph::apply_block_relevant()- block processingEsploraExt::full_scan()- Esplora wallet scanning
- Updated
Cargo.tomlworkspace members
Rationale
The previous examples contained 300+ lines of CLI boilerplate that obscured the core BDK functionality. The new rustdoc examples are 10-15 lines each and focus purely on API usage, making them much easier for developers to understand and follow.
The maintained bdk-cli tool serves as the comprehensive CLI example.
Thanks for working on this one. It's failing on CI. Make sure to use the 'just' commands and try building the docs locally if that helps with debugging the failures.
@oleonardolima thank you. CI "should" be fixed now, at least it is locally. Can we try again?
Thanks, there are some unrelated already merged commits, you probably need to do a rebase on top of master. Also, please note that we follow the conventional commits for commit messages, which would also need an update.
@oleonardolima ok should be ready to test CI now. Thanks!
You'll need to perform another rebase to incorporate the CI updates/fixes, and remove the unrelated merge commit.
@oleonardolima should be good now, let me know if there is anything else here.
cACK, but haven't done a close review yet. Thanks for hanging in on this one, but looks like it needs another rebase.
I'm sorry for all the rebases you had to do, but you'll need another one to get the latest CI with bumped MSRV.