Community Blog Hyperledger SDK for a Developing a Blockchain

Hyperledger SDK for a Developing a Blockchain

In this article, we will introduce the configuration on Alibaba Cloud Blockchain as a Service and how to get the hyperledger sdk for developing and deploying a chain code.

Hyperledger fabric is the core of blockchain implementation, but Composer gives us an easier way to create and understand the blockchain network. It provides more tools for business owners and developers to create smart contracts and blockchain applications to solve business problems. Built with technologies like JavaScript, leveraging modern tools including Node.js, npm, CLI and popular editors.

You can configure the services for the Blockchain as a Service (BaaS) and download the SDK with the following steps for developing and deploying a chain code:

1) Click "Quick Start" on "Overview" in Alibaba Cloud BaaS console to setup the consortium and fill all the information, then click "OK".
2) Click "Add Organization" with the organization name and domain, then click "Create". You can click on the organization for more information when the the organization is successfully created.
3) Click the "Add User" to create a user.
4) Click "Download SDK Configuration" and extract it.

Then for windows system:

5) Run the "bootstrap.sh" file with the following code.

cd <downloaded-SDK-rootpath>

6) Choose your preferred choice of SDK like Java SDK as below

已为您生成区块链网络的配置信息, 使用Fabric SDK 即可连接您的区块链网络。
Welcome to use aliyun blockchain as a service.
You can use fabric sdk with below connection profiles to operate fabric network.

由于不同 SDK 配置文件有一些差异,我们为您生成了不同 SDK 的配套配置文件: 
There are different format of connection profile for different fabric sdk: 
 - connection-profile.yaml: Golang SDK的配置文件 (For Golang fabric sdk)
 - connection-profile-standard.yaml: Java/Node SDK的配置文件 (For Java/Nodejs fabric sdk in yaml format)
 - connection-profile-standard.json: Json格式,Java/Node/Python 等SDK可以使用 (For Java/Nodejs fabric sdk in json format)

Please input the language of sdk to download [1-3],to exit input [4]:
-e [-] 1. Golang
-e [-] 2. Java
-e [-] 3. Nodejs
-e [-] 4. 退出(Exit)
请选择1-4中的其中一项(please input 1-4):2
-e [-] 开始下载 fabric-sdk-java 示例程序到目录: <downloaded-SDK-rootpath>
-e [-] Going to download fabric-sdk-java demo application into path: <downloaded-SDK-rootpath>
-e [-] 下载完成,您可以通过 https://help.aliyun.com/document_detail/88774.html 了解详细使用方法
-e [-] Downloading finished,you can find more information about how to use the demo application from: https://help.aliyun.com/document_detail/88774.html
-e [-] Happy Hacking! 

For Linux/MAC systems:

5) Open bootstrap.sh and replace with the below content.

## replace this
## wget -q https://baas-sdk.oss-cn-hangzhou.aliyuncs.com/installer.sh -O installer.sh && bash installer.sh

curl -0 https://baas-sdk.oss-cn-hangzhou.aliyuncs.com/installer.sh -o installer.sh && sh installer.sh

Once you run this command, you will see the installer.sh also gets downloaded, we need to edit that too, replace the wget commands with curl commands

# replace wget -q $GOSDK -O golang.tar.gz
  curl -0 $GOSDK -o golang.tar.gz
# replace wget -q $JAVASDK -O java-sdk.tar.gz
  curl -0 $JAVASDK -o java-sdk.tar.gz
# replace wget -q $NODESDK -O node-sdk.tar.gz
  curl -0 $NODESDK -o node-sdk.tar.gz

If the tar command failed, please unzip it.

For more details, you can go to Alibaba Cloud BaaS - Part II: Blockchain as a Service with Hyperledger Composer. For how to develop and deploy a chain code, you can click here.

Related Blog Posts

Build Your Own Blockchain with JavaScript

You may think that blockchain is far bit too complicated for you to handle. Well, actually, it isn't all that bad if you think about blockchain from a more fundamental and conceptual level. Today, in this article, we're going to cover some the basics about blockchain, and show you how you can use Javascript to build your own blockchain system, just by writing a couple of lines of code to describe your blockchain, including the underlying data structure, PoW mining, and transaction process. Of course, real scenarios where you build your own blockchain are far more complex than this.

As its name suggests, a blockchain is a chain of blocks, and so the basic data structure of a blockchain is a block. The content of a block includes such information as a timestamp, data, hash, and previousHash. Among these components, the data portion is used to store data, naturally, and previousHash serves to store the hash value of the previous block.

7 Best Practices of Using Alibaba Cloud Container Service to Develop Blockchain Hyperledger Fabric Solutions

Alibaba Cloud Container Service allows users to deploy and configure a blockchain Hyperledger automatically with the blockchain solution, or through a manual, self-built approach. In this article, we will be exploring the best practices of using Alibaba Cloud Container Service to develop blockchain applications and solutions based on Hyperledger Fabric.

  1. Best Practice 1: Generate Sample YAML for Hyperledger Fabric Deployment in Kubernetes
  2. Best Practice 2: Select Storage for the Deployed Blockchain
  3. Best Practice 3: Select a Billing Method for the Deployed Blockchain
  4. Best Practice 4: Select a Region for the Deployed Blockchain
  5. Best Practice 5: Allow Access to Blockchain Services from Public Networks
  6. Best Practice 6: Troubleshooting the "Connection Reset by Peer" Message in the Blockchain Log
  7. Best Practice 7: Troubleshooting the Error "x509: Certificate Has Expired or Is Not Yet Valid" during Blockchain SDK Application Access

Related Documentation

Java SDK Introduction

The Java SDK of the smart contract platform of Ant Blockchain provides multiple services, including account services, contract services, event services, query services, and local services. With this SDK, you can call synchronous or asynchronous operations to send transactions, query transactions, or subscribe to events. For synchronous or asynchronous transactions, the SDK enables you to query receipts after the transaction is sent. This allows you to check the transaction results with ease.

Use Fabric Java SDK - Blockchain as a Service

This Document will introduce a sample program using Fabric Java SDK.

Related Products

Blockchain as a Service

Blockchain as a Service (BaaS) is an enterprise-level platform service based on leading blockchain technologies. This service helps you build a secure and stable blockchain environment, save the costs of operations and maintenance, and facilitate business development. BaaS supports Hyperledger Fabric, Ant Blockchain technologies, and Quorum.

Container Service

Container Service is a high-performance and scalable container application management service that enables you to use Docker and Kubernetes to manage the lifecycle of containerized applications

0 0 0
Share on

Alibaba Clouder

1,912 posts | 413 followers

You may also like