Skip to content

Conversation

ItoroD
Copy link
Collaborator

@ItoroD ItoroD commented Aug 4, 2025

Description

CBF syncing that works with regtest.

Changelog notice

  • Add Kyoto example

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

println("Receiving address. Send funds to this address: ${address.address}")

// Wait 70 seconds for funds to arrive before syncing
println("Waiting 70 seconds for funds to arrive here ${address.address} before kyoto (compact block filter syncing) ...")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the wallet has a non-zero amount at start up, maybe we can skip the funding?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure its sufficient enough to just say if non-zero amount, as they might want to send more than what they have. Maybe checking if amount is sufficient enough for example amount then we can skip.

val peer: Peer = Peer(ip, 18444u, false)
val peers: List<Peer> = listOf(peer)
val currentPath = Paths.get(".").toAbsolutePath().normalize()
val persistenceFilePath = Files.createTempDirectory(currentPath, "tempDirPrefix_")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is an example, maybe we can preserve the data in between syncs

Copy link
Collaborator Author

@ItoroD ItoroD Aug 6, 2025

Choose a reason for hiding this comment

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

I see what you mean. I think that totally makes sense for a Kyoto example. Will be great to see the progressive update to your wallet on every sync.

But in this example, each run is getting a new wallet and generating descriptors for those wallets for you (The wallet is non-persistent). User is not adding descriptors of their own. So the idea of them seeing updates between syncs on same wallet will need a little tweaking of this example.

That said I am thinking of maybe creating another Kyoto example that allows persisting, adding your own wallet descriptors, persisting your wallet data, allows/shows user how to play around by sending funds to see new sync updates. Will like to know your thoughts as I think your idea makes a lot of sense

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure how difficult this would be in Kotlin, but you could potentially prompt the user with y/n if they would like to add funds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how difficult this would be in Kotlin, but you could potentially prompt the user with y/n if they would like to add funds.

Pretty simple. For this example its always a new wallet gotten so balance will always be 0 at start.

I will consider adding that in a more interactive example.

@thunderbiscuit
Copy link
Member

I agree with Rob's review comments, except maybe for the persistence of the data (at least in this particular example).

It looks good to me overall, my only thought is that this is in conflict with #824.

If we merge 824 first, it doesn't make sense to have this anymore, and if we merge this one first, it will get wiped by 824 in any case a few days later. I would suggest closing this PR and opening the same PR on bdk-jvm.

@ItoroD
Copy link
Collaborator Author

ItoroD commented Aug 7, 2025

If we merge 824 first, it doesn't make sense to have this anymore, and if we merge this one first, it will get wiped by 824 in any case a few days later. I would suggest closing this PR and opening the same PR on bdk-jvm.

Sure, I will move this to the other repo

@ItoroD
Copy link
Collaborator Author

ItoroD commented Aug 21, 2025

Closing this. I will reopen in bdk-jvm

@ItoroD ItoroD closed this Aug 21, 2025
@ItoroD ItoroD deleted the kyoto-example branch August 21, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants