This page provides a step-by-step tutorial to deploy a sample app with Xooa's blockchain-as-a-service (BaaS).
Project documentation: https://docs.xooa.com
This repository contains a blockchain smart contract, also known as chaincode. Use the Xooa console to deploy it.
Xooa provides a permanent cloud end-point for the smart contract, enabling cloud-to-cloud integration, while retaining blockchain's peer-to-peer capabilities.
- Log in to the Xooa blockchain console at https://xooa.com/blockchain.
- Go to Apps>Deploy New. If you didn't log in with your GitHub account, you will need to do it now.
- Find the Github repository with the smart contract you want to deploy. For example, use Xooa/samples to deploy one of the sample provided by Xooa. Tap Select, and then Next.
-
Select the Smart Contract you want to deploy, and then click Deploy.
-
Relax: Xooa is doing the blockchain heavy lifting. You will be redirected to app dashboard when the deployment completes.
-
Navigate to Identities tab, click or tap Add New, enter name for Identity and set permissions to Read+Write.
-
Copy and store the API Token value. You need it to authorize API requests. API Token cannot be dispalyed after you closed the window, but it may get regenerated.
The dashboard consists of the following tabs:
- Details
- Information about your app.
- Identities
- Create or delete an identity. You can also specify access rights to different identities, thus controlling the access of endpoints for your smart contract
- Activities
- History of your app's activities.
- Logs
- View smart contract events from the last 10 minutes.
- Manage
- Delete your app or update from github.
-
Go to the Details tab, click Explore API's.
-
Enter API Token in the field in navigation pane. This is used to authenticate all API calls.
-
Go to the Smart Contract > Invoke Smart Contract Function from the navigation pane.
-
In the fcn field, enter the Smart Contract function name you wish to Invoke. For example, if using this repo get-set smart contract to store data in blockchain
set
should be entred as the fcn field value -
In the body field, enter the data in the format expected by the smart contract. For example, if using this repo get-set smart contract to store data in blockchain ledger using the set function, the body should be entered as:
[ "<key>", "<value>" ]
-
Click or tap try.
- A response code of 200 indicates successful function call of the smart contract.
- A response code of 202 indicates that your request is queued for processing. Final processing outcome may be obtained through Result end point by using resultId obtained in response body.
- A response code of 400 indicates that you have a malformed request. Check the body and fcn fields.
- A response code of 401 indicates that either you forgot to enter API Token you have entered invalid API token. While you cannot recover lost API Token you can always generate a new one from Xooa console - app dashboard - Identities tab - actions
-
To view your transaction ain the blockchain Ledger, from your Xooa dashboard, go to Ledger.
-
Go to the Transactions tab. You can expand the data field to see your transactions.