-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Add Kyoto example #827
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
Conversation
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) ...") |
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.
If the wallet has a non-zero amount at start up, maybe we can skip the funding?
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.
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_") |
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.
Since this is an example, maybe we can preserve the data in between syncs
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.
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
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.
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.
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.
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.
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. |
Sure, I will move this to the other repo |
Closing this. I will reopen in bdk-jvm |
Description
CBF syncing that works with regtest.
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: