Skip to content

bmos299/marbles

 
 

Repository files navigation

Marbles Demo

Deploy to Bluemix

#Application Background This sample app is meant to demonstrate how to create and transfer marbles between two users. We are going to do this in Node.JS and a bit of GoLang. The backend of this application will be the GoLang code running in our blockchain network. From here on out the GoLang code will be referred to as 'chaincode' or 'cc'. The chaincode itself will create a marble by storing it to the chaincode state. The chaincode itself is able to store data as a string in a key/value pair setup. Thus we will stringify JSON objects to store more complex structures.

Attributes of a marble:

1. name (unique string, will be used as key)
1. color (string, css color names)
1. size (int, size in mm)
1. user (string)

We are going to create a Web UI that can set these values and pass them to the chaincode. Interacting with the cc is done with a HTTP REST call to a peer on the network. The obc-js SDK will abstract the details of the REST calls away. This allow us to use dot notation to call our GoLang functions (such as chaincode.init_marble(args)).

Start the tutorial below to have your own marbles blockchain demo.

Doc Links

  • Tutorial for Marbles Part 1 - here (start here)
  • Tutorial for Marbles Part 2 - here
  • obc.js SDK Doc - utils/obc-js

Projects Contents

  1. OBC-JS SDK - ./utils/obc-js
  2. Marbles Part 1 - http://localhost:3000/p1
  3. Marbles Part 2 - http://localhost:3000/p2

About

IBM Blockchain - Marbles Demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.8%
  • HTML 19.7%
  • CSS 16.5%