7

I see lots of word "shim" in Hyperledger fabric chaincode samples like

func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {

which is imported from

import (
    "errors"
    "fmt"

    "github.com/hyperledger/fabric/core/chaincode/shim"
)

What is shim the abbreviation of?

1 Answers1

13

Shim in computing is used when referring to adapting software layers between different interfaces/components. In the context of Hyperledger Fabric, Shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes. Shim contains the generic means for chaincode and validating peer to communicate with each other.

For more information, you can check Chaincode Protocol specification

  • 3
    The link for Chaincode Protocol Specification doesn't work, the following might be its alternative: https://github.com/hyperledger-archives/fabric/blob/master/docs/protocol-spec.md – Karimai Aug 05 '18 at 22:34