PR
Comments
New!
GKenさん
New!
USM1さん
New!
藻緯羅さんCategory
Keyword Search
Freepage List
Shopping List
The second key class is a Fabric
Gateway
. Most importantly, a gateway
identifies one or more peers that provide access to a network – in our case, PaperNet. See how
issue.js
connects to its gateway:
2番目のキークラスは ファブリックゲートウエイです。 最も重要なことは、ゲートウエイがあるネットワークークー我々の場合 PaperNet
にアクセスを供給する1人以上の相手を特定します。発行 .js
が、どのようにそのゲートウエイに接続するか見てください:
await gateway . connect ( connectionProfile , connectionOptions );
ゲートウェイ . 接続(接続プロファイル、 接続オプション)を待ち受ける;
gateway.connect()
has two important parameters:
.
接続 ()
は2つの重要なパラメータがあります:
l
connectionProfile
: the file system location of a
connection profile
that
identifies a set of peers as a gateway to PaperNet
接続プロファイル:
PaperNet
へのゲートウエイとして相手のセットを特定する接続プロファイルのファイルシステムの位置の選定
l
connectionOptions
: a set of options used to control how
issue.js
interacts with PaperNet
接続オプション:
PaperNet
とどのように発行
.js
が相互作用するコントロールするために使われるオプションのセット
See how the client application uses a gateway to insulate itself from the network topology, which might change. The gateway takes care of sending the transaction proposal to the right
peer nodes in the network using the connection profile
and connection options
.
クライアントアプリケーションがゲートウエイを変化するかもしれないネットワークのトポロジーからそれ自身を隔離するためにどのように使うか見てください。ゲートウエイは、接続 プロファイルとっ接続オプションを使ってネットワークで正しい相手のノードにトランザクション提案を送るのを世話します。
Spend a few moments examining the connection
profile
/gateway/connectionProfile.yaml
. It uses
YAML
, making it easy to read.
接続プロファイル /
ゲートウエイ /
接続プロファイル .yaml
をしばらく調べて見よう。 それは、読むことを容易にするので YAML
を使います。
It was loaded and converted into a JSON object:
それは装填されて、 JSON
オブジェクトに変換されました:
let
connectionProfile
=
yaml
.
safeLoad
(
file
.
readFileSync
(
'./gateway/connectionProfile.yaml'
,
'utf8'
));
接続プロファイル= yaml.
安全装填 (
ファイル .
ファイル読み込み同期
('./
ゲートウエイ /
接続プロファイル .yaml'
、「 utf8
」));とする
Right now, we’re only interested in the
channels:
and
peers:
sections of the
profile: (We’ve slightly modified the details to explain what’s happening.)
ちょうど今、我々はチャンネル :
と相手 :
プロファイルのセクション に関心があるだけです:(我々はもっと良く何が起きているか説明するために少し細部を修正しました。)
channels :
チャンネル:
papernet :
papernet :
peers :
相手:
peer1.magnetocorp.com :
相手 1.magnetocorp.com :
endorsingPeer : true
相手の裏書:真
eventSource : true
イベントソース:真
peer2.digibank.com :
相手 2.digibank.com :
endorsingPeer : true
相手の裏書:真
eventSource : true
イベントソース:真
peers :
相手:
peer1.magnetocorp.com :
相手 1.magnetocorp.com :
url : grpcs://localhost:7051
URL : grpcs:// ローカルホスト :7051
grpcOptions :
grpcOptions :
ssl-target-name-override : peer1.magnetocorp.com
ssl -ターゲット -名前 - 無効化 : 相手 1.magnetocorp.com
request-timeout : 120
リクェスト - タイムアウト:120
tlsCACerts :
tlsCACerts :
path : certificates/magnetocorp/magnetocorp.com-cert.pem
パス:証明 /magnetocorp/magnetocorp.com-cert.pem
peer2.digibank.com :
相手 2.digibank.com :
url : grpcs://localhost:8051
URL : grpcs:// ローカルホスト :8051
grpcOptions :
grpcOptions :
ssl-target-name-override : peer1.digibank.com
ssl -ターゲット- 名前 - 無効化 : 相手 1.digibank.com
tlsCACerts :
tlsCACerts :
path : certificates/digibank/digibank.com-cert.pem
パス:証明 /digibank/digibank.com-cert.pem
See how
channel:
identifies the
PaperNet:
network channel, and two of its peers. MagnetoCorp has
peer1.magenetocorp.com
and DigiBank has
peer2.digibank.com
, and both
have the role of endorsing peers. Link to these peers via the
peers:
key,
which contains details about how to connect to them, including their respective
network addresses.
どのようにチャンネル:が PaperNet:
ネットワークチャンネルとその2人の相手を識別するか見てみよう。 MagnetoCorp
は相手1 .magenetocorp.com
を持ち、 DigiBank
は相手 2.digibank.com
を持ち、両方ともは相手を裏書きする役割を持っています。彼らのそれぞれのネットワークアドレスを含めて、どのように彼らに接続するべきかについて、詳細を含む peers:key
によってこれらの相手にリンクしてください。
The connection profile contains a lot of information – not just peers – but network channels, network orderers, organizations, and CAs, so don’t worry if you don’t understand all of it!
接続プロファイルは多くの情報( 相手だけではなく )、しかしネットワークチャネル、ネットワーク注文者、組織と認証局を 含んでいるので、それほどあなたがそのすべてが分からなくても、どうかそんなに心配しないでください!
Let’s now turn our attention to the
connectionOptions
object:
今我々の注意を接続オプション オブジェクトに向けましょう:
let connectionOptions = { identity : userName , wallet : wallet }
接続オプション= {身元:ユーザ名、 財布:財布 }とする
See how it specifies that identity,
userName
, and wallet,
wallet
, should be used to
connect to a gateway. These were assigned values earlier in the code.
それがどのようにその同値、ユーザ名を指定するか見てください、そうすれば財布、財布、がゲートウエイに接続するために使われるべきです。 これらは符号早くに割当値でした。
There are other connection options
that an application could use to instruct the SDK to
act intelligently on its behalf. For example:
SDK
にそのために聰明に作用するよう指示するためにそこ(に・で)アプリケーションが使うことができた otherconnection optionswhich
です。 例えば:
let connectionOptions = { identity : userName , wallet : wallet , eventHandlerOptions : { commitTimeout : 100 , strategy : EventStrategies . MSPID_SCOPE_ANYFORTX },}
接続オプション = {身元:ユーザ名、財布:財布、イベントハンドラーオプション:{時間切れコミット : 100 、 戦略: イベント戦略 .MSPID_SCOPE_ANYFORTX }、}
Here,
commitTimeout
tells the SDK to wait 100 seconds to hear whether a transaction has been committed. And
strategy:EventStrategies.MSPID_SCOPE_ANYFORTX
specifies that the SDK can notify an application after a single MagnetoCorp peer has confirmed the transaction, in contrast to
strategy: EventStrategies.NETWORK_SCOPE_ALLFORTX
which requires that all peers from MagnetoCorp and DigiBank to confirm the transaction.
ここで、時間切れにコミットは、トランザクションが引き受けられたかどうか聞くために100秒待つために SDK
に告げます。そして 一人の MagnetoCorp
相手がトランザクションを確認した後に SDK
がアプリケーションに通知できる ことを戦略 :
イベント戦略 .MSPID_
範囲 _
トランザクションのためのいずれが、指定します。それと対照的に 戦略 :
イベント戦略 .
ネットワーク _
範囲 _
トランザクションのためのすべては、トランザクションを確認するために MagnetoCorp
と DigiBank
からすべての相手にトランザクションを確認することを必要とします。
If you’d like to, read more
about how connection options allow applications to specify
goal-oriented behavior without having to worry about how it is achieved.
もしあなたがそうすることを望むなら、接続オプションがどんな具合に達成されているか心配する必要なくアプリケーションがゴール志向のふるまいを指定することを可能にする方法についての詳細はこちら
を読んでください。
=========================
インターネット・コンピュータランキング 【5/3〜5】買えば買うほど★最大10%OFFクーポン コールマン アウトドアワゴン グレー アルペン限定カラー 2000034670 OUTDOORWAGON (テント タープ テーブル チェア 運搬に) Coleman
価格:11000円(税込、送料別) (2022/5/2時点)
Apple Gift Card
価格:50000円(税込、送料無料) (2022/5/2時点)
パナソニック ベビーモニター KX-HC705(ホワイト)【送料無料】
価格:15197円(税込、送料無料) (2022/5/2時点)
Nintendo Switch Joy-Con(L) ネオンブルー/(R) ネオンレッド
価格:32978円(税込、送料無料) (2022/5/2時点)
Apex グループがヘデラ評議会に参加し、機… 2026.11.29
ブロックチェーンインフラから利益を得る1… 2026.11.20
レイヤー1とレイヤー2のブロックチェーン… 2026.10.30