Hyperledger Fabric Marble Chain Code Logs

Running Marble code from https://github.com/hyperledger/fabric-samples/tree/release/chaincode-docker-devmode

docker ps

Last login: Tue May 29 07:47:44 on ttys010

esumits-MacBook-Pro:~ esumit$ docker ps

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                            NAMES

6d82ea31bfcb        hyperledger/fabric-tools     “/bin/bash -c ./scri…”   About an hour ago   Up About an hour                                                     cli

aae170ee0c2e        hyperledger/fabric-ccenv     “/bin/bash -c ‘sleep…”   About an hour ago   Up About an hour                                                     chaincode

e3ad58c8ad8e        hyperledger/fabric-peer      “peer node start –p…”   About an hour ago   Up About an hour    0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   peer

b1698cc46519        hyperledger/fabric-couchdb   “tini — /docker-ent…”   About an hour ago   Up About an hour    4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp       couchdb

b0abc7f887be        hyperledger/fabric-orderer   “orderer”                About an hour ago   Up About an hour    0.0.0.0:7050->7050/tcp                           orderer

esumits-MacBook-Pro:~ esumit$

logs at docker-compose -f docker-compose-simple.yaml up

couchdb      | [notice] 2018-05-28T22:32:20.282066Z nonode@nohost <0.17016.1> 4020719c8f couchdb:5984 172.23.0.4 undefined GET /myc 200 ok 2

peer         | 2018-05-28 22:32:20.286 UTC [couchdb] handleRequest -> DEBU eb3 Exiting handleRequest()

peer         | 2018-05-28 22:32:20.286 UTC [couchdb] ReadDoc -> DEBU eb4 Exiting ReadDoc()

peer         | 2018-05-28 22:32:20.286 UTC [couchdb] handleRequest -> DEBU eb5 Entering handleRequest()  method=PUT  url=http://couchdb:5984/myc/statedb_savepoint

couchdb      | [notice] 2018-05-28T22:32:20.286092Z nonode@nohost <0.17016.1> dc704d43f7 couchdb:5984 172.23.0.4 undefined GET /myc/statedb_savepoint?attachments=true 200 ok 1

peer         | 2018-05-28 22:32:20.286 UTC [couchdb] handleRequest -> DEBU eb6 HTTP Request: PUT /myc/statedb_savepoint HTTP/1.1 | Host: couchdb:5984 | User-Agent: Go-http-client/1.1 | Content-Length: 201 | Accept: application/json | Content-Type: application/json | If-Match: 7-36059781f44b5d8961b60fb9a0377caa | Accept-Encoding: gzip |  |

peer         | 2018-05-28 22:32:20.289 UTC [couchdb] handleRequest -> DEBU eb7 Exiting handleRequest()

couchdb      | [notice] 2018-05-28T22:32:20.289187Z nonode@nohost <0.17016.1> 5f74586a23 couchdb:5984 172.23.0.4 undefined PUT /myc/statedb_savepoint 201 ok 2

peer         | 2018-05-28 22:32:20.289 UTC [couchdb] SaveDoc -> DEBU eb8 Exiting SaveDoc()

peer         | 2018-05-28 22:32:20.289 UTC [lockbasedtxmgr] Commit -> DEBU eb9 Updates committed to state database

peer         | 2018-05-28 22:32:20.289 UTC [historyleveldb] Commit -> DEBU eba Channel [myc]: Updating history database for blockNo [7] with [1] transactions

peer         | 2018-05-28 22:32:20.291 UTC [historyleveldb] Commit -> DEBU ebb Channel [myc]: Updates committed to history database for blockNo [7]

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU ebc Entry

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU ebd Channel [myc]: Block event for block number [7] contains transaction id: ec4752e939d4e587f9ec6c27e08137892e803a7ce009ad1b01a9cfbc4f97a024

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] SendProducerBlockEvent -> INFO ebe Channel [myc]: Sending event for block number [7]

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] Send -> DEBU ebf Entry

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] Send -> DEBU ec0 Event processor timeout > 0

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] Send -> DEBU ec1 Event sent successfully

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] Send -> DEBU ec2 Exit

