composer创建项目

Due to modern business demands, IBM joined hands with other companies to develop an open-source business blockchain network called Hyperledger Fabric project that is touching the sky. Due to modular architecture, digital keys, and on-demand data retrieval, hyperledger fabric is regarded as the base for the world’s future modular architecture blockchain-based apps. Further benefits of Hyperledger Fabric are given below to facilitate your interpretation.

由于现代商业需求,IBM与其他公司携手开发了一个名为“ Hyperledger Fabric”项目的开源商业区块链网络。 由于模块化架构,数字密钥和按需数据检索,超账结构被视为全球未来基于区块链的模块化架构应用程序的基础。 Hyperledger Fabric的其他优点在下面给出,以方便您进行解释。

模块化结构 (Modular Structure)

Hyperledger Fabric makes easier for a developer to create their own pluggable components straight into the blockchain architecture. A developer will be able to introduce new modules whenever they need or desire. And, they don’t need to build the system from the beginning again. Syncrasy Tech IT solutions company can help you with blockchain development and Salesforce development services.

Hyperledger Fabric使开发人员更容易直接将自己的可插入组件创建到区块链架构中。 开发人员将能够在需要或需要时引入新模块。 而且,他们不需要从头开始构建系统。 Syncrasy Tech IT解决方案公司可以为您提供区块链开发和Salesforce开发服务。

PKC11数字钥匙 (PKC11 Digital Keys)

Hyperledger Fabric features modified and unmodified PKC11 for the generation of digital keys. These keys enhance data protection particularly. Think of a mortgage company using blockchain technology. A mortgage is not expected to be exposed publicly. It requires the parties to check themselves in the network to ensure authenticity. With a modular blockchain framework like Hyperledger Fabric, you can provide enough data of security needed in the sensitive data sections.

Hyperledger Fabric具有经过修改和未经修改的PKC11,用于生成数字密钥。 这些密钥特别增强了数据保护。 想想使用区块链技术的抵押公司。 抵押贷款不应公开。 它要求各方在网络中进行自我检查以确保真实性。 借助Hyperledger Fabric之类的模块化区块链框架,您可以在敏感数据部分中提供足够的安全性数据。

必要时进行数据检索 (Data Retrieving When Necessary)

Hyperledger Fabric’s channels have not been given the importance they deserve so far. Channels allow for data partitioning that makes it possible to keep the data safe that is supposed to be from a blockchain framework. This is useful where the finance company thinking about to adopt blockchain but competitors seeing the company’s data. With the help of channels on Hyperledger Fabric, you can store sensitive data in data partitions. Traditional/public blockchains are lacking this convenient feature.

到目前为止,Hyperledger Fabric的渠道还没有得到应有的重视。 通道允许进行数据分区,从而可以保持应该来自区块链框架的数据安全。 这在金融公司考虑采用区块链但竞争对手看到公司数据的情况下很有用。 借助Hyperledger Fabric上的通道,您可以将敏感数据存储在数据分区中。 传统/公共区块链缺少此便捷功能。

不可信任 (Indubitable Trust)

Hyperledger Fabric manages transactions differently and efficiently. It lessens the necessary number of trust layers and verifications through which a transaction goes. This makes transactions to go easier, done more quickly, and without any problem on any digital platform.

Hyperledger Fabric以不同的方式高效地管理事务。 它减少了交易通过的信任层和验证的必要数量。 这使交易变得更容易,更快地完成,并且在任何数字平台上都没有任何问题。

Hyperledger Fabric is an extensive topic, but for developers who are interested in blockchain application development will find this post helpful.

Hyperledger Fabric是一个广泛的主题,但是对于对区块链应用程序开发感兴趣的开发人员,这篇文章会有所帮助。

在这里,我正在谈论Hyperledger Composer的入门。 (Here I’m talking about getting started with Hyperledger Composer.)

Hyperledger Composer is my favorite tool for blockchain application development. Built on tools including node.js, CLI, npm, and editors, hyperledger composer offers sample apps as well as tools to test the DevOps process to create blockchain applications.

Hyperledger Composer是我最喜欢的区块链应用程序开发工具。 hyperledger composer基于包括node.js,CLI,npm和编辑器在内的工具构建,提供了示例应用程序以及测试DevOps流程以创建区块链应用程序的工具。

