#SimpleStuff
an NBM Company
##OBC - Javascript Demo
- examples of using sdk are in app.js near bottom
Run:
> npm install
> gulp
> open browser to localhost:3000
Alternative Run:
> npm install
> node app.js
> open browser to localhost:3000
##Projects Contents
- sdk, obc-js.js
- chaincode investigator
- obc demo aka SimpelStuff
##Demo Description This is a simple asset transfer and asset permission example.
##Goals Phase 1
- User can create a ball and store it in the chaincode state
- User can read all balls in the chaincode state
- User can transfer ball to another user
- User can see the owner of a ball
##Goals Phase 2
- ^^
- Can trade multiple balls at once
- User's loan balls for timeperiod, auto lose ownership
##Goals Phase 3
- ^^
- User's can advertise to trade their balls
###Permissions:
- Owner – can add/remove all permissions to the ball
###Attributes of a ball:
- name
- color
- size
- user
##ChainCode / SDK To Do:
- Write("name", "val", cb);
- [?] ReadNames(cb)
- init_thing(json);
- edit_thing(json);
- need multi var read in sdk! ie read(["car1", "car2"]); ... what if we do a lot here, like SQL syntax?
- [?] remember the name of all the saved vars in cc, and export this list so sdk can get it
- check permissions of requesting user in cc
- verify user identityf, ie public private key stuff
- website to test cc, real basic
- demo app website
- make sdk proper npm module
- change downloading zip to git clone
- custom custom function on UI
- load json in UI
- mocha test for sdk
- browsify sdk and tie cci into it
- follow redirect on zip download...
- unzip may have project name as root... need to go down 1 lvl
- check inputs on load if they dne, error
- poll after chain deploy for cc up in peer
- add block event to sdk
###ChainCode Notes:
- Due to performance issues, we probably want resuable chaincode contracts. ie 1 chaincode describe/constrains multiple people assets. ie ie many people and cars exist in 1 chaincode
- Any functionality that parties need to agree on should be in the chaincode. ie do not move it to the application b/c this then the moving parts beomce unenforceable.
- Chaincode should keep track of all key's that get their state saved. Have init clear these
###Junk Notes:
- npm install git+ssh://[email protected]:openblockchain/obc-js.git
- https://broker.obchain.com/api/peer/#network_id_peer_id/chaincode/#cc_name/logs
- National Business Merchandise