LoginSignup
9
2

More than 5 years have passed since last update.

Ethereumクライアント geth起動時のオプションの意味

Last updated at Posted at 2018-06-19
  • 色々資料を見ていても「geth立ち上げ時にはこのコマンド」程度にしか記載がなかったので、自分用にメモ。

入力例


console
$ geth --networkid "15" --nodiscover --datadir "~/Desktop/eth_path" --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --rpcapi "eth,net,web3,personal" --targetgaslimit "20000000" console 2>> ~/Desktop/eth_path/geth_err.log
  • テストネットの起動を想定
  • ~/Desktop/eth_pathにgenesis.json, gethディレクトリ等を配置

各オプションの意味


オプション 説明
--networkid テストネット用のIDを指定(ライブネット(本番環境)では不要)。genesis.jsonに記述したnetworkIdと同一にする。
--nodiscover gethでは同じネットワーク内のノードへの接続を常に試みる仕様となっており、この自動Peer探索機能を使用しないオプション。
--datadir 各種データの出力先指定。genesisブロックで初期化したディレクトリと同一の場所を指定する。
--rpc RPCサーバのAPIを有効にするオプション。※RPC(Remote Procedure Call):遠隔手続呼び出し、ネットワーク上にあるマシンで動いているプログラムと自マシン内で動いているプログラム同士が通信するためのプログラム
--rpcaddr 自分のgethノードのアドレスを指定。ローカル環境なら"127.0.0.1"か"localhost"を使用。
--rpcport RPCAPIのポート番号を指定。特に指定がなければデフォルトの"8545"が設定される。
--rpccorsdomain クロスアクセスドメインを許可するドメイン。アスタリスクは任意のドメインを許可。
--rpcapi gethで利用できる(利用したい)apiを指定。
--targetgaslimit 利用できるGasリミット上限を指定。
console 対話型コンソールの立ち上げ。consoleオプション使用なし+末尾に"&"を付与するとバックグラウンドでgethが立ち上がる。

出力


console
Welcome to the Geth JavaScript console!...(省略)

間違い等あればご指摘ください。

9
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
2