Skip to content

Remove examples folder, add 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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kwsantiago
Copy link

Closes #1973

Changes

  • Removed /examples folder containing CLI-heavy examples
  • Added focused rustdoc examples to key functions:
    • IndexedTxGraph::new() - graph initialization
    • BdkElectrumClient::new() - client creation
    • BdkElectrumClient::sync() - blockchain sync
    • BdkElectrumClient::full_scan() - wallet restoration
    • TxGraph::insert_tx() - transaction insertion
    • TxGraph::balance() - balance calculation
    • TxGraph::filter_chain_unspents() - UTXO retrieval
    • KeychainTxOutIndex::reveal_next_spk() - address generation
    • KeychainTxOutIndex::insert_descriptor() - descriptor setup
    • IndexedTxGraph::apply_block_relevant() - block processing
    • EsploraExt::full_scan() - Esplora wallet scanning
  • Updated Cargo.toml workspace 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.

@kwsantiago kwsantiago mentioned this pull request Aug 1, 2025
@oleonardolima oleonardolima added the documentation Improvements or additions to documentation label Aug 4, 2025
@oleonardolima oleonardolima moved this to In Progress in BDK Chain Aug 4, 2025
@oleonardolima
Copy link
Contributor

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.

@kwsantiago kwsantiago force-pushed the kwsantiago/1973-simplify-examples branch from bcf49f0 to 7448a99 Compare August 5, 2025 00:35
@kwsantiago
Copy link
Author

@oleonardolima thank you. CI "should" be fixed now, at least it is locally. Can we try again?

@kwsantiago kwsantiago force-pushed the kwsantiago/1973-simplify-examples branch 2 times, most recently from 0e68ca5 to 9a9f9af Compare August 5, 2025 01:27
@oleonardolima
Copy link
Contributor

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.

Removed /examples folder containing CLI-heavy examples
Added focused rustdoc examples to key functions:
- IndexedTxGraph::new() - graph initialization
- BdkElectrumClient::new() - client creation
- BdkElectrumClient::sync() - blockchain sync
- BdkElectrumClient::full_scan() - wallet restoration
- TxGraph::insert_tx() - transaction insertion
- TxGraph::balance() - balance calculation
- TxGraph::filter_chain_unspents() - UTXO retrieval
- KeychainTxOutIndex::reveal_next_spk() - address generation
- KeychainTxOutIndex::insert_descriptor() - descriptor setup
- IndexedTxGraph::apply_block_relevant() - block processing
- EsploraExt::full_scan() - Esplora wallet scanning
Updated Cargo.toml workspace 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.
@kwsantiago kwsantiago force-pushed the kwsantiago/1973-simplify-examples branch from 9a9f9af to dc4e009 Compare August 6, 2025 18:28
@kwsantiago
Copy link
Author

@oleonardolima ok should be ready to test CI now. Thanks!

@kwsantiago kwsantiago force-pushed the kwsantiago/1973-simplify-examples branch from 64b327d to 1f81e2c Compare August 13, 2025 18:13
@kwsantiago kwsantiago force-pushed the kwsantiago/1973-simplify-examples branch from 1f81e2c to fa85989 Compare August 13, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Simplify /examples
2 participants