Help Center > > Best Practices> Opening an Interbank Account (Demo)> Install and Instantiate a Chaincode

Install and Instantiate a Chaincode

Updated at: Aug 05, 2019 GMT+08:00

A chaincode must be installed on all peers in a channel and instantiated on any one peer. To use the same chaincode, channel members must specify the same name and version for the chaincode when installing it.

Install Chaincodes

  1. Download the sample chaincode file package fabbank.zip.
  2. Log in to the Blockchain Management page.

    1. Log in to the BCS console.
    2. Click Manage Blockchain in the Operation column of the service list.
    3. On the login page, enter the username, password, and verification code, and click Log In.
      NOTE:

      The username is admin, and the initial login password is the password set when you buy the BCS service. To ensure the system security, change the password periodically.

  3. Click in the upper left corner of the page.
  4. On the Install Chaincode page, enter the chaincode name and version number, select the peers where the chaincode is to be installed, specify the programming language of the chaincode, and add the chaincode file, as described in the following table.

    Table 1 Parameters

    Parameter

    Setting

    Chaincode Name

    Enter fabbank.

    Chaincode Version

    Enter 1.0.

    Organization & Peer

    Select all peers.

    Language

    Select Golang.

    Chaincode File

    Add the chaincode file package downloaded in step 1.

    Chaincode Description

    Enter a description of the chaincode.

  5. Click Install to install the chaincode.

Instantiate Chaincodes

  1. After installing chaincodes, click Instantiate in the Operation column of the chaincode list.
  2. Specify the channel for instantiation, chaincode version, endorsement policy, endorsing organizations, initialization function and chaincode parameters.

    Table 2 Parameters

    Parameter

    Setting

    Channel

    Select testchannel.

    Chaincode Version

    Select 1.0.

    Initialization Function

    Enter init.

    Chaincode Parameters

    Enter 0.

    Endorsement Policy

    Select Endorsement from any of the following organizations.

    Endorsing Organizations

    Select all the three organizations.

  3. Click Instantiate. Wait 2 to 3 minutes for the instantiation on the specified channel to complete.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel