锚点与CORE_PEER_GOSSIP_EXTERNALENDPOINT? [英] Anchor peer vs CORE_PEER_GOSSIP_EXTERNALENDPOINT?

查看:314
本文介绍了锚点与CORE_PEER_GOSSIP_EXTERNALENDPOINT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当通过在每个对等方中设置 CORE_PEER_GOSSIP_EXTERNALENDPOINT 可以实现跨组织通信时,为什么应该使用锚点对等体?

Why should one use Anchor peers when the cross org communication can be acheived by setting CORE_PEER_GOSSIP_EXTERNALENDPOINT in every peer?

任何人都可以解释应该使用的正确方法吗?

Can anyone explain the correct way one should be used?

推荐答案

让我清楚地向您解释

在超级账本结构中,总共有三种对等类型

In the hyperledger fabric there are total Three Types of peers

  • 认可同辈
  • 对等成员
  • 订购者对等(订购者也是 同行)
  • Endorsing Peers
  • Committing Peers
  • Orderer Peer (Orderer is also a Peer)

隐藏的东西是:

  • 锚点
  • 领导者同行

Anchor Peers用于跨组织的点对点通信,要设置Anchor Peers,您需要设置Anchor Peers并使用ENV

Anchor Peers are for cross-organization peer-to-peer communication, to setup Anchor Peers you need to setup Anchor Peers and use ENV

分步

  - &org1
    Name: org1
    ID: org1MSP
    MSPDir: ./data/orgs/org1/msp
    AnchorPeers:
      - Host: org1-peer
      - Port: 7051 

  # generate anchor peer transaction
  configtxgen -profile OrgsChannel -outputAnchorPeersUpdate ./crypto-config/org1Anchors.tx -channelID publicchannel -asOrg org1
  if [ "$?" -ne 0 ]; then
  echo "Failed to generate anchor peer update for maersksea..."
  exit 1org1     fi

现在您需要发送交易以设置锚点对等体 检查此>> https://hyperledger-fabric.readthedocs.io/en/release-1.1/commands/peerchannel.html#peer-channel-update

Now you need to send a transaction inorder to setup Anchor Peers Check this >> https://hyperledger-fabric.readthedocs.io/en/release-1.1/commands/peerchannel.html#peer-channel-update

如果您想让组织中的其他同行知道其他组织,则需要设置

If you want to make other peers in your organization known to other organizations, you need to set the

CORE_PEER_GOSSIP_EXTERNALENDPOINT

CORE_PEER_GOSSIP_EXTERNALENDPOINT

他们做什么:

高级的对等通信是通过八卦协议进行的,而锚点是八卦通信的关键.

High-level, peer-to-peer communication happens through gossip protocol and Anchor Peers are the key to gossip communication.

  • 确保不同组织中的对等方通过八卦协议相互了解.
  • 一个人可以通过锚点使用私有数据概念,因为八卦在授权组织之间分配了对等私有数据,需要在渠道上建立锚点对等

阅读以下提到的文档 - https://hyperledger-fabric.readthedocs .io/en/release-1.4/private-data/private-data.html - https://hyperledger-fabric.readthedocs.io/en/release -1.4/glossary.html

Read below mentioned docs - https://hyperledger-fabric.readthedocs.io/en/release-1.4/private-data/private-data.html - https://hyperledger-fabric.readthedocs.io/en/release-1.4/glossary.html

LeaderPeers 是订购者将块运送到同伴的主要入口点

LeaderPeers are the main entry point for orderer to ship blocks to peers

一个人可以设置领导者对等人,或者对等人可以自己选举一个人

One can set up leader Peers or Peers can elect one by its own

两种类型

  • 静态领导人选举
  • 动态领导者选举

静态领导人选举

静态领导者选举允许您手动将组织中的一个或多个对等定义为领导者对等体.但是请注意,连接到订购服务的对等方过多,可能会导致带宽使用效率低下.

Static leader election allows you to manually define one or more peers within an organization as leader peers. Please note, however, that having too many peers connect to the ordering service may result in inefficient use of bandwidth.

export CORE_PEER_GOSSIP_USELEADERELECTION=false
export CORE_PEER_GOSSIP_ORGLEADER=true

动态领导者选举

动态领导者选举使组织对等方可以选择一个对等方,该对等方将连接到订购服务并提取新的模块.这位领导者是独立选举组织的同行.

Dynamic leader election enables organization peers to elect one peer which will connect to the ordering service and pull out new blocks. This leader is elected for an organization’s peers independently.

export CORE_PEER_GOSSIP_USELEADERELECTION=true
export CORE_PEER_GOSSIP_ORGLEADER=false

这篇关于锚点与CORE_PEER_GOSSIP_EXTERNALENDPOINT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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