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被墙,我 ...
随机推荐
- 设计模式之命令模式(Command)摘录
23种GOF设计模式一般分为三大类:创建型模式.结构型模式.行为模式. 创建型模式抽象了实例化过程,它们帮助一个系统独立于怎样创建.组合和表示它的那些对象.一个类创建型模式使用继承改变被实例化的类,而 ...
- Erlang进程堆垃圾回收机制
原文:Erlang进程堆垃圾回收机制 作者:http://blog.csdn.net/mycwq 每一个Erlang进程创建之后都会有自己的PCB,栈,私有堆.erlang不知道他创建的进程会用到哪种 ...
- const *char p和char const *p
const *char p和char const *p,const char*p的区别 char*const p——p必须初始化,且不能指向别处,即p是指针常量: char const*p——p指向的 ...
- Qt5官方demo解析集13——Qt Quick Particles Examples - Image Particles
本系列全部文章能够在这里查看http://blog.csdn.net/cloud_castle/article/category/2123873 接上文 Qt5官方demo解析集12--Qt Quic ...
- centos笔记-安装特定版本的mysql
centos6的yum默认安装的mysql是5.1版, 如果要安装5.6.16 版,有三个办法 1.yum方式, 这个方式的好处是通过yum安装卸载都很方便,坏处是版本无法详细制定,比如官方版本yum ...
- 防sql注入 盲注等措施 ESAPI的使用
SQL注入往往是在程序员编写包含用户输入的动态数据库查询时产生的,但其实防范SQL注入的方法非常简单.程序员只要a)不再写动态查询,或b)防止用户输入包含能够破坏查询逻辑的恶意SQL语句,就能够防范S ...
- iOS 声明属性关键字的总结
atomic: 原子操作(原子性是指事务的一个完整操作,操作成功就提交,反之就回滚. 原子操作就是指具有原子性的操作)在objective-c 属性设置里面 默认的就是atomic ,意思就是 set ...
- mysql----其他小技巧
小技巧: min/max优化 在表中,一般都是经过优化的. 如下地区表 id area pid 1 中国 0 2 北京 1 ... 3115 3113 我们查min(id), id是主键,查Min(i ...
- redis07-----Redis持久化配置
Redis持久化配置 持久化: 即把数据存储于断电后不会丢失的设备中,通常是硬盘. 常见的持久化方式: 主从:通过从服务器保存和持久化,如mongoDB的replication sets配置. 淘宝是 ...
- HDU3746 Cyclic Nacklace —— KMP 最小循环节
题目链接:https://vjudge.net/problem/HDU-3746 Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) M ...