可以通过运行以下脚本来安装Hyperledger Composer: (Hyperledger Composer can be installed by running the following script:)

cd $HOME
curl -O -k
https://hyperledger.github.io/composer/latest/prereqs-ubuntu.h
chmod u+x prereqs-ubuntu.sh

运行以下命令以开始安装过程: (Run the following command to start the installation process:)

sudo apt-get install -y software-properties-common

安装过程需要准备好组件: (The installation process requires components ready:)

CLI工具 (CLI tools)

npm install -g composer-cli@0.20

操场 (Playground)

npm install -g composer-playground@0.20

超级账本面料 (Hyperledger Fabric)

mkdir ~/fabric-dev-servers && cd ~/fabric-dev-servers

集成开发环境 (IDEs)

You can use many IDEs with Hyperledger Composer. The two most common types are Atom and VS Code IDEs.

您可以将许多IDE与Hyperledger Composer一起使用。 两种最常见的类型是Atom和VS Code IDE。

Atom IDE (Atom IDE)

Download Atom IDE @ atom.io

下载Atom IDE @ atom.io

Atom is a free and open-source text editor IDE that helps you to write code faster with its feature smart-auto completion. It also supports cross-platform editing, thus, allow Atom to work across different operating systems. You can split codes into multiple panes to compare and edit codes across different files.

Atom是一个免费的开源文本编辑器IDE,可通过其智能自动完成功能帮助您更快地编写代码。 它还支持跨平台编辑,因此允许Atom在不同的操作系统上工作。 您可以将代码分成多个窗格,以比较和编辑不同文件中的代码。

将项目文件夹添加到Atom的步骤: (Steps to add project folder to Atom:)

Go to File Menu.

转到文件菜单。

Click on Add Project menu or press (ALT+CTRL+O).

单击添加项目菜单或按(ALT + CTRL + O)。

Specify the path of your folder and select the folder.

指定文件夹的路径,然后选择文件夹。

Create the ‘File’ by clicking on the ‘New File’ menu option.

通过单击“新文件”菜单选项创建“文件”。

这是在Atom中打开文件的方式: (This is how a file opened in Atom:)

在Atom中运行HTML文件的步骤: (Steps to run an HTML file in Atom:)

Right-click on the opened file.

右键单击打开的文件。

Open the “File” on the web browser.

在网络浏览器上打开“文件”。

Open the “Script-Runner” to run scripts inside Atom IDE.

打开“ Script-Runner”以在Atom IDE中运行脚本。

(Note: It supports CoffeeScript, Python, JavaScript, Bash, and Ruby)

(注意:它支持CoffeeScript,Python,JavaScript,Bash和Ruby)

VS代码 (VS Code)

Download Visual Studio Code IDE @ code.visualstudio.com/download

下载Visual Studio Code IDE @ code.visualstudio.com/download

Visual Studio supports the features of a source code editor with Intellisense code completion, tooling, debugging with breakpoints, call stacks, and an interactive console. The VS code for Hyperledger Composer helps you to become more productive with its syntax highlighting, easy customization, community-contributed keyboard shortcut mappings, box selection, and auto-indentation.

Visual Studio支持具有Intellisense代码完成功能,工具,带有断点的调试,调用堆栈和交互式控制台的源代码编辑器的功能。 Hyperledger Composer的VS代码通过其语法突出显示,轻松自定义,社区贡献的键盘快捷键映射,框选择和自动缩进来帮助您提高生产力。

我将引导您完成使用Hyperledger Composer创建区块链解决方案的步骤。 (I will walk you through the steps of creating a blockchain solution using Hyperledger Composer.)

The following steps will give you an overview of techniques to apply to your own development work:

以下步骤将概述适用于您自己的开发工作的技术:

Hyperledger Composer works for the key concept of business network definition (BND) that helps you create your blockchain solution in the easiest way possible.

Hyperledger Composer适用于业务网络定义(BND)的关键概念,可帮助您以最简单的方式创建区块链解决方案。

第1步 (Step 1)

The first step is to use the Yeoman generator to create the structure of a business network. Use this command to complete the step:

第一步是使用Yeoman生成器来创建业务网络的结构。 使用此命令完成步骤:

yo hyperledger-composer:businessnetwork

For command execution, you will require the name of the business network, author name, author email address. Simply enter tutorial-network.

