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

Created initial code for the vanadium_client_sdk; deleted the host crate. #30

Merged
merged 14 commits into from
Oct 11, 2024

Conversation

bigspider
Copy link
Collaborator

@bigspider bigspider commented Sep 18, 2024

Initial attempt at separating the host crate's code that should go into the vanadium_client_sdk.

Added a Callbacks trait that allows to inject the V-App-specific logic a V-App client needs to interact with an app execution.

As the current test V-App is extremely simple, the client is currently an executable binary. Real V-Apps will most likely have a proper client library that is not an executable (for example to abstract the V-App's API from its communication protocol).

Closes: #29

…' crate.

The 'host' crate was split among the 'vanadium_client_sdk' and the vnd-test-client executable crate.
@bigspider
Copy link
Collaborator Author

bigspider commented Sep 20, 2024

Unfinished things:

  • The app should start running immediately, before a message is sent; no reason for the code before the first xrecv to wait.
  • The app_hmac is not correctly propagated around (temporarily hardcoded)
  • How to get the app's exit status back to the client?
  • Didn't test if panics are handled correctly
  • How to cleanly stop the V-App if the client exits?

It might be worth trying to restructure the VanadiumClient in order to allow a synchronous version, by 'splitting' the busy_loop into multiple consecutive calls. That is:

  • when the V-app is started, run the V-App until the first xrecv;
  • then, each send_message processes the xrecv, and runs the V-App until the next xrecv (expecting an xsend in between with the response). Or it stops if exit or a panic is received.

This might simplify building the asynchronous version on top.

@bigspider bigspider marked this pull request as ready for review October 11, 2024 13:51
@bigspider bigspider merged commit f9d702b into master Oct 11, 2024
8 checks passed
@bigspider bigspider deleted the client-sdk branch October 11, 2024 15:39
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.

Create the vanadium_client_sdk, delete the host crate
1 participant