Create
Create and deploy your first Klave application
Klave is built to make your life as easy as possible when creating application for confidential computing.
At the moment Klave leverages on a git developer workflow and is able to connect directly to your GitHub repository to detect and automatically deploy changes brought to your applications.
Create a scaffold
We will first start by using the Klave NPM package to scaffold a small app automagically.
Develop your app
Once the scaffold has been created you will find the template application in the /apps/hello_world
folder.
What's included
The hello_world
app contains two methods:
- A transaction to store data in the ledger:
storeValue
- A Query to fetch the data stored in the ledger:
fetchValue
You can build you application locally to check that everything is in order and that Klave will compile your code successfully.
Build your application (Optional)
Deploy to Klave
Once you've made the changes you wanted you're ready to deploy. This can be done in a couple easy steps:
Install the Klave GitHub application
For Klave to react to your repository's commits and pushes you will need to install Klave's GitHub App from the marketplace.
Don't worry, if you forget this step Klave will invite you to do so later.
Connect your GitHub repository
Make sure you are logged-in to Klave, the navigate to Deploy now
After selecting your organisation, Klave will scan to find your repo.
Select you app and click on enable
You may need to select the application you want to deploy in case you have more than one in you repo.
App will deploy
Congratulations! You app is now queued for compilation and deployment. In a few seconds your application will be ready to use!
Test your app deployment
The Klave UI provides a few tools to help test out you application. Navigate to your deployment and explore your registered queries and transactions.
Try to Store and Fetch value from the Ledger
Use the storeValue
transaction to store a a key value pair in the Ledger:
Output:
Use the fetchValue
query to get a value from the Ledger:
Output: