Follow these instructions to obtain the IBM Blockchain Platform: Develop development tools (primarily used to create Business Networks) and stand up a Hyperledger Fabric (primarily used to run/deploy your Business Networks locally). Note that the Business Networks you create can also be deployed to Hyperledger Fabric runtimes in other environments e.g. on a cloud platform.

Before you begin

Make sure you have installed the required pre-requisites, following the instructions in Installing pre-requisites.

These instructions assume that you've not installed the tools and used them before. If this is not the case, you might want to check that your previous setup is completely destroyed before you start following this guide. To learn how to do this, skip to the Appendix.

To provide flexibility and enable the maximum number of dev, test and deployment scenarios, Blockchain Platform is delivered as a set of components you can install with npm and control from the CLI. These instructions will tell you how to install everything first, then how to control your development environment.

Installing components

Step 1: Install the CLI tools

There are a few useful CLI tools for Blockchain Platform developers. The most important one is composer-cli, which contains all the essential operations, so we'll install that first. Next, we'll also pick up generator-hyperledger-composercomposer-rest-server and Yeoman plus the generator-hyperledger-composer. Those last 3 are not core parts of the development environment, but they'll be useful if you're following the tutorials or developing applications that interact with your Business Network, so we'll get them installed now.

  1. Essential CLI tools:

    Copy

    npm install -g composer-cli
  2. Utility for running a REST Server on your machine to expose your business networks as RESTful APIs:

    Copy

    npm install -g composer-rest-server
  3. Useful utility for generating application assets:

    Copy

    npm install -g generator-hyperledger-composer
  4. Yeoman is a tool for generating applications, which utilises generator-hyperledger-composer:

    Copy

    npm install -g yo

Step 2: Install Playground

If you've already tried Blockchain Platform online, you'll have seen the browser app "Playground". You can run this locally on your development machine too, giving you a UI for viewing and demonstrating your business networks.

  1. Browser app for simple editing and testing Business Networks:

    Copy

    npm install -g composer-playground

Step 3: Set up your IDE

Whilst the browser app can be used to work on your Business Network code, most users will prefer to work in an IDE. Our favourite is VSCode, because a Blockchain Platform extension is available.

  1. Install VSCode from this URL: https://code.visualstudio.com/download

  2. Open VSCode, go to Extensions, then search for and install the Hyperledger Composer extension from the Marketplace.

Step 4: Install Hyperledger Fabric

This step gives you a local Hyperledger Fabric runtime to deploy your business networks to.

  1. In a directory of your choice (we will assume ~/fabric-tools), get the .zip file that contains the tools to install Hyperledger Fabric:

    Copy

    mkdir ~/fabric-tools && cd ~/fabric-tools
    
    curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.zip
    unzip fabric-dev-servers.zip

    tar.gz is also available if you prefer: just replace the .zip file with fabric-dev-servers.tar.gz1 and the unzip command with a tar xvzf command in the above snippet.

  2. Use the scripts you just downloaded and extracted to download a local Hyperledger Fabric runtime:

    Copy

    cd ~/fabric-tools
    ./downloadFabric.sh

Congratulations, you've now installed everything required for the typical Developer Environment. Read on to learn some of the most common things you'll do with this environment to develop and test your Blockchain Business Networks.

Controlling your dev environment

Starting and stopping Hyperledger Fabric

You control your runtime using a set of scripts which you'll find in ~/fabric-tools if you followed the suggested defaults.

The first time you start up a new runtime, you'll need to run the start script, then generate a PeerAdmin card:

Copy

    cd ~/fabric-tools
./startFabric.sh
./createPeerAdminCard.sh

You can start and stop your runtime using ~/fabric-tools/stopFabric.sh, and start it again with ~/fabric-tools/startFabric.sh.

At the end of your development session, you run ~/fabric-tools/stopFabric.sh and then ~/fabric-tools/teardownFabric.sh. Note that if you've run the teardown script, the next time you start the runtime, you'll need to create a new PeerAdmin card just like you did on first time startup.

The local runtime is intended to be frequently started, stopped and torn down, for development use. If you're looking for a runtime with more persistent state, you'll want to run one outside of the dev environment, and deploy Business Networks to it. Examples of this include running it via Kubernetes, or on a managed platform such as IBM Cloud.

Start the web app ("Playground")

To start the web app, run:

Copy

    composer-playground

It will typically open your browser automatically, at the following address: http://localhost:8080/login

