Now that our network is online, the next step we need to do is write and deploy our chaincode contract. The chaincode DocsApp consists of the following methods:
- addDocHash: This method adds a new document hash to the blockchain. Document hashes are indexed by the hash of the file path.
- addParamHash: This method adds the FTH and the MTH to the blockchain indexed by a timestamp. The timestamp indicates the time at which the FTH and MTH were calculated and stored to the blockchain.
- queryDocHash: This method retrieves the last updated hash for a document using the hash of the file path.
- queryParamHash: This method retrieves the FTH and the MTH stored in the blockchain at a particular time using the timestamp indicating the time that it was stored.
We'll also have to install the chaincode for all the nodes that are part of our network...