「Tezosの環境構築」の版間の差分

提供: tezos-wiki
移動先: 案内検索
1行目: 1行目:
= How to build and run =
+
=ビルドと実行方法=
  
== Build instructions ==
+
==構築手順==
  
To compile Tezos, you need an OCaml compiler (version 4.06.1) and all the libraries listed in the various <code>tezos-*.opam</code> files.
+
Tezosをコンパイルするには、OCamlコンパイラ(バージョン4.06.1)と、さまざまな<code> tezos - *。opam </code>ファイルにリストされているすべてのライブラリが必要です。
  
The best way to install all dependencies is by first installing <code>OPAM &lt;https://opam.ocaml.org/&gt;</code>__, the OCaml package manager.
+
すべての依存関係をインストールする最良の方法は、最初にOCamlパッケージマネージャの<code> OPAM <https://opam.ocaml.org/&gt; </code> __をインストールすることです。
  
Then, you need to create a new switch alias for Tezos. A switch is your own version of the OPAM configuration, including the OCaml compiler, all packages, and package manager configuration related to your project. This is necessary so that the project doesn’t conflict with other OCaml projects or other versions of Tezos.
+
次に、Tezos用の新しいスイッチエイリアスを作成する必要があります。スイッチは、OCamlコンパイラ、すべてのパッケージ、プロジェクトに関連するパッケージマネージャの設定など、OPAM設定の独自のバージョンです。これは、プロジェクトが他のOCamlプロジェクトやTezosの他のバージョンと競合しないようにするために必要です。
  
 
::
 
::
  
<pre>opam update
+
<pre> opamの更新
opam switch &quot;tezos&quot; --alias-of 4.06.1</pre>
+
opamスイッチ "tezos" --alias-of 4.06.1 </pre>
Note that if you previously created a switch named <code>tezos</code> but with an older OCaml version you need to remove the switch with <code>opam switch remove &quot;tezos&quot;</code>.
+
以前に<code> tezos </code>という名前のスイッチを作成したが、古いOCamlバージョンのスイッチを作成した場合は、<code> opam switch remove "tezos" </code>でスイッチを削除する必要があることに注意してください。
  
When the switch is ready, you need to activate it:
+
スイッチの準備ができたら、スイッチをアクティブにする必要があります。
  
 
::
 
::
  
<pre>eval `opam config env`</pre>
+
<pre> eval `opam config env` </pre>
Install the libraries which Tezos depends on:
+
Tezosが依存するライブラリをインストールします。
  
 
::
 
::
  
<pre>make build-deps</pre>
+
<pre> make-depsを作成する</pre>
While building the dependencies, <code>opam</code> is able to handle correctly the OCaml libraries but it is not always able to handle all external C libraries we depend on. On most system, it is able to suggest a call to the system package manager but it currently does not handle version check.
+
依存関係を構築する際、<code> opam </code>はOCamlライブラリを正しく扱うことができますが、依存するすべての外部Cライブラリを常に処理できるわけではありません。ほとんどのシステムでは、システムパッケージマネージャーへの呼び出しを提案できますが、現在はバージョンチェックを処理していません。
  
At last, compile the project:
+
最後に、プロジェクトをコンパイルします:
  
 
::
 
::
  
<pre>make</pre>
+
<pre> make </pre>
This should produce three binaries:
+
これにより、3つのバイナリが生成されます。
  
* <code>tezos-node</code>: the tezos daemon itself;
+
* <code> tezos-node </code>:tezosデーモン自体。
* <code>tezos-client</code>: a minimal command-line client;
+
* <code> tezos-client </code>:最小限のコマンドラインクライアント。
* <code>tezos-protocol-compiler</code>: a protocol compiler used for developing new version of the economic protocol.
+
* <code> tezos-protocol-compiler </code>:新しいバージョンの経済プロトコルを開発するために使用されるプロトコルコンパイラ。
  
Currently Tezos is being developed for Linux only. It should work on mac OS, but it has not been tested recently. A Windows port is in progress.
+
現在、TezosはLinux向けに開発されています。それはMac OSで動作するはずですが、最近テストされていません。 Windowsポートが進行中です。
  
Note that, when executing <code>make build-deps</code>, OPAM will detect if required system dependencies are installed. However, it is not able to detect which versions you actually have. Typically, <code>make</code> will probably fail if you have an libsodium &lt; 1.0.11. In this case, make sure you have a recent version of libsodium and libsodium-dev, or download and install them from, eg, https://pkgs.org/download/libsodium18 and https://pkgs.org/download/libsodium-dev
+
<code> make build-deps </code>を実行すると、OPAMは必要なシステム依存関係がインストールされているかどうかを検出します。しかし、あなたが実際に持っているバージョンを検出することはできません。通常、<code> make </code>はlibsodium&lt; 1.0.11。この場合、最近のバージョンのlibsodiumとlibsodium-devを持っているか、例えばhttps://pkgs.org/download/libsodium18とhttps://pkgs.org/download/libsodiumからダウンロードしてインストールしてください。 -dev
  
If after a <code>git pull</code>, the build fails (either at <code>make build-deps</code> or <code>make</code>), you might try to clean up a little bit the opam internal state with the following commands:
+
<code> git pull </code>の後でビルドが失敗した場合(<code> make build-deps </code>または<code> make </code>)、 opamの内部状態を次のコマンドで表示します。
  
 
::
 
::
  
