Search code examples
hyperledger-fabrichyperledgerblockchaincryptocurrency

Can I query Hyperledger Fabric ledger or update ledger without chaincode in peer?


I have simple question about Hyperledger Fabric. so here is my question:

I know that for committing peers (ordinary peers) it's not 100% necessary to have chaincode installed, but every peer should have ledger and that's 100% necessary.

so suppose I am committing peer and I have not chaincode installed, but I have ledger of course. Now new block arrives from ordering peer.

1) I should check blocks validity, so I need to query ledger

2) I should add this block, so I need to update ledger.

So how can I do this two above without chaincode? Isn't chaincode necessary for above operations? (query and update)


Solution

  • To check the transaction/block's validity, the peer does not need to have the chaincode, the readwrite set available in the transaction is compared against the ledger (available in all peer) to decide the validity.

    And adding the block to the ledger is not dependent upon the validity check. If it was found invalid, it will still be added to the ledger but with an invalid tag.