Skip to content

Instantly share code, notes, and snippets.

View arnabkaycee's full-sized avatar
🙃
Focusing out of the Box

Arnab Chatterjee arnabkaycee

🙃
Focusing out of the Box
View GitHub Profile
@arnabkaycee
arnabkaycee / MerkleRoot.md
Created January 13, 2021 13:22
Merkle Root
package com.arnabchatterjee.core;

import com.arnabchatterjee.beans.KVPair;
import com.arnabchatterjee.beans.LeafNode;
import com.arnabchatterjee.beans.Node;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.bouncycastle.util.encoders.Hex;
@arnabkaycee
arnabkaycee / hlf-chaincode-guidelines.md
Last active September 26, 2024 11:24
General Guidelines for writing Hyperledger Fabric Chaincodes.

General Guidelines for writing Hyperledger Fabric Chaincodes.

I believe smart-contracts (chaincodes) are the heart of any Blockchain Network. Written correctly can yeild many benefits and truly bring out the best in a secure blockchain network and have distratous effects if written inefficiently. Although I will not discuss about any specific goods and bads of Chaincode design, I will touch down a few guidelines which I experienced while doing some POC applications during my work. Without further ado, let's start.

Below are a few general guidelines / caveats that can be adhered to (although there are exceptions) while writing chaincodes. These I have particularly written for chaincodes written for Hyperledger fabric v.1.0 network in golang. But, I believe they can be extrapolated to chaincodes written in any language for Hyperledger Fabric.

Use Chaincode DevMode

To kickoff your development process, use the DevMode. I cannot emphasise enough, how important it is to use dev mode and save time and eff