This an application inspired by the hyperledger fabric v0.6 marble trading tutorial. This application handles the scenario when 3 people want to trading away their marbles with the fact that their wish can only be satisfy when the 3 people exchange their marbles at the same time in a circular way, ie, the successful exchange of marbles could not happen within one single trade. All trading logic happens in chaincode @ hyperledger fabric v1.0.
This will greatly increase the liquidity of one asset, without limitaion to only digital currency, provided that there is a mechanism binding that physical asset into its digital representation
- docker
- docker-compose
- npm 6.x
./startFabric
cd serverExpressjs
npm install
node app.js
cd clientAngular2
npm install
npm start
create a new marble
change owner of a specific marble
transfer all marbles of a certain color
delete a marble
read a marble
find marbles for owner X using rich query
find marbles based on an ad hoc rich query
get history of values for a marble
get marbles based on range query
open a new marble trade
read marble trades
remove marble trade
swap two marbles between owner depending on input color
match the open trades in pair
match the open trades in Triangle
clear all open trades
Currently the id of each AnOpenTrade is identified by timestamp generated on nodes. This post the the difficult of consistant timestamp across each node. The current solution is to round off the timestamp to nearest second so as to decrease the posibility of inconsistancy as compare to rounding off to miniSecond.