You should see the PeerAdmin@hlfv1 Card you created with the createPeerAdminCard script on your "My Business Networks" screen in the web app: if you don't see this, you may not have correctly started up your runtime!

Congratulations, you've got all the components running, and you also know how to stop and tear them down when you're done with your dev session.

What Next?

Appendix: destroy a previous setup

If you've previously used an older version of IBM Blockchain Platform: Develop and are now setting up a new install, you may want to kill and remove all previous Docker containers, which you can do with these commands:

Copy

    docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)

The IBM Blockchain Platform:Installing the development environment的更多相关文章

  1. The IBM Blockchain Platform: Develop pre-requisites

    Installing pre-requisites The IBM Blockchain Platform: Develop pre-requisites can be installed on Ub ...

  2. 使用IBM Blockchain Platform extension开发你的第一个fabric智能合约

    文章目录 安装IBM Blockchain Platform extension for VS Code 创建一个智能合约项目 理解智能合约 打包智能合约 Local Fabric Ops 安装智能合 ...

  3. Programming in Go (Golang) – Setting up a Mac OS X Development Environment

    http://www.distilnetworks.com/setup-go-golang-ide-for-mac-os-x/#.V1Byrf50yM8 Programming in Go (Gola ...

  4. storm环境搭建(前言)—— 翻译 Setting Up a Development Environment

    Setting Up a Development Environment 搭建storm开发环境所需步骤: Download a Storm release , unpack it, and put ...

  5. Storm(1) - Setting Up Development Environment

    Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...

  6. Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment:

    Administrator@DESKTOP-EHCTIOR MINGW64 /d/react-native-eyepetizer (master) $ react-native run-android ...

  7. Install Qualcomm Development Environment

    安裝 Android Development Environment http://www.cnblogs.com/youchihwang/p/6645880.html 除了上述還得安裝, sudo ...

  8. 1.3 PROGRAM DEVELOPMENT ENVIRONMENT

    1.3 PROGRAM DEVELOPMENT ENVIRONMENT 1.4 WIN32 EXECUTEABLE FILE FORMAT We should also know that compl ...

  9. The Google Test and Development Environment (持续更新)

    最近Google Testing Blog上开始连载The Google Test and Development Environment(Google的测试和开发环境),因为blogspot被墙,我 ...

随机推荐

  1. DeepFM

    DeepFM integrates the architectures of FM and deep neural networks (DNN). It models low-order featur ...

  2. virtualenv 配置python3环境

    virtualenv -p /usr/bin/python3 py3env source py3env/bin/activate pip install package-name

  3. c++ struct与class的差别

    从语法上,在C++中(仅仅讨论C++中).class和struct做类型定义时仅仅有两点差别: (一)默认继承权限. 假设不明白指定,来自class的继承依照private继承处理.来自struct的 ...

  4. linux nc,nmap,telnet ,natstat命令

    说明 在服务器运维中 通常需要知道 机器端口状态 是否开启 是否被防火墙拦截等.今天我们介绍这三个命令 用来检测端口. nc 命令 / TCP # 安装 yum install -y nc nc 命令 ...

  5. 实现多线程的方式Runnable

    package com.thread.runnable; /** * 实现多线程的方式有继承Thread类和实现Runnable接口两种方式 * 哪种方式更好呢?实现的方式由于继承的方式. * 原因: ...

  6. no matching provisioning profiles found

    问题:真机连上,执行这个提示. 解决: 项目->targets->Bulid Settings-> 1,Provisioning Profile->选择配置Bundle Ide ...

  7. 【前端JS】radio 可单选可点击取消选中

    普通情况下 radio 单选框仅仅能实现多选一的效果,可是一旦选择当中一个后,这个单选框就不可点击取消其选中状态了.这样的功能在某些业务环境下并不适用.有时我们既须要单选框的多选一效果.也须要复选框的 ...

  8. openwrt 实现hotplug-button

    <*> kmod-gpio-button-hotplug................Simple GPIO Button Hotplug driver gpio-button-hotp ...

  9. 在DataGridView控件中实现冻结列分界线

    我们在使用Office Excel的时候,有很多时候需要冻结行或者列.这时,Excel会在冻结的行列和非冻结的区域之间绘制上一条明显的黑线.如下图: (图1) WinForm下的DataGridVie ...

  10. python day-15 匿名函数 sorted ()函数 filter()函数 map()函数 递归 二分法

    一.匿名函数 匿名函数的结构:变量   =  lamda  参数: 返回值 a  =  lamda  x : x*x       # x为参数,   : 后边的为函数体 print(a(x)) def ...