<pre>opam update
+
<pre> opamの更新
opam pin list -s | xargs opam pin remove
+
opamピンリスト-s | xargs opam pin取り外し
make build-deps
+
ビルデンプルを作る
make</pre>
+
make </pre>
== Running the node ==
+
==ノードの実行==
  
So far there is no official Tezos network being run, but you might run a local test network (the development team is running its own testnet, if you’re interested in joining this network, please make a request on our slack channel. We have limited support abilities at the moment but we’ll try to help you best we can).
+
これまでの公式のTezosネットワークは稼働していませんが、ローカルのテストネットワーク(開発チームは独自のテストネットを実行しています。このネットワークに参加することに興味がある場合は、余裕のあるチャンネルでリクエストしてください。現時点では限られたサポート能力がありますが、最善の方法でサポートするよう努力します)。
  
Use the following command to run a node that will accept incoming connections:
+
着信接続を受け入れるノードを実行するには、次のコマンドを使用します。
  
 
::
 
::
  
<pre>./tezos-node identity generate 24.</pre>
+
<pre> ./ tezos-node identity generate 24。</pre>
This will first generate a new node identity and compute the associated stamp of proof-of-work. Then, the node will listen to connections coming in on <code>[::]:9732</code>. All used data is stored at <code>$HOME/.tezos-node/</code>. For example, the default configuration file is at <code>$HOME/.tezos-node/config.json</code>.
+
これは、最初に新しいノードアイデンティティを生成し、関連する職務証明のスタンプを計算する。次に、ノードは<code> [::]:9732 </code>に接続する接続を待ち受けます。使用されたすべてのデータは<code> $ HOME / .tezos-node / </code>に保存されます。たとえば、デフォルト設定ファイルは<code> $ HOME / .tezos-node / config.json </code>にあります。
  
To run multiple nodes on the same machine, you can duplicate and edit <code>$HOME/.tezos-node/config.json</code> while making sure they don’t share paths to the database or any other data file (cf.?options <code>db.store</code> ; <code>db.context</code> ; <code>db.protocol</code>, <code>net.peers-metadata</code> and <code>net.identity</code>).
+
同じマシン上で複数のノードを実行するには、<code> $ HOME / .tezos-node / config.json </code>を複製して編集し、データベースや他のデータファイルへのパスを共有しないようにします<code> db.store </code>; <code> db.context </code>; <code> db.protocol </code><code> net.peers-metadata </code> <code> net.identity </code>)。
  
You could also let Tezos generate a config file by specifying options on the command line. For instance, if <code>$dir/config.json</code> does not exist, the following command will generate it and replace the default values with the values from the command line:
+
コマンドラインでオプションを指定することで、Tezosに設定ファイルを生成させることもできます。たとえば、<code> $ dir / config.json </code>が存在しない場合、次のコマンドはそれを生成し、デフォルト値をコマンドラインの値に置き換えます。
  
 
::
 
::
  
<pre>./tezos-node run --data-dir &quot;$dir&quot; --net-addr localhost:9733</pre>
+
<pre> ./tezos-node run --data-dir "$ dir" --net-addr localhost:9733 </pre>
The Tezos server has a built-in mechanism to discover peers on the local network (using UDP packets broadcasted on port 7732).
+
Tezosサーバーには、ローカルネットワーク上のピアを検出するためのメカニズムが組み込まれています(ポート7732でブロードキャストされたUDPパケットを使用)。
  
If this mechanism is not sufficient, one can provide Tezos with a list of initial peers, either by editing the option <code>net.bootstrap-peers</code> in the <code>config.json</code> file, or by specifying a command line parameter:
+
このメカニズムが十分でない場合は、<code> config.json </code>ファイルの<code> net.bootstrap-peers </code>オプションを編集するか、コマンドラインパラメータを指定することによって:
  
 
::
 
::
 
+
<pre> ./tezos-node run \
<pre>./tezos-node run \
+
             --data-dir "$ dir" --net-addr localhost:2023 \
             --data-dir &quot;$dir&quot; --net-addr localhost:2023 \
+
             --peer localhost:2021 --peer localhost:2022 </pre>
             --peer localhost:2021 --peer localhost:2022</pre>
+
<code> "$ dir" /config.json </code>が存在する場合、コマンドラインオプションは設定ファイルで読み取られたオプションを上書きします。デフォルトでは、Tezosは既存の<code> "$ dir" /config.json </code>ファイルの内容を変更しません。しかし、次のコマンドラインでコマンドラインパラメータに従ってファイルをリセットまたは更新するようノードに明示的に指示することができます。
If <code>&quot;$dir&quot;/config.json</code> exists, the command line options override those read in the config file. By default, Tezos won’t modify the content of an existing <code>&quot;$dir&quot;/config.json</code> file. But, you may explicit ask the node to reset or to update the file according to the command line parameters with the following commands line:
 
  
 
::
 
::
  
<pre>./tezos-node config reset --data-dir &quot;$dir&quot; --net-addr localhost:9733
+
<pre> ./tezos-node config reset --data-dir "$ dir" --net-addr localhost:9733
./tezos-node config update --data-dir &quot;$dir&quot; --net-addr localhost:9734</pre>
+
./tezos-node config update --data-dir "$ dir" --net-addr localhost:9734 </pre>
== Running the node in a sandbox ==
+
==サンドボックスでノードを実行する==
  