为了执行命令,您将需要业务网络的名称,作者名称,作者电子邮件地址。 只需输入tutorial-network。

Enter — Apache 2.0 as license selection details.

输入-Apache 2.0作为许可证选择详细信息。

Enter the namespace by following this command;

按照以下命令输入名称空间;

rg.example.mynetwork

第2步 (Step 2)

The second step is about defining a business network that is made up of:

第二步是定义由以下组成的业务网络:

  • Participants参加者
  • Assets资产
  • Transactions交易次数
  • Access control rules访问控制规则
  • Events and queries事件和查询

Open the model file

打开模型文件

org.example.mynetwork.cto

用以下代码替换内容: (Replace the content with following codes:)

/*** My commodity trading network*/
namespace org.example.mynetwork
asset Commodity identified by tradingSymbol {o String tradingSymbolo String descriptiono String mainExchangeo Double quantity--> Trader owner
}
participant Trader identified by tradeId {o String tradeIdo String firstNameo String lastName
}
transaction Trade {--> Commodity commodity--> Trader newOwner
}

Save all the changes made by you with the following command:

使用以下命令保存您所做的所有更改:

org.example.mynetwork.cto

添加JavaScript事务逻辑的步骤 (Steps to Add JavaScript Transaction Logic )

The transaction processor function file contains the JavaScript logic that executes the transactions given in the model file.

事务处理器功能文件包含执行模型文件中给出的事务JavaScript逻辑。

第1步 (Step 1)

Open the logic.js script file.

打开logic.js脚本文件。

第2步 (Step 2)

Replace the whole content by following the code:
/*** Track the trade of a commodity from one trader to another* @param {org.example.mynetwork.Trade} trade - the trade to be processed* @transaction*/
async function tradeCommodity(trade) {trade.commodity.owner = trade.newOwner;let assetRegistry = await getAssetRegistry('org.example.mynetwork.Commodity');await assetRegistry.update(trade.commodity);
}

Finally, save the changes to

最后,将更改保存到

logic.js

将访问控制添加到您的区块链解决方案的步骤: (Steps to Add Access Control to Your Blockchain Solution:)

第1步 (Step 1)

Use this file permissions.acl and replace the control rules by following:

使用此文件Permissions.acl并通过以下步骤替换控制规则:

/*** Access control rules for tutorial-network*/
rule Default {description: "Allow all participants access to all resources"participant: "ANY"operation: ALLresource: "org.example.mynetwork.*"action: ALLOW
}rule SystemACL {description:  "System ACL to permit all access"participant: "ANY"operation: ALLresource: "org.hyperledger.composer.system.**"action: ALLOW
}

第2步 (Step 2)

Save the changes made to permissions.acl.

保存对Permissions.acl所做的更改。

This is how you can define the business network for your blockchain solution.

这是您可以为区块链解决方案定义业务网络的方式。

I will tell you how this business network should be packaged into a deployable business network archive .bna file.

我将告诉您如何将此业务网络打包到可部署的业务网络存档.bna文件中。

Use the tutorial-network directory and run the following command:

使用tutorial-network目录并运行以下命令:

composer archive create -t dir -n

作曲家档案库创建-t目录-n

After the correct execution of the command, you will see a business network archive file tutorial-network@0.0.1.bna that has been created in the tutorial network directory.

正确执行命令后,您将看到在教程网络目录中创建的业务网络归档文件tutorial-network@0.0.1.bna。

部署业务网络的步骤: (Steps For the Deployment of Business Network:)

第1步 (Step 1)

From the tutorial-network run the followinacg command:

在教程网络中,运行followinacg命令:

omposer network install --card PeerAdmin@hlfv1 --archiveFile tutorial-network@0.0.1.bna

第2步 (Step 2)

To start your business network use this command:

要启动您的业务网络,请使用以下命令:

composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card

composer网络开始--networkName教程网络--networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin @ hlfv1 --file networkadmin.card

第三步 (Step 3)

Import the network administrator identity by following the command:

通过执行以下命令导入网络管理员身份:

composer card import --file networkadmin.card

第4步 (Step 4)

To check whether the business network has been deployed successfully or not use the following command:

要检查业务网络是否已成功部署,请使用以下命令:

composer network ping --card admin@tutorial-network

生成REST API服务器的步骤 (Steps for Generating REST API Server)

