Help Center > > Best Practices> Marble Asset Transfer (Demo)> Install and Instantiate a Chaincode

Install and Instantiate a Chaincode

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

Chaincodes must be installed on peers and then instantiated in the channel.

Install Chaincodes

  1. Download the sample chaincode file package marbles.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.
      • If you use the Internet Explorer, you may fail to open the Blockchain Management login page and see a message indicating that the certificate is untrusted. In this case, you can click here to resolve the problem.

  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 marbles.

    Chaincode Version

    Enter 1.0.

    Organization & Peer

    Select peer-0 under the organization org1.

    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

    Enter c12345.

    Chaincode Version

    Enter 1.0.

    Initialization Function

    Enter init.

    Chaincode Parameters

    Enter a, 200.

    Endorsement Policy

    Select Endorsement from any of the following organizations.

    Endorsing Organizations

    Select org1.

  3. Click Confirm.

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