To run a ‘localhost-only’ instance of a Tezos network, we provide two helper scripts:
+
Tezosネットワークの 'localhost-only'インスタンスを実行するために、2つのヘルパースクリプトを用意しています:
  
* <code>./src/bin_node/tezos-sandboxed-node.sh</code>
+
* <code> ./ src / bin_node / tezos-sandboxed-node.sh </code>
* <code>./src/bin_client/tezos-init-sandboxed-client.sh</code>
+
* <code> ./ src / bin_client / tezos-init-sandboxed-client.sh </code>
  
For instance, if you want to run local network with two nodes, in a first terminal, the following command will initialize a node listening for peers on port <code>19731</code> and listening for RPC on port <code>18731</code>.
+
たとえば、最初の端末で2つのノードを持つローカルネットワークを実行する場合、次のコマンドはポート<code> 19731 </code>のピアをリッスンしているポートを初期化し、ポート<code> 18731 </code>
  
 
::
 
::
  
<pre>./src/bin_node/tezos-sandboxed-node.sh 1</pre>
+
<pre> ./ src / bin_node / tezos-sandboxed-node.sh 1 </pre>
This node will store its data in a temporary directory which will be removed when the node is killed.
+
このノードは、ノードが強制終了されると削除される一時ディレクトリにデータを格納します。
 +
 
 +
2番目のノードを起動するには、次のコマンドを実行するだけで、ポート<code> 19739 </code>と<code> 18739 </code>でリッスンします。
  
To launch the second node, just run the following command, it will listen on port <code>19739</code> and <code>18739</code>:
 
  
::
 
  
<pre>./src/bin_node/tezos-sandboxed-node.sh 9</pre>
+
<pre> ./ src / bin_node / tezos-sandboxed-node.sh 9 </pre>
You might replace <code>1</code> or <code>9</code> by any number in between if you want to run more than two nodes. But, if you intend to run a single node network, you might remove the spurious “Too few connections” warnings by lowering the number of expected connection, by running the following command instead:
+
2つ以上のノードを実行する場合は、<code> 1 </code>または<code> 9 </code>を任意の数で置き換えることができます。ただし、単一のノードネットワークを実行する場合は、代わりに次のコマンドを実行して、予想される接続数を減らして「接続が少なすぎます」という警告を削除することがあります。
  
 
::
 
::
  
<pre>./src/bin_node/tezos-sandboxed-node.sh 1 --connections 0</pre>
+
<pre> ./ src / bin_node / tezos-sandboxed-node.sh 1 - connections 0 </pre>
Once your node(s) is/are running, open a new terminal and initialize the “sandboxed” client data:
+
ノードが実行されたら、新しい端末を開き、 "サンドボックス"クライアントデータを初期化します。
  
 
::
 
::
  
<pre>eval `./src/bin_client/tezos-init-sandboxed-client.sh 1`</pre>
+
<pre> eval `./src/bin_client/tezos-init-sandboxed-client.sh 1` </pre>
It will initialize the client data in a temporary directory. It will also defines in the current shell session an alias <code>tezos-client</code> preconfigured for communicating the same-numbered node. For instance:
+
一時ディレクトリにクライアントデータを初期化します。また、現在のシェルセッションで、同じ番号のノードを通信するためにあらかじめ設定された別名<code> tezos-client </code>を定義します。例えば:
  
 
::
 
::
  
<pre>$ tezos-client rpc call blocks/head/hash
+
<pre> $ tezos-client rpc呼び出しブロック/ head / hash
{ &quot;hash&quot;: &quot;BLockGenesisGenesisGenesisGenesisGenesisGeneskvg68z&quot; }</pre>
+
{"ハッシュ": "BLockGenesisGenesisGenesisGenesisGenesisGeneskvg68z" } </pre>
When you bootstrap a new network, the network is initialized with a dummy economic protocol, called “genesis”. If you want to run the same protocol than the alphanet, <code>init-sandboxed-client</code> also defines an alias <code>tezos-activate-alpha</code>, that you need to execute once for activating the whole network. For instance:
+
新しいネットワークをブートストラップすると、ネットワークは「起源」というダミーの経済プロトコルで初期化されます。 <code> init-sandboxed-client </code>は、アルファネットと同じプロトコルを実行したい場合は、別名<code> tezos-activate-alpha </code>を定義します。ネットワーク全体。例えば:
  
 
::
 
::
  
<pre>$ tezos-client rpc call blocks/head/protocol
+
<pre> $ tezos-client rpc呼び出しブロック/ヘッド/プロトコル
{ &quot;protocol&quot;: &quot;ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im&quot; }
+
{"protocol": "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" }
 
$ tezos-activate-alpha
 
$ tezos-activate-alpha
Injected BMBcK869jaHQDc
+
注入BMBcK869jaHQDc
$ tezos-client rpc call blocks/head/protocol
+
$ tezos-client rpc呼び出しブロック/ヘッド/プロトコル
{ &quot;protocol&quot;: &quot;ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK&quot; }</pre>
+
{"プロトコル": "ProtoALphaALphaALphaALphaALphaALphaALdDp3zK" } </pre>
== Configuration options ==
+
==設定オプション==
  
Here is an example configuration file with all parameters specified. Most of the time it uses default values, except for cases where the default is not explanatory enough (i.e. “bootstrap-peers” is an empty list by default). Comments are not allowed in JSON, so this configuration file would not parse. They are just provided here to help writing your own configuration file if needed.
+
以下に、すべてのパラメーターが指定された構成ファイルの例を示します。ほとんどの場合、デフォルト値が十分に説明できない場合を除いて、デフォルト値が使用されます(つまり、デフォルトでは "bootstrap-peers"は空のリストです)。コメントはJSONでは許可されていないため、この設定ファイルは解析されません。必要に応じて独自の設定ファイルを書くのに役立ちます。
  
 
::
 
::
  
<pre>{
+
<pre> {
  
   /* Location of the data dir on disk. */
+
   / *ディスク上のデータディレクトリの場所。 * /
  
   &quot;data-dir&quot;: &quot;/home/tezos/my_data_dir&quot;
+
   "data-dir": "/ home / tezos / my_data_dir"
  
   /* Configuration of net parameters */
+
   / *ネットパラメータの設定* /
  
   &quot;net&quot;: {
+
   "net":{
  
     /* Floating point number between 0 and 256 that represents a
+
     / * aを表す0?256の浮動小数点数
     difficulty, 24 signifies for example that at least 24 leading
+
     難易度24は、例えば少なくとも24人の先導者
     zeroes are expected in the hash. */
+
     ハッシュではゼロが予想されます。 * /
  
     &quot;expected-proof-of-work&quot;: 24.5,
+
     「予想される仕事の証明」:24.5、
  
     /* List of hosts. Tezos can connect to both IPv6 and IPv4
+
     / *ホストのリスト。 TezosはIPv6とIPv4の両方に接続できます
     hosts. If the port is not specified, default port 9732 will be
+
     ホスト。ポートが指定されていない場合、デフォルトのポート9732は
     assumed. */
+
     想定される。 * /
  
     &quot;bootstrap-peers&quot;: [&quot;::1:10732&quot;, &quot;::ffff:192.168.1.3:9733&quot;, &quot;mynode.tezos.com&quot;],
+
     [:: 1:10732 "、" :: ffff:192.168.1.3:9733 "、" mynode.tezos.com "]のような"ブートストラップピア "
 
 
    /* Specify if the network is closed or not. A closed network
 
    allows only peers listed in &quot;bootstrap-peers&quot;. */
 
  
 +
    / *ネットワークが閉じられているかどうかを指定します。閉じたネットワーク
 +
    「ブートストラップピア」にリストされたピアのみを許可する。 * /
 
     &quot;closed&quot;: false,
 
     &quot;closed&quot;: false,
  
     /* Network limits */
+
     / *ネットワーク制限* /
  
    &quot;limits&quot;: {
+
    "limits":{
  
      /* Delay granted to a peer to perform authentication, in
+
      / *認証を行うためにピアに与えられた遅延。
      seconds. */
+
      秒。 * /
  
      &quot;authentication-timeout&quot;: 5,
+
      "authentication-timeout":5、
  
      /* Strict minimum number of connections (triggers an urgent
+
      / *厳密な最小接続数(緊急を引き起こす)
      maintenance). */
+
      メンテナンス)。 * /
  
      &quot;min-connections&quot;: 50,
+
      "min-connections":50、
  
      /* Targeted number of connections to reach when bootstraping /
+
      / *ブートストラップ時に到達するターゲット接続数/
      maintaining. */
+
      維持する。 * /
  
      &quot;expected-connections&quot;: 100,
+
      "expected-connections":100、
  
      /* Maximum number of connections (exceeding peers are
+
      / *接続の最大数(ピアを超えるものは
      disconnected). */
+
      切断された)。 * /
  
      &quot;max-connections&quot;: 200,
+
      "max-connections":200、
  
      /* Number above which pending incoming connections are
+
      / *着信接続が保留中の番号
      immediately rejected. */
+
      すぐに拒否されました。 * /
  
      &quot;backlog&quot;: 20,
+
      "バックログ":20、
  
      /* Maximum allowed number of incoming connections that are
+
      / *接続が許可されている最大数
      pending authentication. */
+
      保留中の認証。 * /
  
      &quot;max-incoming-connections&quot;: 20,
+
      "max-incoming-connections":20、
  
      /* Max download and upload speeds in KiB/s. */
+
      / * KiB / sでの最大ダウンロード速度とアップロード速度。 * /
 +
"最大ダウンロード速度":1024、
 +
      "max-upload-speed":1024、
  
      &quot;max-download-speed&quot;: 1024,
+
      / * read(2)に渡されたバッファのサイズ。 * /
      &quot;max-upload-speed&quot;: 1024,
 
  
      /* Size of the buffer passed to read(2). */
+
      "read-buffer-size":16384、
 +
    }
 +
  }、
  
      &quot;read-buffer-size&quot;: 16384,
+
  / * rpcパラメータの設定* /
    }
 
  },
 
  
  /* Configuration of rpc parameters */
+
  "rpc":{
  
  &quot;rpc&quot;: {
+
    / *聞くホスト。 ポートが指定されていない場合、デフォルト
 +
    ポート8732が仮定されます。 * /
  
    /* Host to listen to. If the port is not specified, the default
+
    "listen-addr": "localhost:8733"、
    port 8732 will be assumed. */
 
  
    &quot;listen-addr&quot;: &quot;localhost:8733&quot;,
+
    / *クロス・ソース・リソース共有パラメータ
 +
    https://en.wikipedia.org/wiki/Cross-origin_resource_sharing * /
  
    /* Cross Origin Resource Sharing parameters, see
+
    "cors-origin":[]、
    https://en.wikipedia.org/wiki/Cross-origin_resource_sharing. */
+
    "cors-headers":[]、
  
    &quot;cors-origin&quot;: [],
+
    / *証明書とキーファイル(TLSを使用する場合に必要)。 * /
    &quot;cors-headers&quot;: [],
 
  
    /* Certificate and key files (necessary when TLS is used). */
+
    "crt": "tezos-node.crt"、
 +
    "key": "tezos-node.key"
 +
  }、
  
    &quot;crt&quot;: &quot;tezos-node.crt&quot;,
+
  / *ログパラメータの設定* /
    &quot;key&quot;: &quot;tezos-node.key&quot;
 
  },
 
  
  /* Configuration of log parameters */
+
  "log":{
  
  &quot;log&quot;: {
+
    / *ロギング機能の出力。 「stdout」、「stderr」、 または
 +
    ログファイルの名前。 * /
 +
「出力」:「tezos-node.log」、
  
     /* Output for the logging function. Either &quot;stdout&quot;, &quot;stderr&quot; or
+
     / *冗長レベル:「致命的」、「エラー」、「警告」、「通知」、
     the name of a log file . */
+
     'info'、 'debug' * /
  
     &quot;output&quot;: &quot;tezos-node.log&quot;,
+
     「レベル」:「情報」、
  
     /* Verbosity level: one of 'fatal', 'error', 'warn', 'notice',
+
     / *ファイングレインロギングの指示。前述の形式と同じ
     'info', 'debug'. */
+
     `tezos-node run --help`、DEBUGセクションです。以下の例では、
 +
    セクション「ネット」は、 &quot;クライアント&quot;で始まるすべてのセクション持っているだろう
 +
    彼らのメッセージはデバッグレベルに記録され、残りの
 +
    ログセクションは通知レベルまで記録されます。 * /
  
     &quot;level&quot;: &quot;info&quot;,
+
     「ルール」:「クライアント*」 - &gt;デバッグ、ネット - &gt;デバッグ、* - &gt;通知」、
  
     /* Fine-grained logging instructions. Same format as described in
+
     / *ログファイルのフォーマットです。
    `tezos-node run --help`, DEBUG section. In the example below,
+
     http://ocsigen.org/lwt/dev/api/Lwt_log_core#2_Logtemplates * /
    sections &quot;net&quot; and all sections starting by &quot;client&quot; will have
 
    their messages logged up to the debug level, whereas the rest of
 
     log sections will be logged up to the notice level. */
 
  
     &quot;rules&quot;: &quot;client* -&gt; debug, net -&gt; debug, * -&gt; notice&quot;,
+
     "テンプレート": "$(日付) - $(セクション):$(メッセージ)"
 +
  }、
  
    /* Format for the log file, see
+
  / *バリデータとmempoolパラメータの設定* /
    http://ocsigen.org/lwt/dev/api/Lwt_log_core#2_Logtemplates. */
 
  
    &quot;template&quot;: &quot;$(date) - $(section): $(message)&quot;
+
   「シェル」:{
   },
 
  
  /* Configuration for the validator and mempool parameters */
+
    / *同期するピアの数
 +
        ノードがブートストラップされたことを宣言する前に。 * /
  
  &quot;shell&quot;: {
+
     "bootstrap_threshold":4
 
 
     /* The number of peers to synchronize with
 
        before declaring the node 'bootstrapped'. */
 
 
 
    &quot;bootstrap_threshold&quot;: 4
 
  
 
   }
 
   }
}</pre>
+
} </pre>
== Debugging ==
+
==デバッグ==
  
It is possible to set independant log levels for different logging sections in Tezos, as well as specifying an output file for logging. See the description of log parameters above as well as documentation under the DEBUG section diplayed by `tezos-node run ?help’.
+
Tezosのさまざまなロギング・セクションに独立したログ・レベルを設定し、ロギング用の出力ファイルを指定することもできます。上のログパラメータの説明と、 `tezos-node run?help 'で表示されるDEBUGセクションのドキュメントを参照してください。
  
== JSON/RPC interface ==
+
== JSON / RPCインターフェース==
  
The Tezos node provides a JSON/RPC interface. Note that it is an RPC, and it is JSON based, but it does not follow the “JSON-RPC” protocol. It is not active by default and it must be explicitely activated with the <code>--rpc-addr</code> option. Typically, if you are not trying to run a local network and just want to explore the RPC, you would run:
+
TezosノードはJSON / RPCインタフェースを提供します。これはRPCであり、JSONベースですが、 "JSON-RPC"プロトコルには従いません。デフォルトではアクティブではなく、明示的に<code> - rpc-addr </code>オプションで有効にする必要があります。通常、ローカルネットワークを実行しようとしておらず、単にRPCを調べたい場合は、次のコマンドを実行します。
  
 
::
 
::
  
<pre>./tezos-node run --rpc-addr localhost</pre>
+
<pre> ./tezos-node run --rpc-addr localhost </pre>
The RPC interface is self-documented and the <code>tezos-client</code> executable is able to pretty-print the RPC API. For instance, to see the API provided by the Tezos Shell:
+
RPCインタフェースは自己文書化されており、<code> tezos-client </code>実行可能ファイルはRPC APIをきれいに印刷することができます。例えば、Tezos Shellが提供するAPIを見るには:
  
 
::
 
::
  
