-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New translations ha-for-sc.md (Japanese)
- Loading branch information
Showing
1 changed file
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
# Configure high availability | ||
# 高可用性の設定 | ||
|
||
If only one bridge is used in the ServiceChain, that bridge can become a single point of failure. To solve this, we describe how you can build an HA system with two or more bridges. As shown in the figure below, configure the bridges to be connected in at least two pairs, so that even if there is a problem in one bridge connection, data anchoring and value transfer between chains can still work normally through the other bridge. | ||
ServiceChainでブリッジが1つしか使用されていない場合、そのブリッジが単一障害点となる可能性がある。 これを解決するために、2つ以上のブリッジでHAシステムを構築する方法を説明する。 下図に示すように、少なくとも2組のブリッジが接続されるように構成し、一方のブリッジ接続に問題が発生しても、もう一方のブリッジを介してチェーン間のデータ・アンカリングとバリュー転送が正常に機能するようにする。 | ||
|
||
 | ||
|
||
## Prerequisites <a id="prerequisites"></a> | ||
## 前提条件<a id="prerequisites"></a> | ||
|
||
- The main bridge of the EN and the sub bridge of the SCN are connected. If it's not, please refer to [Baobab connection](en-scn-connection.md) to establish the connection. | ||
- This section describes how to add an extra bridge between Baobab and a ServiceChain. In the same way, you can also set up HA by adding another bridge. | ||
- ENのメインブリッジとSCNのサブブリッジは接続されている。 If it's not, please refer to [Baobab connection](en-scn-connection.md) to establish the connection. | ||
- This section describes how to add an extra bridge between Baobab and a ServiceChain. 同じように、別のブリッジを追加してHAをセットアップすることもできる。 | ||
|
||
## Step 1: Adding another Bridge between EN-SCN <a id="step-1-adding-another-bridge-between-en-scn"></a> | ||
## ステップ1:EN-SCN間に別のブリッジを追加する<a id="step-1-adding-another-bridge-between-en-scn"></a> | ||
|
||
In [Connecting to Baobab](en-scn-connection.md), we assume that the EN and the SCN connected by a bridge as EN-01 and SCN-L2-01, respectively. In this section, we will add another bridge between EN-02 and SCN-L2-02. | ||
Since it follows the same procedure, we will briefly explain. | ||
In [Connecting to Baobab](en-scn-connection.md), we assume that the EN and the SCN connected by a bridge as EN-01 and SCN-L2-01, respectively. このセクションでは、EN-02とSCN-L2-02の間にもうひとつブリッジを加える。 | ||
同じ手順なので、簡単に説明しよう。 | ||
|
||
 | ||
|
||
After building EN-02, set `SC_MAIN_BRIDGE` to 1 in `conf/kend.conf` and restart ken on EN-02. | ||
EN-02 をビルドした後、`conf/kend.conf` で `SC_MAIN_BRIDGE` を 1 に設定し、EN-02 上で ken を再起動する。 | ||
|
||
```console | ||
SC_MAIN_BRIDGE=1 | ||
``` | ||
|
||
Check the KNI information of EN-02 by the following command: | ||
EN-02のKNI情報を以下のコマンドで確認する: | ||
|
||
```console | ||
EN-02$ ken attach --datadir ~/data | ||
> mainbridge.nodeInfo.kni | ||
"kni://eb8f21df10c6562...25bae@[::]:50505?discport=0" | ||
``` | ||
|
||
Log in to SCN-L2-02, and create `main-bridges.json` with the KNI of EN-02. Please make sure that it should be in the JSON array format with a square bracket. | ||
SCN-L2-02 にログインし、EN-02 の KNI で `main-bridges.json` を作成する。 角括弧付きのJSON配列形式であることを確認してください。 | ||
|
||
```console | ||
SCN-L2-02$ echo '["kni://[email protected]:50505?discport=0"]' > ~/data/main-bridges.json | ||
``` | ||
|
||
On the shell of SCN-L2-02, edit `kscn-XXXXX-amd64/conf/kscnd.conf` as described below. | ||
To connect a bridge, set `SC_SUB_BRIDGE` to 1. | ||
SCN-L2-02 のシェル上で、`kscn-XXXXXX-amd64/conf/kscnd.conf` を以下のように編集します。 | ||
ブリッジを接続するには、`SC_SUB_BRIDGE`を1に設定する。 | ||
`SC_PARENT_CHAIN_ID` is set to Baobob's `chainID` 1001. | ||
`SC_ANCHORING_PERIOD` is the parameter that decides the period to send an anchoring transaction to the parent chain. In this example, an anchor transaction is submitted to the parent chain (Baobab) for every 10 child blocks. | ||
SC_ANCHORING_PERIOD\` はアンカリングのトランザクションを親チェーンに送る期間を決めるパラメータである。 In this example, an anchor transaction is submitted to the parent chain (Baobab) for every 10 child blocks. | ||
|
||
``` | ||
... | ||
|
@@ -51,17 +51,17 @@ SC_ANCHORING_PERIOD=10 | |
... | ||
``` | ||
|
||
If you restart ken on EN-02, a bridge will be connected automatically between the EN-02 and the SCN-L2-02 and data anchoring will start from the point where the connection is made as shown in the figure below. | ||
EN-02でkenを再起動すると、下図のようにEN-02とSCN-L2-02の間にブリッジが自動的に接続され、接続された箇所からデータアンカリングが開始されます。 | ||
|
||
After adding the bridge between EN-02 and SCN-L2-02, you can now see the connection between the nodes are established as shown in below. | ||
EN-02とSCN-L2-02の間にブリッジを追加すると、以下のようにノード間の接続が確立されます。 | ||
|
||
 | ||
|
||
## Step 2: Registering and Subscribing the Bridge Contract <a id="step-2-registering-and-subscribing-the-bridge-contract"></a> | ||
## ステップ2:ブリッジ契約の登録と加入<a id="step-2-registering-and-subscribing-the-bridge-contract"></a> | ||
|
||
As shown in the figure above, the bridge contract is registered only in EN-01 and SCN-L2-01. | ||
上図のように、ブリッジ契約はEN-01とSCN-L2-01のみに登録されている。 | ||
|
||
Connect to the SCN-L2-02 console and run the APIs for bridge registration, bridge subscription, and token registration. The bridge and token contract were created while deploying the bridge contract with EN-01 and SCN-L2-01 in step 2 of [Cross-Chain Value Transfer](value-transfer.md). | ||
SCN-L2-02 のコンソールに接続し、ブリッジ登録、ブリッジ加入、トークン登録の API を実行します。 ブリッジとトークン契約は、[Cross-Chain Value Transfer](value-transfer.md)のステップ2で、EN-01とSCN-L2-01でブリッジ契約を展開する際に作成されました。 | ||
|
||
``` | ||
$ kscn attach --datadir ~/data | ||
|
@@ -75,24 +75,24 @@ null | |
|
||
 | ||
