修改Hyperledger Composer WebApp [英] Modifying Hyperledger Composer WebApp

查看:67
本文介绍了修改Hyperledger Composer WebApp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了Hyperledger Composer Developer教程 https://hyperledger. github.io/composer/tutorials/developer-guide.html ,我已经生成了BNA,将其部署到本地Hyperledger Fabric 1.0实例中,生成了REST API,并使用yo生成了框架web应用程序.

但是,我注意到生成的Web应用程序只有一个用于添加资产的菜单,而没有一个用于添加参与者和提交交易的菜单.我有两个问题:

1)为什么Web应用程序不生成用于添加参与者和提交交易的菜单? (或者是这样做,以及我如何才能做到这一点?)

2)为了增加通过webapp添加参与者和提交交易的能力,我在app目录中查找了相关的源代码,但是由于我对Web/angular开发人员相对较新,所以感到困惑.

是否有参考文档显示需要编辑哪些源文件才能添加参与者和交易?

据我所知,\ src \ app文件夹包含源文件,但我不了解这些文件各自扮演的角色:

  • app.component.html具有实际的HTML菜单,但是此[routerLink]指的是什么?

  • 我注意到,对于每个资产,都有一个带有CSS,HTML和三个.TS文件的子文件夹.每个参与者也都需要这些吗?

对于如何修改Web应用程序以适应增加的参与者和交易的任何指导或参考,将不胜感激.

解决方案

1)为什么Web应用程序不生成用于添加参与者和提交交易的菜单? (或者是这样做,以及我如何才能做到这一点?)

因为它是一个非常简单的NG2框架应用程序,其范围仅限于资产,您作为开发人员可以添加到资产中.您可以轻松地从Angular应用中添加REST API调用(操作)以提交(例如)交易.这是您应该使用Composer REST操作与运行时结构交互的方式.

2)是否有参考文档显示需要编辑哪些源文件才能添加参与者和交易?

这是一个简单的Angular教程 https://angular.io/tutorial ,在此处 https://angular.io/guide/quickstart -此

生成的App中的dataservice是调用当前资产" REST操作的地方,可以在此处添加更多REST操作->/src/app/data.service.ts

I've completed the Hyperledger Composer Developer tutorial https://hyperledger.github.io/composer/tutorials/developer-guide.html and I've generated the BNA, deployed it to a local Hyperledger Fabric 1.0 instance, generated the REST API, and generated the skeleton webapp using yo.

However, I noticed that the resulting webapp only has a menu for adding assets, and none for adding participants and submitting transactions. I have two questions:

1) Why doesn't the webapp generate menus for adding participants and submitting transactions? (or does it, and how do I get it to do that?)

2) In an attempt to add the ability to add participants and submit transactions through the webapp, I've looked through the app directory for the relevant source code but became confused as I'm relatively new to web/angular dev.

Is there any reference documentation to show which source files need to be edited to add participants and transactions?

As far as I can tell, \src\app folder has the source files but I don't understand the roles that each of these files play:

  • app.component.html has the actual HTML menus, but what is this [routerLink] referring to?

  • I noticed for each asset that there is a subfolder with a CSS, HTML, and three .TS files. Are these needed for each participant as well?

Any direction or reference on how to modify the web app to accommodate adding participants and transactions would be much appreciated.

解决方案

1) Why doesn't the webapp generate menus for adding participants and submitting transactions? (or does it, and how do I get it to do that?)

Because its a very simple skeleton NG2 app scoped to assets, which you as a developer can add to. You can easily add REST API calls (operations) from your Angular app to (for example) submit transactions. This is how you should interact with the runtime Fabric using Composer REST operations.

2) Is there any reference documentation to show which source files need to be edited to add participants and transactions?

This is a straightforward Angular tutorial https://angular.io/tutorial and here https://angular.io/guide/quickstart - and this tutorial will help explain Angular further.

The dataservice in the generated App is where the current 'asset' REST operation is called from and further REST operations can be added here -> /src/app/data.service.ts

这篇关于修改Hyperledger Composer WebApp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