<pre>./tezos-client rpc list</pre>
+
<pre> ./ tezos-client rpc list </pre>
To get API attached to the “genesis” block, including the remote procedures provided by the associated economic protocol version:
+
関連する経済プロトコルバージョンによって提供される遠隔手続きを含むAPIを「起源」ブロックに添付するには:
  
 
::
 
::
  
<pre>./tezos-client rpc list /blocks/genesis/</pre>
+
<pre> ./tezos-client rpc list / blocks / genesis / </pre>
You might also want the JSON schema describing the expected input and output of a RPC. For instance:
+
また、RPCの予想される入出力を記述するJSONスキーマが必要な場合もあります。例えば:
  
 
::
 
::
  
<pre>./tezos-client rpc schema /blocks/genesis/hash</pre>
+
<pre> ./tezos-client rpc schema / blocks / genesis / hash </pre>
Note: you can get the same information, but as a raw JSON object, with a simple HTTP request:
+
注:簡単なHTTPリクエストを使って、同じ情報を得ることができますが、生のJSONオブジェクトとして取得できます。
  
 
::
 
::
 +
<pre> wget --post-data '{"再帰的":true}' -O - http:// localhost:8732 / describe
 +
wget --post-data '{"再帰的":true}' -O - http:// localhost:8732 / describe / blocks / genesis
 +
wget -O - http:// localhost:8732 / describe / blocks / genesis / hash </pre>
 +
==最小限のCLIクライアント==
  
<pre>wget --post-data '{ &quot;recursive&quot;: true }' -O - http://localhost:8732/describe
+
Tezosは、最小限のコマンドラインウォレット<code> tezos-client </code>と管理ツール<code> tezos-admin-client </code>の2つのコマンドラインツールで配布されています。
wget --post-data '{ &quot;recursive&quot;: true }' -O - http://localhost:8732/describe/blocks/genesis
 
wget -O - http://localhost:8732/describe/blocks/genesis/hash</pre>
 
== The minimal CLI client ==
 
 
 
Tezos is distributed with two command line tools: a minimal command line wallet <code>tezos-client</code>, and an administration tool <code>tezos-admin-client</code>.
 
  
Their command line interfaces are described :ref:<code>here&lt;tezos_client_commands&gt;</code> and :ref:<code>here&lt;tezos_admin_client_commands&gt;</code>.
+
これらのコマンドラインインタフェースは、ref:<code> here <ltzte_client_commands&gt; </code>および:ref:<code> here&lt; tezos_admin_client_commands&gt; </code>に記述されています。
  
  

2018年5月30日 (水) 23:56時点における版

ビルドと実行方法

構築手順

Tezosをコンパイルするには、OCamlコンパイラ(バージョン4.06.1)と、さまざまな tezos - *。opam ファイルにリストされているすべてのライブラリが必要です。

すべての依存関係をインストールする最良の方法は、最初にOCamlパッケージマネージャの OPAM <https://opam.ocaml.org/> __をインストールすることです。

次に、Tezos用の新しいスイッチエイリアスを作成する必要があります。スイッチは、OCamlコンパイラ、すべてのパッケージ、プロジェクトに関連するパッケージマネージャの設定など、OPAM設定の独自のバージョンです。これは、プロジェクトが他のOCamlプロジェクトやTezosの他のバージョンと競合しないようにするために必要です。

 opamの更新
opamスイッチ "tezos" --alias-of 4.06.1 

以前に tezos という名前のスイッチを作成したが、古いOCamlバージョンのスイッチを作成した場合は、 opam switch remove "tezos" でスイッチを削除する必要があることに注意してください。

スイッチの準備ができたら、スイッチをアクティブにする必要があります。

 eval `opam config env` 

Tezosが依存するライブラリをインストールします。

 make-depsを作成する

依存関係を構築する際、 opam はOCamlライブラリを正しく扱うことができますが、依存するすべての外部Cライブラリを常に処理できるわけではありません。ほとんどのシステムでは、システムパッケージマネージャーへの呼び出しを提案できますが、現在はバージョンチェックを処理していません。

最後に、プロジェクトをコンパイルします:

 make 

これにより、3つのバイナリが生成されます。

  • tezos-node :tezosデーモン自体。
  • tezos-client :最小限のコマンドラインクライアント。
  • tezos-protocol-compiler :新しいバージョンの経済プロトコルを開発するために使用されるプロトコルコンパイラ。

現在、TezosはLinux向けに開発されています。それはMac OSで動作するはずですが、最近テストされていません。 Windowsポートが進行中です。

make build-deps を実行すると、OPAMは必要なシステム依存関係がインストールされているかどうかを検出します。しかし、あなたが実際に持っているバージョンを検出することはできません。通常、 make はlibsodium&lt; 1.0.11。この場合、最近のバージョンのlibsodiumとlibsodium-devを持っているか、例えばhttps://pkgs.org/download/libsodium18とhttps://pkgs.org/download/libsodiumからダウンロードしてインストールしてください。 -dev

git pull の後でビルドが失敗した場合( make build-deps または make )、 opamの内部状態を次のコマンドで表示します。

 opamの更新
opamピンリスト-s | xargs opam pin取り外し
ビルデンプルを作る
make 

ノードの実行

これまでの公式のTezosネットワークは稼働していませんが、ローカルのテストネットワーク(開発チームは独自のテストネットを実行しています。このネットワークに参加することに興味がある場合は、余裕のあるチャンネルでリクエストしてください。現時点では限られたサポート能力がありますが、最善の方法でサポートするよう努力します)。