It is also important to add a layer of language-neutral abstraction to your blockchain solution. REST API can generate that layer to your blockchain app.

向您的区块链解决方案中添加一层与语言无关的抽象也很重要。 REST API可以为您的区块链应用生成该层。

第1步 (Step 1)

In the first step you need to create the REST API by navigating to the tutorial-network directory and by running the following command:

在第一步中,您需要通过导航到tutorial-network目录并运行以下命令来创建REST API:

composer-rest-server

第2步 (Step 2)

Next, enter the card name by using:

接下来,使用以下命令输入卡名:

admin@tutorial-network

第三步 (Step 3)

In the next step, use “never use namespaces” when you are asked to use namespaces in the generated REST API.

在下一步中,当系统要求您在生成的REST API中使用名称空间时,请使用“从不使用名称空间”。

第4步 (Step 4)

Select the option “No” when asked to secure the API

当要求保护API时,选择选项“否”

第5步 (Step 5)

Select the option “Yes” when asked to enable the option of event publication

当要求启用事件发布选项时,选择选项“是”

第6步 (Step 6)

Again select the option “No” when asked to go for TLS Security.

当要求输入TLS安全性时,再次选择选项“否”。

步骤7 (Step 7)

You will see the generated API connected to your blockchain business network.

您将看到生成的API连接到您的区块链业务网络。

如何在Hyperledger Composer上开发Angular 4应用程序? (How to Develop Angular 4 Application on Hyperledger Composer?)

第1步 (Step 1)

Use tutorial-network directory and run the command:

使用tutorial-network目录并运行命令:

yo hyperledger-composer:angular

第2步 (Step 2)

Connect the running

连接跑步

business network by pressing “Yes” in the command box.

通过在命令框中按“是”来建立业务网络。

第三步 (Step 3)

For your business network card enter the command:

对于您的名片,请输入以下命令:

admin@tutorial-network

第4步 (Step 4)

Connect to REST API by selecting “Connect to existing REST API” and go further.

通过选择“连接到现有REST API”来连接到REST API,然后继续。

第5步 (Step 5)

For the REST server address, select the option localhost and enter 3000 for the server port.

对于REST服务器地址,选择选项localhost,然后输入3000作为服务器端口。

第6步 (Step 6)

Select the option of “namespaces are not used” and go further.

选择“不使用命名空间”选项,然后继续。

步骤7 (Step 7)

Run the application by using npm start.

通过使用npm start运行该应用程序。

步骤8 (Step 8)

You will have your Angular 4 application ready on REST API that you can check admin@tutorial-network.

您将在REST API上准备好Angular 4应用程序,可以检查admin @ tutorial-network。

By taking the above points into perspective, I can sum up the post on three core points required to create a blockchain solution on Hyperledger Fabric Composer. These points are, fabric blockchain network, deploy blockchain solution to the network, and Fabric REST API server. And developers should always remember the principle of convoluted app designing. And equally important, you need to find a competent and experienced developer that can bring you good results.

通过考虑以上几点,我可以对在Hyperledger Fabric Composer上创建区块链解决方案所需的三个核心点进行总结。 这些要点是:Fabric区块链网络,将区块链解决方案部署到网络以及Fabric REST API服务器。 开发人员应始终记住复杂的应用程序设计原理。 同样重要的是,您需要找到一个能为您带来良好结果的合格且经验丰富的开发人员。

Thank you for reading and I welcome your feedback and input.

感谢您的阅读,欢迎您提供反馈和意见。

翻译自: https://habr.com/en/post/468641/

composer创建项目

composer创建项目_在Hyperledger Composer上创建区块链解决方案的教程相关推荐

  1. github创建项目_用了 GitHub 上这款开源神器后,创建项目文档变得 so easy!

    大家好,我是小 G. 今天跟大家分享一个可用于快速创建项目文档的开源神器:MkDocs. https://github.com/mkdocs/mkdocs 该项目创建自 2014 年,目前 GitHu ...

  2. 如何从数据库中筛选出达成指定里程碑节点的项目_如何用共识算法构建区块链共识网络?...

    免责声明:本文旨在传递更多市场信息,不构成任何投资建议.文章仅代表作者观点,不代表火星财经官方立场. 小编:记得关注哦

  3. ASP.NET报错集合一----.net4.0创建项目后,在iis上部署项目,无法浏览,提示404

    前言:这些错误纯属自己在开发项目的时候遇到的问题,比较有针对性.如果有解决不了的问题,请勿喷. 问题描述: .net4.0创建项目后,在iis上部署项目,无法浏览,提示404 搭建项目的环境: 项目是 ...

  4. hyperledger v1.0.5 区块链入门

    2019独角兽企业重金招聘Python工程师标准>>> hyperledger v1.0.5 区块链入门 本文作者最近在找工作,有意向致电 13113668890 Mr. Neo C ...

  5. [KubeCon+CloudNativeCon China 2018] 在Kubernetes上运行区块链服务(BaaS)

    笔者注:本文是在2018年11月15日由Linux基金会CNCF主办的KubeCon & CloudNativeCon China 2018大会的"Running Blockchai ...

  6. 在Kubernetes上运行区块链服务(BaaS)

    本文是在2018年11月15日由Linux基金会CNCF主办的KubeCon & CloudNativeCon China 2018大会的"Running Blockchain as ...

  7. 【项目评级】ArcBlock(ABT)-区块链基石网络

    报告主旨 鉴于中国国内投资者缺乏相应的区块链项目资料,数字世界团队整理了全球已经完成的.正在进行的,以及宣布未来将区块链的项目评测资料,以标准化的评级报告形式呈现在国内加密数字货币投资者眼前,以便于能 ...

  8. 区块链编程语言_区块链解决方案开发的编程语言

    区块链编程语言 区块链变得如此流行,以至于我们可以肯定地说:技术已经从"加密货币热潮"的阴影中崛起. 如今,新闻头条越来越多地包含有关在一个或另一个区域中进行技术分布式注册表实施的 ...

  9. 阿里云容器服务区块链解决方案全新升级 支持Hyperledger Fabric v1.1

    摘要: 全球开源区块链领域影响最为广泛的Hyperledger Fabric日前宣布了1.1版本的正式发布,带来了一系列丰富的新功能以及在安全性.性能与扩展性等方面的显著提升.阿里云容器服务区块链解决 ...

最新文章

  1. Twitter 禁止未经用户同意分享照片和视频
  2. 规格选项表管理之更新规格选项表数据
  3. 英特尔发现Spectre和Meltdown 补丁对性能影响程度为0-21%
  4. 勘误表:《网络程序设计(第二版)》西安电子科技大学出版社
  5. 1.1 训练/开发/测试集-深度学习第二课《改善深层神经网络》-Stanford吴恩达教授
  6. spring容器注入一个接口的两个实现类
  7. 牌类游戏使用微服务重构笔记(八): 游戏网关服务器
  8. 谁敢动英伟达的奶酪?AI芯片领域,这12家创业公司值得关注
  9. C#中的delegate和event (转)
  10. opencv 图像轮廓特征 图像面积,轮廓周长,外接矩形、最小外接矩形、最小外接圆、拟合椭圆
  11. Flash Player9.0 跟Flash Player8.0区别
  12. 《火球——UML大战需求分析》(第3章 分析业务模型-类图)——3.7 关于对象图
  13. ERP系统和ERP软件的介绍
  14. 您认为做好测试计划工作的关键是什么?
  15. java applet介绍,Java中的Applet介绍
  16. 自定义报表制作的注意事项——思迈特软件Smartbi报表工具
  17. 解析dump的几种方式
  18. 《java并发编程的艺术》阅读笔记总结
  19. UVALive 7279 Sheldon Numbers
  20. xilinx的FPGA命名规则和一些简写含义

热门文章

  1. route 添加路由 和 IP route 添加路由
  2. pandas调用mysql数据库字段注释快速更改列名,MySQL的注释来当列名
  3. U盘WinPE启动出现BlInitializelLibrary failed 0xc000009a报错
  4. python中进程间通信方式总结
  5. Bind 函数的使用
  6. web页面性能优化方法总结
  7. 《python语言程序设计》第5章 第24题 一道展示摊销时间的循环题 前面还有20984人
  8. Linux(gcc编译原理、过程以及常用调试命令)
  9. linux虚拟机如何创建文件夹,Linux虚拟机命令如何创建新的文件和文件夹
  10. web安全测试---AppScan扫描工具详解和测试方法说明