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 BDK RPC backend tutorial #54

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

rajarshimaitra
Copy link
Contributor

Added a tutorial to work with BDK wallet using the recently added RPC backend.

Unlike other tutorials I haven't used bdk-cli. Instead its a walk through of writing BDK wallet code to work with the backend.
Hope this will help new developers to start working with BDK.

Comments and review welcome. :)

@ulrichard
Copy link

Looks cool. I didn't execute the code, but the text is easy to follow and understand.

@ConorOkus
Copy link
Collaborator

ConorOkus commented Nov 5, 2021

Very good article, made a few minor suggestions.

@dennisreimann can we set up preview links?

@dennisreimann
Copy link
Collaborator

@ConorOkus Yes, I just messaged you on Slack with details on how to set it up.

@netlify
Copy link

netlify bot commented Nov 6, 2021

❌ Deploy Preview for bdk-docs-preview failed.

🔨 Explore the source changes: 072df9a

🔍 Inspect the deploy log: https://app.netlify.com/sites/bdk-docs-preview/deploys/6186928c2bfd8b0008e29121

@rajarshimaitra
Copy link
Contributor Author

Thanks @ConorOkus for the feedback and corrections.

Updated with all those changes..

@rajarshimaitra
Copy link
Contributor Author

@dennisreimann let me know if I have to update anything in the text to pass the netlify deployment..

Unlike other tutorials, we will not use `bdk-cli` tools, but instead write rust code directly using `BDK` devkit. In the end we will end up with our own simple bitcoin wallet.

### Prerequisite
To run with this tutorial you would need to have a bitcoin core node running in regtest mode. Get the bitcoin core binary either from the [bitcoin core repo](https://bitcoincore.org/bin/bitcoin-core-0.21.1/) or [build from source](https://github.com/bitcoin/bitcoin/blob/v0.21.1/doc/build-unix.md). Alternatively you can use the `bitcoin-regtest-box` docker file maintained by BDK project [here](https://github.com/bitcoindevkit/bitcoin-regtest-box).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the bitcoin-regtest-box has been updated to support cookie auth now. I had to use the docker images before this commit to get it working.

What can we do to make this a bit clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I need to update the tutorial to handle cookie auth i think..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like archive bitcoin-regtest-box and update our docs/blogs to not use it. As a start I've created bitcoindevkit/bitcoin-regtest-box#12 with alternative instructions for local regtest testing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted for using Polar which is basically using Docker under the hood. We could probably remove mentioning bitcoin-regtest-box as it's no longer maintained. Some docs around setting up a regtest bitcoind locally would be handy but that could be separate from this tutorial IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually use my own local regtest node instead of bitcoin-regtest-box. Do you think we should add local regtest setup somewhere? Or shift to Polar?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add local regtest setup somewhere, but I think we can do it in another PR 👍

@ConorOkus
Copy link
Collaborator

@rajarshimaitra this is great! I was able to get through this pretty easy. I would just double check you are rebased with master. Still working on the preview links to see it on the actual site and make sure the formatting is okay.

@rajarshimaitra rajarshimaitra force-pushed the rpc-tutorial branch 2 times, most recently from 17e6332 to 502e0d0 Compare November 23, 2021 12:05
@rajarshimaitra
Copy link
Contributor Author

@ConorOkus updated with latest suggestions and rebased on current master.

Regarding this #54 (comment), I decided to remove the bdk-regtest-box reference, and right now assuming the reader already knows how to run bitcoin in regtest. Maybe we can add a small tutorial on how to run bitcoin regtest and link it here. Would be helpful for new learners. But I would like to do that on separate PR.

Still working on the preview links to see it on the actual site and make sure the formatting is okay.
I locally ran the site, and to me the formatting seemed Ok. Still let me know here if anything needs to be updated.

@ConorOkus
Copy link
Collaborator

ConorOkus commented Nov 23, 2021

@rajarshimaitra left a last comment on the link to the v0.10.0 release, I checked this out locally and everything LGTM 👍

@netlify
Copy link

netlify bot commented Nov 24, 2021

✔️ Deploy Preview for awesome-golick-685c88 ready!

🔨 Explore the source changes: d44db10

🔍 Inspect the deploy log: https://app.netlify.com/sites/awesome-golick-685c88/deploys/619dd0a3cb92050007d64852

😎 Browse the preview: https://deploy-preview-54--awesome-golick-685c88.netlify.app

@rajarshimaitra
Copy link
Contributor Author

Thanks @ConorOkus.. Updated..

@ConorOkus ConorOkus merged commit e932ec0 into bitcoindevkit:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants