The IBM Blockchain Platform:Installing the development environment
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
npmand 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-composer, composer-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.
Essential CLI tools:
Copynpm install -g composer-cli
Utility for running a REST Server on your machine to expose your business networks as RESTful APIs:
Copynpm install -g composer-rest-server
Useful utility for generating application assets:
Copynpm install -g generator-hyperledger-composer
Yeoman is a tool for generating applications, which utilises
generator-hyperledger-composer:Copynpm 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.
Browser app for simple editing and testing Business Networks:
Copynpm 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.
Install VSCode from this URL: https://code.visualstudio.com/download
Open VSCode, go to Extensions, then search for and install the
Hyperledger Composerextension from the Marketplace.
Step 4: Install Hyperledger Fabric
This step gives you a local Hyperledger Fabric runtime to deploy your business networks to.
In a directory of your choice (we will assume
~/fabric-tools), get the.zipfile that contains the tools to install Hyperledger Fabric:Copymkdir ~/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
A
tar.gzis also available if you prefer: just replace the.zipfile withfabric-dev-servers.tar.gz1and theunzipcommand with atar xvzfcommand in the above snippet.Use the scripts you just downloaded and extracted to download a local Hyperledger Fabric runtime:
Copycd ~/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:
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:
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?
- Learn how to use the web app UI with the Playground Tutorial
- Learn how to use the CLI and VSCode tools with the Developer Tutorial
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:
docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)
The IBM Blockchain Platform:Installing the development environment的更多相关文章
- The IBM Blockchain Platform: Develop pre-requisites
Installing pre-requisites The IBM Blockchain Platform: Develop pre-requisites can be installed on Ub ...
- 使用IBM Blockchain Platform extension开发你的第一个fabric智能合约
文章目录 安装IBM Blockchain Platform extension for VS Code 创建一个智能合约项目 理解智能合约 打包智能合约 Local Fabric Ops 安装智能合 ...
- 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 ...
- storm环境搭建(前言)—— 翻译 Setting Up a Development Environment
Setting Up a Development Environment 搭建storm开发环境所需步骤: Download a Storm release , unpack it, and put ...
- Storm(1) - Setting Up Development Environment
Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...
- 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 ...
- Install Qualcomm Development Environment
安裝 Android Development Environment http://www.cnblogs.com/youchihwang/p/6645880.html 除了上述還得安裝, sudo ...
- 1.3 PROGRAM DEVELOPMENT ENVIRONMENT
1.3 PROGRAM DEVELOPMENT ENVIRONMENT 1.4 WIN32 EXECUTEABLE FILE FORMAT We should also know that compl ...
- The Google Test and Development Environment (持续更新)
最近Google Testing Blog上开始连载The Google Test and Development Environment(Google的测试和开发环境),因为blogspot被墙,我 ...
随机推荐
- 有方向的运动js
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8 ...
- 基于Office 365 无代码工作流分析-表单基本需求分析!
3.2表单的制作 基于下图的需求,我们须要定义例如以下的表单列表:
- 线程特定数据TSD总结
一线程的本质 二线程模型的引入 三线程特定数据 四关键函数说明 五刨根问底啥原理 六私有数据使用演示样例 七參考文档 一.线程的本质 Linux线程又称轻量进程(LWP),也就说线程本质是用进程之间共 ...
- 【转载】TCP粘包问题分析和解决(全)
TCP通信粘包问题分析和解决(全) 在socket网络程序中,TCP和UDP分别是面向连接和非面向连接的.因此TCP的socket编程,收发两端(客户端和服务器端)都要有成对的socket,因此,发送 ...
- centos6.3升级python至2.7.5
centos6.3自带的python版本是2.6.6,有时候需要升级到2.7.这里记录一下升级过程,方便查阅.实际上是转载自http://flyingdutchman.iteye.com/blog/1 ...
- python基础小练习
def main(): number = int(input("请输入学生的总人数:")) # 输入要录入的学生总数 count = number # 用一个变量来保存这个学生总数 ...
- Arrays.asList基本用法
目录 说明 基本用法 陷阱 改观 说明 asList 是 java.util.Arrays 类的一个方法 public static <T> List<T> asList(T. ...
- iOS--判断字符串NSString中数字、中文、大小写英文
iOS--判断字符串NSString中数字.中文.大小写英文 <iframe id="iframeu2051914_0" src="http://pos.bai ...
- vs2010 msvcr100.DLL 丢失!!! 用release 就可以了
- Python 005- 使用Pyecharts来绘制各种各样的图形
本文转载自:https://blog.csdn.net/qq_39143076/article/details/79065448,如有侵权,请联系删除啊 如何做Python 的数据可视化? pyech ...