可以在Hyperledger作曲家和Android应用之间进行连接吗? [英] Can connect between hyperledger composer and Android app?

查看:92
本文介绍了可以在Hyperledger作曲家和Android应用之间进行连接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一台物理机器上的Hyperledger Composer上创建了一个网络,并为管理员和用户创建了卡 我有一些问题:

I created a network on hyperledger composer on one physical machine and create cards for admin and user I have some questions:

1)如何使用2台不同的计算机(笔记本电脑)访问同一网络?

1) how can I access the same network using 2 different machines(laptops) ?

2)以及是否可以将Hyperledger作曲器上的该网络连接到Android应用程序?

2) and if it possible to connect this network on hyperledger composer to Android app ?

我想知道这些方法是否可行,怎么办?

I want to know if these possible or not and how can do that?

我想知道使用Hyperledger Fabric最好还是继续使用Hyperledger作曲家?

And I want to know if using hyperledger fabric will be best or go on hyperledger composer?

推荐答案

访问网络"取决于您的意思:

It depends on what you mean with "access the network":

  • 如果您要向其发送查询,则一种可能的解决方案是 启动作曲家REST服务器,打开端口,您应该会很好 去.
  • 如果您要访问作曲者后端,只需打开端口就足够了.
  • If you mean sending queries to it, one possible solution could be to launch the composer REST server, open ports, and you should be good to go.
  • If you mean accessing the composer backend, just opening ports should be enough.

要将网络与Android应用程序连接"起来,我想您的意思是向其发送查询,因此REST服务器解决方案应该可以工作.

To "connect" the network with an Android app I suppose you mean sending queries to it, so the REST server solution should work.

关于最后一个问题,这还取决于您使用这些工具的目的.如果您正在学习或进行快速PoC,那么Composer是一个不错的选择(即使IBM在2018年10月表示他们不会继续开发),但是对于严肃的工作或生产工作,我会直接与Fabric一起使用.

About the last question, it also depends on what are you using the tools for. If you are learning or doing fast PoCs, Composer is a good election (even when IBM said on october 2018 they wouldn't continue development), but for serious or production work i'd go directly with Fabric.

更新:composer-rest-server

您可以使用composer-rest-server从不同的计算机连接到作曲家网络并向其发送交易.只需在运行Composer的计算机中启动它,就像这样:

You can use composer-rest-server to connect to your composer network from different machines and send transactions to it. Just have to launch it in the machine you have composer running, like so:

composer-rest-server

默认情况下,它会在端口3000上启动Web服务,因此您可以将浏览器定向到http://localhost:3000/explorer/,以便在同一台计算机上与其进行交互.要从另一台计算机进行连接,如果您位于同一网络中,只需将另一台计算机指向端口3000上的作曲家计算机的本地IP.假设作曲家计算机具有专用IP 192.168.0.10,则您必须将另一台计算机的浏览器指向http://192.168.0.10:3000/explorer/.如果您位于不同的网络中,则需要打开路由器端口,将它们重定向到作曲家计算机,然后连接到其公用IP而非专用IP.有关composer-rest-server的更多信息: https://hyperledger.github.io/composer/v0.16/integrating/getting-started-rest-api

By default it launches a web service on port 3000, so you can direct your browser to http://localhost:3000/explorer/ to interact with it from the same machine. To connect from a different machine, if you are in the same network, just point the other machine to the local IP of the composer machine, on port 3000. Let's say the composer machine has private IP 192.168.0.10, then you would have to point the browser of the other machine to http://192.168.0.10:3000/explorer/. If you are in different networks you would need to open router ports, redirect them to the composer machine, and connect to its public IP instead of its private IP. More information about composer-rest-server: https://hyperledger.github.io/composer/v0.16/integrating/getting-started-rest-api

这篇关于可以在Hyperledger作曲家和Android应用之间进行连接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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