8

What happened exactly on chaincode deploy and invoke , query, in Hyperledger?

Need to confirm the cost of system on Chaincode deploy, invoke and query. If they are the same, seems better to make Chaincode more than one, even hundreds, thousands.

Will_Z
  • 258
  • 3
  • 15

1 Answers1

12

During “Deploy” the chain code is submitted to the ledger in a form of transaction and distributed to all nodes in the network. Each node creates new Docker container with this chaincode embedded. After that container will be started and Init method will be executed.

During “Query” - chain code will read the current state and send it back to user. This transaction is not saved in blockchain.

During “Invoke” - chaincode can modify the state of the variables in ledger. Each “Invoke” transaction will be added to the “block” in the ledger.

Sergey Balashevich
  • 2,101
  • 14
  • 11
  • It seems the size of new Docker container within chaincode embedded is more than 1G. How the "block" stored to the "Deploy" in the ledger? – Will_Z Jun 03 '16 at 12:44
  • 2
    Hyperledger keeps in ledger only chain-code’s sources. Validation peer loads source code from the ledger and creates Docker image locally. – Sergey Balashevich Jun 05 '16 at 07:17