peer         | 2018-05-28 22:32:20.291 UTC [eventhub_producer] SendProducerBlockEvent -> DEBU ec3 Exit

docker exec -it cli bash

esumits-MacBook-Pro:~ esumit$ docker exec -it chaincode bash

root@aae170ee0c2e:/opt/gopath/src/chaincode# ls

abac  chaincode_example02  fabcar  marbles02  sacc

root@aae170ee0c2e:/opt/gopath/src/chaincode# cd marbles02/

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02# ls

go  node

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02# cd go

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go# ls

META-INF 

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go# go build

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go# CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./go                 

2018-05-28 21:47:23.644 UTC [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO

2018-05-28 21:47:23.644 UTC [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up …

2018-05-28 21:47:26.645 UTC [shim] userChaincodeStreamGetter -> ERRO 003 Error trying to connect to local peer: context deadline exceeded

Error starting Simple chaincode: Error trying to connect to local peer: context deadline exceededroot@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go#

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go#

root@aae170ee0c2e:/opt/gopath/src/chaincode/marbles02/go# CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc:0 ./go

2018-05-28 21:47:36.308 UTC [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO

2018-05-28 21:47:36.308 UTC [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up …

invoke is running initMarble

– start init marble

– end init marble

invoke is running initMarble

– start init marble

– end init marble

invoke is running initMarble

– start init marble

– end init marble

invoke is running initMarble

– start init marble

– end init marble

invoke is running initMarble

– start init marble

This marble already exists: marble4

invoke is running initMarble

– start init marble

– end init marble

invoke is running initMarble

– start init marble

– end init marble

invoke is running transferMarblesBasedOnColor

– start transferMarblesBasedOnColor  silver john

– found a marble from index:color~name color:silver name:marble6

– start transferMarble  marble6 john

– end transferMarble (success)

– found a marble from index:color~name color:silver name:marble7

– start transferMarble  marble7 john

– end transferMarble (success)

– end transferMarblesBasedOnColor: Transferred 2 silver marbles to john

invoke is running transferMarblesBasedOnColor

– start transferMarblesBasedOnColor  silver john

– found a marble from index:color~name color:silver name:marble6

– start transferMarble  marble6 john

– end transferMarble (success)

– found a marble from index:color~name color:silver name:marble7

– start transferMarble  marble7 john

– end transferMarble (success)

– end transferMarblesBasedOnColor: Transferred 2 silver marbles to john

invoke is running transferMarblesBasedOnColor

– start transferMarblesBasedOnColor  silver john

– found a marble from index:color~name color:silver name:marble6

– start transferMarble  marble6 john

– end transferMarble (success)

– found a marble from index:color~name color:silver name:marble7

– start transferMarble  marble7 john

– end transferMarble (success)

– end transferMarblesBasedOnColor: Transferred 2 silver marbles to john

invoke is running transferMarblesBasedOnColor

– start transferMarblesBasedOnColor  silver john

– found a marble from index:color~name color:silver name:marble6

– start transferMarble  marble6 john

– end transferMarble (success)

– found a marble from index:color~name color:silver name:marble7

– start transferMarble  marble7 john

– end transferMarble (success)

– end transferMarblesBasedOnColor: Transferred 2 silver marbles to john

invoke is running transferMarblesBasedOnColor

– start transferMarblesBasedOnColor  silver john

– found a marble from index:color~name color:silver name:marble6

– start transferMarble  marble6 john

– end transferMarble (success)

– found a marble from index:color~name color:silver name:marble7

– start transferMarble  marble7 john

– end transferMarble (success)

– end transferMarblesBasedOnColor: Transferred 2 silver marbles to john

invoke is running readMarble

invoke is running readMarble

invoke is running readMarble

invoke is running getMarbleByRange

invoke did not find func: getMarbleByRange

invoke is running getMarblesByRange

– getMarblesByRange queryResult:

[{“Key”:”marble2″, “Record”:{“color”:”red”,”docType”:”marble”,”name”:”marble2″,”owner”:”tom”,”size”:50}},{“Key”:”marble3″, “Record”:{“color”:”blue”,”docType”:”marble”,”name”:”marble3″,”owner”:”tom”,”size”:70}},{“Key”:”marble4″, “Record”:{“color”:”pink”,”docType”:”marble”,”name”:”marble4″,”owner”:”sumit”,”size”:70}},{“Key”:”marble5″, “Record”:{“color”:”diamond”,”docType”:”marble”,”name”:”marble5″,”owner”:”sumit”,”size”:70}},{“Key”:”marble6″, “Record”:{“color”:”silver”,”docType”:”marble”,”name”:”marble6″,”owner”:”john”,”size”:70}}]

docker exec -it chaincode bash

Running from :  root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# 

/opt/gopath/src/chaincodedev

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# history

    1  ls

    2  peer chaincode install -p chaincodedev/chaincode/chaincode_example02/go -n mycc -v 0

    3  peer chaincode invoke -C myc -n marbles -c ‘{“Args”:[“initMarble”,”marble1″,”blue”,”35″,”tom”]}’

    4  peer list

    5  peer help

    6  peer chaincode instantiate -n myc -v 0

    7  peer chaincode instantiate -n mycc -v 0 -c ‘{“Args”:[“init”,”a”,”100″,”b”,”200″]}’ -C myc

    8  peer chaincode invoke -C myc  -n mycc -c ‘{“Args”:[“initMarble”,”marble1″,”blue”,”35″,”tom”]}’

    9  peer chaincode invoke -C myc -n mycc -c ‘{“Args”:[“initMarble”,”marble2″,”red”,”50″,”tom”]}’

   10  peer chaincode invoke -C myc -n mycc -c ‘{“Args”:[“initMarble”,”marble3″,”blue”,”70″,”tom”]}’

   11  peer chaincode invoke -C myc -n mycc -c ‘{“Args”:[“initMarble”,”marble4″,”pink”,”70″,”sumit”]}’

   12  peer chaincode invoke -C myc -n mycc -c ‘{“Args”:[“initMarble”,”marble5″,”diamond”,”70″,”sumit”]}’

   13  peer chaincode invoke -C myc -n mycc -c ‘{“Args”:[“initMarble”,”marble6″,”silver”,”70″,”sumit”]}’

   14  history

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev#

 

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# peer chaincode query -C myc -n mycc -c ‘{“Args”:[“getMarblesByRange”,”marble1″,”marble7″]}’

2018-05-28 23:27:24.816 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP

2018-05-28 23:27:24.816 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity

2018-05-28 23:27:24.816 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc

2018-05-28 23:27:24.817 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc

2018-05-28 23:27:24.817 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0AB3070A6108031A0C08DCA0B2D80510…6D6172626C65310A076D6172626C6537

2018-05-28 23:27:24.817 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: C478FA295F0DFF4C32B39907495BBCE0A56EEAFB5F3E7A1580276A845D3A1EE9

Query Result: 

[
{
“Key”:”marble2″,
“Record”:{
“color”:”red”,
“docType”:”marble”,
“name”:”marble2″,
“owner”:”tom”,
“size”:50
}
},
{
“Key”:”marble3″,
“Record”:{
“color”:”blue”,
“docType”:”marble”,
“name”:”marble3″,
“owner”:”tom”,
“size”:70
}
},
{
“Key”:”marble4″,
“Record”:{
“color”:”pink”,
“docType”:”marble”,
“name”:”marble4″,
“owner”:”sumit”,
“size”:70
}
},
{
“Key”:”marble5″,
“Record”:{
“color”:”diamond”,
“docType”:”marble”,
“name”:”marble5″,
“owner”:”sumit”,
“size”:70
}
},
{
“Key”:”marble6″,
“Record”:{
“color”:”silver”,
“docType”:”marble”,
“name”:”marble6″,
“owner”:”john”,
“size”:70
}
}
]

2018-05-28 23:27:24.842 UTC [main] main -> INFO 007 Exiting…..

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev#

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# peer chaincode query -C myc -n mycc -c ‘{“Args”:[“queryMarblesByOwner”,”tom”]}’

2018-05-28 23:41:37.239 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP

2018-05-28 23:41:37.239 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity

2018-05-28 23:41:37.239 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc

2018-05-28 23:41:37.239 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc

2018-05-28 23:41:37.239 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0AB2070A6008031A0B08B1A7B2D80510…626C657342794F776E65720A03746F6D

2018-05-28 23:41:37.239 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: FD9C8EE28FBDD82F4840EB0F8308A18431549B5153247530073CEB99FC8CA934

Query Result: [{“Key”:”marble2″, “Record”:{“color”:”red”,”docType”:”marble”,”name”:”marble2″,”owner”:”tom”,”size”:50}},{“Key”:”marble3″, “Record”:{“color”:”blue”,”docType”:”marble”,”name”:”marble3″,”owner”:”tom”,”size”:70}}]

2018-05-28 23:41:37.343 UTC [main] main -> INFO 007 Exiting…..

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev#

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# peer chaincode query -C myc -n mycc -c ‘{“Args”:[“queryMarblesByOwner”,”sumit”]}’

2018-05-28 23:41:45.848 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP

2018-05-28 23:41:45.848 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity

2018-05-28 23:41:45.849 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc

2018-05-28 23:41:45.849 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc

2018-05-28 23:41:45.849 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0AB3070A6108031A0C08B9A7B2D80510…657342794F776E65720A0573756D6974

2018-05-28 23:41:45.849 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: BA39A3F91476FBD23431A8AC9558937B0946BA849336BDAC3256BD2A56CF9A67

Query Result: [{“Key”:”marble4″, “Record”:{“color”:”pink”,”docType”:”marble”,”name”:”marble4″,”owner”:”sumit”,”size”:70}},{“Key”:”marble5″, “Record”:{“color”:”diamond”,”docType”:”marble”,”name”:”marble5″,”owner”:”sumit”,”size”:70}}]

2018-05-28 23:41:45.874 UTC [main] main -> INFO 007 Exiting…..

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev#

 

 

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev# peer chaincode query -C myc -n mycc -c ‘{“Args”:[“getHistoryForMarble”,”marble1″]}’

2018-05-28 23:43:57.891 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP

2018-05-28 23:43:57.891 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity

2018-05-28 23:43:57.891 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc

2018-05-28 23:43:57.892 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc

2018-05-28 23:43:57.892 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0AB3070A6108031A0C08BDA8B2D80510…724D6172626C650A076D6172626C6531

2018-05-28 23:43:57.892 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 3B797DE50FA4CE7D5F64CD665F6E6B5BC09FCDE16A5C3AA24AB1C7FDFDBB3620

Query Result: [{“TxId”:”175739bfb41e5945076fb6de3f3844323e567d860f52ac7e32360994fe8eac51″, “Value”:{“docType”:”marble”,”name”:”marble1″,”color”:”blue”,”size”:35,”owner”:”tom”}, “Timestamp”:”2018-05-28 22:27:39.468350997 +0000 UTC”, “IsDelete”:”false”},{“TxId”:”471b0578c07d6dc95d6e0806b23f874b4d1269689dca644a7f607c5c68f48443″, “Value”:null, “Timestamp”:”2018-05-28 23:19:47.122786103 +0000 UTC”, “IsDelete”:”true”}]

2018-05-28 23:43:57.908 UTC [main] main -> INFO 007 Exiting…..

root@6d82ea31bfcb:/opt/gopath/src/chaincodedev#

couchDB

http://localhost:5984/_utils/#database/mychannel_/_all_docs

http://localhost:5984/_utils/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s