Financial data protection laws require knowing who the members
of your trading network are and who is accessing specific data.
See how the IBM Blockchain service ensures secure trades.
The Marbles demo showcases a simple asset transfer on a Hyperledger Fabric-based blockchain network. Enrolled and authenticated users can create digital assets (marbles, in this demo) with a variety of attributes, and then exchange these assets in accordance with the transaction rules. These rules (or business logic) are defined in ‚Äúchaincode‚ÄĚ that runs in a container on a network peer. Network peers maintain a ledger containing the current state of assets (state database) and a hash-linked chain holding an immutable record of all transactions. Hence the name “blockchain.”
Here‚Äôs how it works: Users target peers with specific transactions (read and write requests). Peers execute these transactions against the chaincode container. If an asset is created or modified, then the ledger is updated. If a read request (query) is submitted, then a value is returned to the user.
The marbles chaincode (business logic) is written in the Go programming language, and the asset object is structured such that marbles have four distinct attributes:
- name (unique string, will be used as key)
- color (string, css color names)
- size (int, size in mm)
- user (string)
A client-side app using the Node.js SDK provides a UI to set the attributes of a marble and then passes these values within a transaction to a peer on your network. The SDK serves as a shim to properly construct transaction payloads for consumption by the peer.
More information on IBM Blockchain and Hyperledger Fabric
- Learn Chaincode tutorial
- Marbles branch 3.0 (We recommend the v3.0 branch because it uses Hyperledger Fabric v1.0 architecture for the backend components.)
- Hyperledger Fabric Client SDK for Node.js
- Hyperledger Fabric documentation