Skip to content

jimbuho/samples

 
 

Repository files navigation

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

  1. Log in to the Xooa blockchain console at https://xooa.com/blockchain.
  2. Go to Apps>Deploy New.
  3. 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.

deploy

  1. Select the Smart Contract you want to deploy, and then click Deploy.

  2. Relax: Xooa is doing the blockchain heavy lifting. You will be redirected to app dashboard when the deployment completes.

identity creation

  1. Navigate to Identities tab, click or tap Add New, enter name for Identity and set permissions to Read+Write.

  2. 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

  1. Go to the Details tab, click Explore API's.

  2. Enter API Token in the field in navigation pane. This is used to authenticate all API calls.

  3. Go to the Smart Contract > Invoke Smart Contract Function from the navigation pane.

Invoke

  1. 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

  2. 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>" ]

  3. Click or tap try.

  4. To view your transaction in the blockchain Ledger, from your Xooa dashboard, go to Ledger.

  5. Go to the Transactions tab. You can expand the data field to see your transactions.

About

Sample smart contract apps for Xooa PaaS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 44.0%
  • JavaScript 28.9%
  • Solidity 12.1%
  • Java 8.8%
  • C# 6.2%