着信接続を受け入れるノードを実行するには、次のコマンドを使用します。

 ./ tezos-node identity generate 24。

これは、最初に新しいノードアイデンティティを生成し、関連する職務証明のスタンプを計算する。次に、ノードは [::]:9732 に接続する接続を待ち受けます。使用されたすべてのデータは $ HOME / .tezos-node / に保存されます。たとえば、デフォルト設定ファイルは $ HOME / .tezos-node / config.json にあります。

同じマシン上で複数のノードを実行するには、 $ HOME / .tezos-node / config.json を複製して編集し、データベースや他のデータファイルへのパスを共有しないようにします db.store ; db.context ; db.protocol net.peers-metadata net.identity )。

コマンドラインでオプションを指定することで、Tezosに設定ファイルを生成させることもできます。たとえば、 $ dir / config.json が存在しない場合、次のコマンドはそれを生成し、デフォルト値をコマンドラインの値に置き換えます。

 ./tezos-node run --data-dir "$ dir" --net-addr localhost:9733 

Tezosサーバーには、ローカルネットワーク上のピアを検出するためのメカニズムが組み込まれています(ポート7732でブロードキャストされたUDPパケットを使用)。

このメカニズムが十分でない場合は、 config.json ファイルの net.bootstrap-peers オプションを編集するか、コマンドラインパラメータを指定することによって:

 ./tezos-node run \
             --data-dir "$ dir" --net-addr localhost:2023 \
             --peer localhost:2021 --peer localhost:2022 

"$ dir" /config.json が存在する場合、コマンドラインオプションは設定ファイルで読み取られたオプションを上書きします。デフォルトでは、Tezosは既存の "$ dir" /config.json ファイルの内容を変更しません。しかし、次のコマンドラインでコマンドラインパラメータに従ってファイルをリセットまたは更新するようノードに明示的に指示することができます。

 ./tezos-node config reset --data-dir "$ dir" --net-addr localhost:9733
./tezos-node config update --data-dir "$ dir" --net-addr localhost:9734 

サンドボックスでノードを実行する

Tezosネットワークの 'localhost-only'インスタンスを実行するために、2つのヘルパースクリプトを用意しています:

  • ./ src / bin_node / tezos-sandboxed-node.sh
  • ./ src / bin_client / tezos-init-sandboxed-client.sh

たとえば、最初の端末で2つのノードを持つローカルネットワークを実行する場合、次のコマンドはポート 19731 のピアをリッスンしているポートを初期化し、ポート 18731

 ./ src / bin_node / tezos-sandboxed-node.sh 1 

このノードは、ノードが強制終了されると削除される一時ディレクトリにデータを格納します。

2番目のノードを起動するには、次のコマンドを実行するだけで、ポート 19739 18739 でリッスンします。


 ./ src / bin_node / tezos-sandboxed-node.sh 9 

2つ以上のノードを実行する場合は、 1 または 9 を任意の数で置き換えることができます。ただし、単一のノードネットワークを実行する場合は、代わりに次のコマンドを実行して、予想される接続数を減らして「接続が少なすぎます」という警告を削除することがあります。

 ./ src / bin_node / tezos-sandboxed-node.sh 1 - connections 0 

ノードが実行されたら、新しい端末を開き、 "サンドボックス"クライアントデータを初期化します。

 eval `./src/bin_client/tezos-init-sandboxed-client.sh 1` 

一時ディレクトリにクライアントデータを初期化します。また、現在のシェルセッションで、同じ番号のノードを通信するためにあらかじめ設定された別名 tezos-client を定義します。例えば:

 $ tezos-client rpc呼び出しブロック/ head / hash
{"ハッシュ": "BLockGenesisGenesisGenesisGenesisGenesisGeneskvg68z" } 

新しいネットワークをブートストラップすると、ネットワークは「起源」というダミーの経済プロトコルで初期化されます。 init-sandboxed-client は、アルファネットと同じプロトコルを実行したい場合は、別名 tezos-activate-alpha を定義します。ネットワーク全体。例えば:

 $ tezos-client rpc呼び出しブロック/ヘッド/プロトコル
{"protocol": "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" }
$ tezos-activate-alpha
注入BMBcK869jaHQDc
$ tezos-client rpc呼び出しブロック/ヘッド/プロトコル
{"プロトコル": "ProtoALphaALphaALphaALphaALphaALphaALdDp3zK" } 

設定オプション

