starcar-blockchain-test

module
v0.0.0-...-87526fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2019 License: Apache-2.0

README

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.

Directories

Path Synopsis
get-set
marbles

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL