ChaincodeDevs
[1.4] How to create a smart contract using IBM Blockchain VS Code plugin - Printable Version

+- ChaincodeDevs (https://chaincodedevs.com)
+-- Forum: Hyperledger Fabric (https://chaincodedevs.com/forumdisplay.php?fid=1)
+--- Forum: Tutorials (https://chaincodedevs.com/forumdisplay.php?fid=4)
+--- Thread: [1.4] How to create a smart contract using IBM Blockchain VS Code plugin (/showthread.php?tid=478)



[1.4] How to create a smart contract using IBM Blockchain VS Code plugin - admin - 07-09-2019

In this tutorial I will show you how to install and create a smart contract using the "IBM Blockchain Platform" VS Code extension.

Step 1: Install VS Code
If you don't already have VS Code installed, download it from here. VS Code works on all major operating systems (Windows, Mac OS X, Linux).

Step 2: Install the "IBM Blockchain Platform" extension
Now that you have VS Code installed, start the application. From there, press "View" and then "Extensions".

[Image: attachment.php?aid=92]

Now search for "IBM Blockchain Platform" and press install.

Step 3: Instantiate a smart contract
After the extension installation is complete, hold "CTRL + Shift + P". This shortcut will open up the command pallet.

Copy this into your command search:

Code:
>IBM Blockchain Platform: Create Smart Contract Project


You will be asked to choose the smart contract language, for this tutorial I will be using Javascript. The extension should generate an example project like this:
[Image: attachment.php?aid=93]



Step 4: Package the smart contract
To package our example smart contract, hold "CTRL + Shift + P". This will open up our command pallet again.
Copy this into your command pallet and press Enter:

Code:
>IBM Blockchain Platform: Package a Smart Contract Project
Step 5: Export the smart contract
Now it's time to export our smart contract .cds file. Go to the IBM Blockchain section of our extension.
[Image: attachment.php?aid=94]

You should see the newly packaged smart contract under "SMART CONTRACT PACKAGES."

[Image: attachment.php?aid=95]




Now right click and press "Export package." You have just created your first smart contract using the IBM Blockchain Platform extension.