简体   繁体   English

使用Interactor后端设置P2P网络

[英]Setup a P2P network using Interactor backend

From what I've read so far , Interactor offers flexible, simplified configuration for a client-server acrchitecture. 到目前为止的内容来看,Interactor为客户端-服务器架构提供了灵活,简化的配置。 But what if you want your network to be P2P? 但是,如果您希望您的网络成为P2P怎么办?

Off the top of my head, I could make all nodes servers and clients, but it doesn't feel right. 我顶着头,可以使所有节点都成为服务器和客户端,但是感觉不对。 Any suggestion? 有什么建议吗?

There are two answers to this question. 这个问题有两个答案。

  1. Dynamic/Self configuration: It really depends on the underlying protocol being used for your P2P. 动态/自我配置:确实取决于您的P2P使用的基础协议。 Whether you are looking to implement centralized P2P or decentralized P2P infrastructure, underlying communication options between the components should be similar to your client-server architecture. 无论您是要实现集中式P2P还是分散式P2P基础架构,组件之间的基础通信选项都应类似于客户端-服务器体系结构。 If you select TCP/IP as the underlying protocol, you will need to create client and server interfaces between the components that need to interact with each other. 如果选择TCP / IP作为基础协议,则需要在需要相互交互的组件之间创建客户端和服务器接口。 However, benefit of using Interactor is that those client and server interfaces do not need to be preconfigured, but instead be configured dynamically at runtime. 但是,使用Interactor的好处是不需要预先配置这些客户端和服务器接口,而是在运行时动态地对其进行配置。 This way, there is minimal configuration required by each node to start with, and client-server communication is configured later whenever there is a need. 这样,每个节点开始时所需的配置最少,并且稍后在需要时配置客户端-服务器通信。

  2. Inter-interactor communication: While the feature is not available as of version 3.1.0,, all nodes will be configured to have inter-interactor communication with all of their peering nodes. 交互器间通信:尽管此功能从3.1.0版本开始不可用,但所有节点都将配置为与所有对等节点具有交互器间通信。 You would not worry about client server configuration, instead, you would use a simple inter-interactor configuration listing out the target nodes that you want to peer with. 您不必担心客户端服务器的配置,相反,您将使用一个简单的交互器配置,列出要与之对等的目标节点。 This can also be configured dynamically at runtime. 也可以在运行时动态配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM