Smart contracts IDE
  • 10 Aug 2022
  • 1 Minute to read
  • Dark
    Light

Smart contracts IDE

  • Dark
    Light

The SettleMint IDE is the only tool you need to edit the smart contract set template you have selected, or write new smart contracts. The programming language used for your Hyperledger Fabric smart contracts can be Go or Typescript.

Using the IDE

On the left, in the "Explorer" panel, you can see all the folders and files related to the smart contract set.

The smart contract files are located in the "src" folder. You can edit them, or use them as is if the template fits all your needs. You can have as many smart contract folders as you want, think of them as packages.

The "scripts" folder contains the executable files that enable packaging, installing, approving, committing, and if needed, initializing the smart contract package. These scripts execute against the blockchain node connected to the smart contract set.

The "node" folder contains the node's configuration files, core.yaml and configtx.yaml. This folder is set as the FABRIC_CFG_PATH environment variable in your IDE.

The "network" folder contains the network's configuration files, CA certificates for the orderer and peer nodes.

Yarn scripts

On the left, in the "Task Manager" panel, you can run predefined yarn scripts such as:

"chaincode:package" to package the smart contract code into a gzipped tar file and store it in the smart contract folder.

"chaincode:install" to install the chaincode definition on the peer node.

"chaincode:approve" to approve for your organization the chaincode definition previously installed on the peer node.

"chaincode:check-commit" to check the approval status of the chaincode definition.

"chaincode:commit" to commit the chaincode definition. Run this task when a sufficient number of channel members have approved the chaincode definition. If the chaincode definition has been approved by the majority (or all, it depends on the network's configuration) of the channel members, it will commit the chaicode definition.

"chaincode:invoke-init" to initialize the chaincode. Run this task when the chaincode definition has been committed and if it has an init function. Adjust (if needed) the arguments passed to the init function in the ./scripts/invoke-init-chaincode.sh file.

You can view and explore these scripts in the package.json file in the project root. In case the Task Manager does not load, you can execute these scripts in the terminal integrated with the IDE by running yarn name-of-script.
For example, to run the chaincode:package task using the terminal, open a new terminal and run the command yarn chaincode:package.


Was this article helpful?

What's Next