|
||
In the bridge contract, information about adding an extra bridge should be updated. Write the child operator and parent operator information of the added extra bridge in the `erc20/erc20-addOperator4HA.js` file of [service-chain-value-transfer-example](https://github.com/klaytn/servicechain-value-transfer-examples) and execute `node erc20-addOperator4HA.js`. | ||
ブリッジ契約では、追加ブリッジに関する情報を更新する必要がある。 service-chain-value-transfer-example](https://github.com/klaytn/servicechain-value-transfer-examples) の `erc20/erc20-addOperator4HA.js` ファイルに、追加したブリッジの子オペレータと親オペレータの情報を記述し、`node erc20-addOperator4HA.js` を実行する。 | ||
|
||
``` | ||
// register operator | ||
await conf.child.newInstanceBridge.methods.registerOperator("0xCHILD_BRIDGE_ADDR").send({ from: conf.child.sender, gas: 100000000, value: 0 }); | ||
await conf.parent.newInstanceBridge.methods.registerOperator("0xPARENT_BRIDGE_ADDR").send({ from: conf.parent.sender, gas: 100000000, value: 0 }); | ||
``` | ||
|
||
When there are multiple bridges, value transfer can be provided more safely by setting a threshold. Value transfer can be enabled only when an operator above the threshold normally requests value transfer. For example, as in the current example, if there are two bridge pairs and the threshold is set to 2, value transfer can be provided only when both are normally requested. That is, even if one bridge is attacked and sends an abnormal request, it can be prevented. The default value of threshold is 1. In the `erc20/erc20-addOperator4HA.js` file of [service-chain-value-transfer-example](https://github.com/klaytn/servicechain-value-transfer-examples), uncomment the code below and set the threshold value and then run it to change the threshold for the bridge contract. | ||
複数のブリッジがある場合、閾値を設定することで、より安全に値の伝達を行うことができる。 バリュー・トランスファーは、通常、閾値以上のオペレーターがバリュー・トランスファーを要求した場合にのみ有効にすることができる。 例えば、今回の例のように、ブリッジペアが2つあり、閾値が2に設定されている場合、両方が正常に要求された場合にのみ値転送を行うことができる。 つまり、1つのブリッジが攻撃を受けて異常なリクエストを送信したとしても、それを防ぐことができる。 閾値のデフォルト値は1である。 service-chain-value-transfer-example](https://github.com/klaytn/servicechain-value-transfer-examples)の\`erc20/erc20-addOperator4HA.js\`ファイルで、以下のコードをアンコメントして閾値を設定し、ブリッジ契約の閾値を変更するために実行してください。 | ||
|
||
``` | ||
// // set threshold | ||
// await conf.child.newInstanceBridge.methods.setOperatorThreshold(0, "your threshold number").send({ from: conf.child.sender, gas: 100000000, value: 0 }); | ||
// await conf.parent.newInstanceBridge.methods.setOperatorThreshold(0, "your threshold number").send({ from: conf.parent.sender, gas: 100000000, value: 0 }); | ||
``` | ||
|
||
When registration is completed, a bridge contract is registered in both EN-02 and SCN-L2-02 as shown in the figure below to configure HA. | ||
登録が完了すると、下図のようにEN-02とSCN-L2-02の両方にブリッジ契約が登録され、HAが構成されます。 | ||
|
||
 | ||
|
||
When two or more bridge pairs are connected for HA, data anchoring transactions for the same block occur more than once, and value transfer transactions can also occur multiple times. That is, additional fees are required. | ||
2つ以上のブリッジペアがHA用に接続されている場合、同じブロックに対するデータアンカリングトランザクションは複数回発生し、値移転トランザクションも複数回発生する可能性がある。 つまり、追加料金が必要となる。 |