This page provides a step-by-step tutorial to deploy a sample app with Xooa's blockchain platform-as-a-service (PaaS).
Project documentation: https://docs.xooa.com
Overview
This repository contains blockchain smart contracts, also known as chaincodes. Use the Xooa console to deploy it.
Xooa provides a permanent cloud end-point for the smart contracts, enabling cloud-to-cloud integration, while retaining blockchain's peer-to-peer capabilities.
Directory |
Description |
balance-transfer-java |
Sample smart contract runs on Hyperledger Fabric and is written in Java . Provides Invoke , query and delete functions. Originally created by IBM and forked from here. |
balance-transfer-node |
Sample smart contract runs on Hyperledger Fabric and is written in JavaScript . Provides Invoke , query and delete functions. Originally created by IBM and forked from here. |
ethereum |
Sample smart contract runs on Ethereum and is written in Solidity . Provides Get and Set functions. |
get-set |
Sample smart contract runs on Hyperledger Fabric and is written in GoLang . Provides Get , Set and GetVersion methods. Originally created by IBM and forked from here. |
marbles |
Sample smart contract runs on Hyperledger Fabric and is written in GoLang . Provides 9 functions to interact with marbles app. Originally created by IBM and forked from here. |
smartthings |
Sample Groovy files to deploy on smartThings platform. Integrate blockchain to smartThings. |
truffle-supplychain |
Sample smart contract runs on Ethereum and is written in Solidity using Truffle framework . Provides 5 functions to interact with supply chain app. |
Deploy the smart contract
- Log in to the Xooa blockchain console at https://xooa.com/blockchain.
- Go to Apps>Deploy New.
- Select the method to deploy smart contract from. For example, use Xooa Github to deploy one of the samples provided by Xooa. Tap Next.
For accesing Private Git Repos, click or tap Authorize Private Github Access.
-
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.
Note: Xooa.yaml is an optional configuration file used by Xooa platform to configure smart contracts. This file should be in the root directory of the Repo, if being used. This file tells Xooa the programming language, blockchain implementation, and path of the smart contract.
Explore the end-points for the smart Contract
-
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.
-
To view your transaction in 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.