-
Notifications
You must be signed in to change notification settings - Fork 404
refactor: replace examples with focused rustdoc examples #2006
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
base: master
Are you sure you want to change the base?
refactor: replace examples with focused rustdoc examples #2006
Conversation
Thanks for working on this one. |
bcf49f0
to
7448a99
Compare
@oleonardolima thank you. CI "should" be fixed now, at least it is locally. Can we try again? |
0e68ca5
to
9a9f9af
Compare
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. |
9a9f9af
to
dc4e009
Compare
@oleonardolima ok should be ready to test CI now. Thanks! |
1f81e2c
to
fa85989
Compare
You'll need to perform another rebase to incorporate the CI updates/fixes, and remove the unrelated merge commit. |
fa85989
to
6fb8acd
Compare
@oleonardolima should be good now, let me know if there is anything else here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also remove the example exclusion in build and test CI step.
I'm also wondering if the cfgs
are strictly required, but haven't tested anything different yet.
Remove standalone examples in favor of focused, contextual rustdoc examples that are easier to maintain and provide better documentation. This makes the codebase more maintainable while improving the developer experience with examples that are tested alongside the code they document.
86defb3
to
92ba283
Compare
Closes #1973
Changes
/examples
folder containing CLI-heavy examplesIndexedTxGraph::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 scanningCargo.toml
workspace membersRationale
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.