Install and Upgrade Your Smart Contract

Your Smart Contract can be deployed fairly easily after you created the network.

Beware that if you are in a Multi-participant Network you will need approval from every participant.

How to

Zip your code

You will need your source code zipped in the right format to upload it to your network through Forma.

Here are the different ways to do it depending on which language or framework did you use.

Convector Smart Contract

When using Convector and generated your project with the CLI best practices you have to zip your code packaged folder (generated with the task cc :package ). That folder is usually named  chaincode -* whereas the * represents the name of your  chaincode .

That folder looks like the following image, so enter into the contents of that folder and zip them.

For JavaScript Smart Contracts without Convector

Zip all your code, including the  package.json.

For Golang Smart Contracts

Zip all your code just like with a JavaScript smart contract.

Install a new smart contract

Go to your Home screen and enter into your target Network details.

Select your target Ledger.

In the Ledger details page click on New to add a new form.

In this form you will set:

  • Chaincode identifier (name which will be used to install the Smart Contract). Spaces will be removed.
  • Message a message to the participants on why you are proposing this.
  • ZIP attachment with the code. Be sure that the code is in the root of the zip (mycode.zip/package.json, instead of mycode.zip/zip/package.json).
  • Programming language of your code.
  • Version: we recommend you start with version 1.
  • [Optional] First invokation message. In case you need params on your first invoke call (to set up something for example).

Just like creating a Network or a Ledger, wait for approval (if you are in a Multi-participant Network) and deploy!

It will take some minutes and will notify you once it's done by email.

If you receive a request like this, you can access the source code as well to verify what is proposed to be deployed.

Upgrade a smart contract

Similar to creating a new Smart Contract, get to the Ledger details screen, find the Smart Contract you'd like to upgrade, and click upgrade:

Fill the form as required and upload your source code. The approval process will repeat.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us