以下に、すべてのパラメーターが指定された構成ファイルの例を示します。ほとんどの場合、デフォルト値が十分に説明できない場合を除いて、デフォルト値が使用されます(つまり、デフォルトでは "bootstrap-peers"は空のリストです)。コメントはJSONでは許可されていないため、この設定ファイルは解析されません。必要に応じて独自の設定ファイルを書くのに役立ちます。

 {

  / *ディスク上のデータディレクトリの場所。 * /

  "data-dir": "/ home / tezos / my_data_dir"

  / *ネットパラメータの設定* /

  "net":{

    / * aを表す0?256の浮動小数点数
    難易度24は、例えば少なくとも24人の先導者
    ハッシュではゼロが予想されます。 * /

    「予想される仕事の証明」:24.5、

    / *ホストのリスト。 TezosはIPv6とIPv4の両方に接続できます
    ホスト。ポートが指定されていない場合、デフォルトのポート9732は
    想定される。 * /

    [:: 1:10732 "、" :: ffff:192.168.1.3:9733 "、" mynode.tezos.com "]のような"ブートストラップピア "

    / *ネットワークが閉じられているかどうかを指定します。閉じたネットワーク
    「ブートストラップピア」にリストされたピアのみを許可する。 * /
    "closed": false,

    / *ネットワーク制限* /

     "limits":{

       / *認証を行うためにピアに与えられた遅延。
       秒。 * /

       "authentication-timeout":5、

       / *厳密な最小接続数(緊急を引き起こす)
       メンテナンス)。 * /

       "min-connections":50、

       / *ブートストラップ時に到達するターゲット接続数/
       維持する。 * /

       "expected-connections":100、

       / *接続の最大数(ピアを超えるものは
       切断された)。 * /

       "max-connections":200、

       / *着信接続が保留中の番号
       すぐに拒否されました。 * /

       "バックログ":20、

       / *接続が許可されている最大数
       保留中の認証。 * /

       "max-incoming-connections":20、

       / * KiB / sでの最大ダウンロード速度とアップロード速度。 * /
"最大ダウンロード速度":1024、
       "max-upload-speed":1024、

       / * read(2)に渡されたバッファのサイズ。 * /

       "read-buffer-size":16384、
     }
   }、

   / * rpcパラメータの設定* /

   "rpc":{

     / *聞くホスト。 ポートが指定されていない場合、デフォルト
     ポート8732が仮定されます。 * /

     "listen-addr": "localhost:8733"、

     / *クロス・ソース・リソース共有パラメータ
     https://en.wikipedia.org/wiki/Cross-origin_resource_sharing * /

     "cors-origin":[]、
     "cors-headers":[]、

     / *証明書とキーファイル(TLSを使用する場合に必要)。 * /

     "crt": "tezos-node.crt"、
     "key": "tezos-node.key"
   }、

   / *ログパラメータの設定* /

   "log":{

     / *ロギング機能の出力。 「stdout」、「stderr」、 または
     ログファイルの名前。 * /
「出力」:「tezos-node.log」、

    / *冗長レベル:「致命的」、「エラー」、「警告」、「通知」、
    'info'、 'debug' * /

    「レベル」:「情報」、

    / *ファイングレインロギングの指示。前述の形式と同じ
    `tezos-node run --help`、DEBUGセクションです。以下の例では、
    セクション「ネット」は、 &quot;クライアント&quot;で始まるすべてのセクション持っているだろう
    彼らのメッセージはデバッグレベルに記録され、残りの
    ログセクションは通知レベルまで記録されます。 * /

    「ルール」:「クライアント*」 - &gt;デバッグ、ネット - &gt;デバッグ、* - &gt;通知」、

    / *ログファイルのフォーマットです。
    http://ocsigen.org/lwt/dev/api/Lwt_log_core#2_Logtemplates * /

    "テンプレート": "$(日付) - $(セクション):$(メッセージ)"
  }、

  / *バリデータとmempoolパラメータの設定* /

  「シェル」:{

     / *同期するピアの数
        ノードがブートストラップされたことを宣言する前に。 * /

     "bootstrap_threshold":4

  }
} 

デバッグ

Tezosのさまざまなロギング・セクションに独立したログ・レベルを設定し、ロギング用の出力ファイルを指定することもできます。上のログパラメータの説明と、 `tezos-node run?help 'で表示されるDEBUGセクションのドキュメントを参照してください。

JSON / RPCインターフェース

TezosノードはJSON / RPCインタフェースを提供します。これはRPCであり、JSONベースですが、 "JSON-RPC"プロトコルには従いません。デフォルトではアクティブではなく、明示的に - rpc-addr オプションで有効にする必要があります。通常、ローカルネットワークを実行しようとしておらず、単にRPCを調べたい場合は、次のコマンドを実行します。

 ./tezos-node run --rpc-addr localhost 

RPCインタフェースは自己文書化されており、 tezos-client 実行可能ファイルはRPC APIをきれいに印刷することができます。例えば、Tezos Shellが提供するAPIを見るには:

 ./ tezos-client rpc list 

関連する経済プロトコルバージョンによって提供される遠隔手続きを含むAPIを「起源」ブロックに添付するには:

 ./tezos-client rpc list / blocks / genesis / 

また、RPCの予想される入出力を記述するJSONスキーマが必要な場合もあります。例えば:

 ./tezos-client rpc schema / blocks / genesis / hash 

注:簡単なHTTPリクエストを使って、同じ情報を得ることができますが、生のJSONオブジェクトとして取得できます。

 wget --post-data '{"再帰的":true}' -O - http:// localhost:8732 / describe
wget --post-data '{"再帰的":true}' -O - http:// localhost:8732 / describe / blocks / genesis
wget -O - http:// localhost:8732 / describe / blocks / genesis / hash 

最小限のCLIクライアント

Tezosは、最小限のコマンドラインウォレット tezos-client と管理ツール tezos-admin-client の2つのコマンドラインツールで配布されています。

これらのコマンドラインインタフェースは、ref: here <ltzte_client_commands&gt; および:ref: here&lt; tezos_admin_client_commands&gt; に記述されています。


参考情報

http://doc.tzalpha.net/introduction/howto.html


TezosGithub

https://github.com/tezos/tezos

https://github.com/tezos/tezos/tree/alphanet

Tezosのドキュメント

http://doc.tzalpha.net/