-
Notifications
You must be signed in to change notification settings - Fork 2
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
Quartz tooling for deployment #61
Comments
For more context, each of the commands (except The My expectation is that The same goes for the underlying The
For now, the simplest thing might just be to keep the |
A note here that, as of #105, we're preferring a slightly modified CLI due to the fact that I'd recommend the following CLI for now:
|
closed by #153 , as it was the last one to get merged |
Thinking about the quartz dev experience, especially around deployment. Here's a short writeup on some things we discussed today with Shoaib and Thane.
With Dan's recent refactor of the quartz core enclave code, the app-specific logic now lives on its own in its own directory.
So a quartz app moving forward should have the following directory structure:
And it can be in its own repo. For now our two quartz apps are living in the cycles-quartz repo, but in the future they could be in their own repos.
This is basically what we have now, but we also have this additional set of janky bash scripts for deployment. Instead of having those scripts, we discussed creating a
quartz
tool that would run on the enclave's host machine with the following commands:Maybe
listen
should be calledrun
but I'll leave it as listen for now.We could also add a
quartz init
to run on the dev machine to initialize the repo with template contract and enclave code to help devs get started. But the tool is mostly about easing deployment and getting rid of the scripts.The scripts are currently a mix of bash code (init.sh, handshake.sh, etc.) and rust code called from bash (tm-prover).
The
quartz
tool should be written in rust (obviously), but for ease of getting started we can have it just include parts of the bash scripts as strings in its binary that it can execute directly. Might not be possible for everything but can probably help us get started quickly. Over time we can move more and more of the functionaltiy from the bash scripts into rust proper.One thing to note is that some deployment stuff will actually be application specific, and we want this
quartz
tool to be general purpose. The way we achieve this is by putting more burden on theenclave
code to handle things.For instance,
quartz deploy
includes a call to the enclave's Instantiate method. This may need to return application specific data.More significantly is
quartz listen
, which starts the main daemon to listen for blockchain events and trigger execution on the enclave. This may need to be customized in arbitrary ways. But in general it should be possible to boil this down to having the host query for data over the network and run functions on the enclave. Thusquartz listen
will get everything it needs from the enclave. The enclave can tell it what events to subscribe to. And when events are triggered, it can ask the enclave what queries to make, before returning those results to the enclave for processing.Note this does mean it can trigger some execution on the enclave that is not strictly controlled by the blockchain (ie. asking it what queries to make of the blockchain in the first place). In principle this should be ok, just something to note.
Additionally, we can have
quartz listen
expose a public query server so users can query enclave data. Making queries possible requires a lot more work (specifically adding ORAM), but it makes sense for the singlequartz listen
command to handle all requests for execution from the enclave whether from users or the blockchain itself.So, a short summary of some flows for
quartz listen
:Tasks
init
command #113enclave build
#114enclave start
#115contract build
#116contract deploy
#117handshake
#118dev
#120The text was updated successfully, but these errors were encountered: