LedgerSprint5 CouchDB demo
Here are the instructions: 1) Start CouchDB in Vagrant by doing "couchdb start" from fabric directory. This will also download the CouchDB docker the first time it is done. 2) Switch ledger to use CouchDB in /fabric/peer/core.yaml by setting "stateDatabase" to "CouchDB" 3) start orderer ./orderer 4) start peer CORE_PEER_COMMITTER_LEDGER_ORDERER=0.0.0.0:5151 CORE_LOGGING_LEVEL=DEBUG peer node start 5) Deploy chaincode CORE_PEER_COMMITTER_LEDGER_ORDERER=0.0.0.0:5151 peer chaincode deploy -p https://github.com/denyeart/marbles/chaincode -n marbles -c '{"Args":["init","1"]}' 6) Invoke chaincode to create marble owned by ‘tom’ CORE_LOGGING_LEVEL=debug CORE_PEER_COMMITTER_LEDGER_ORDERER=0.0.0.0:5151 peer chaincode invoke -n marbles -c '{"Args":["init_marble","marble1","blue","35","tom"]}' 7) Invoke chaincode to transfer marble to ‘jerry’ CORE_LOGGING_LEVEL=debug CORE_PEER_COMMITTER_LEDGER_ORDERER=0.0.0.0:5151 peer chaincode invoke -n marbles -c '{"Args":["set_owner","marble1","jerry"]}' 8) See state variables (JSON documents) in CouchDB UI by going to http://localhost:5984/_utils 9) Query data using a REST client, for example to query for an Invoice document: POST http://127.0.0.1:5984/system/_find {"selector":{"docType":"Marble","owner":"jerry"}}
Download
0 formatsNo download links available.