Ethereumクライアント Geth(Go-Ethereum) を Ubuntu 18.04 へインストールした際の備忘録
geth のインストール
1. Ethereum のレポジトリから geth をダウンロード/インストール
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install -y ethereumsudo add-apt-repository -y ppa:ethereum/ethereum Hit:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB] Get:5 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease [15.4 kB] Get:6 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 Packages [3328 B] Get:7 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main Translation-en [908 B] Fetched 266 kB in 2s (153 kB/s) Reading package lists... Done sudo apt-get update Hit:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease Hit:5 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease Reading package lists... Done sudo apt-get install -y ethereum Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: abigen bootnode evm geth puppeth rlpdump wnode The following NEW packages will be installed: abigen bootnode ethereum evm geth puppeth rlpdump wnode 0 upgraded, 8 newly installed, 0 to remove and 88 not upgraded. Need to get 23.0 MB of archives. After this operation, 87.0 MB of additional disk space will be used. Get:1 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 abigen amd64 1.8.20+bionic [1465 kB] Get:2 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 bootnode amd64 1.8.20+bionic [3979 kB] Get:3 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 evm amd64 1.8.20+bionic [3908 kB] Get:4 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 geth amd64 1.8.20+bionic [5887 kB] Get:5 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 puppeth amd64 1.8.20+bionic [2654 kB] Get:6 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 rlpdump amd64 1.8.20+bionic [624 kB] Get:7 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 wnode amd64 1.8.20+bionic [4454 kB] Get:8 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic/main amd64 ethereum amd64 1.8.20+bionic [1596 B] Fetched 23.0 MB in 49s (469 kB/s) Selecting previously unselected package abigen. (Reading database ... 83964 files and directories currently installed.) Preparing to unpack .../0-abigen_1.8.20+bionic_amd64.deb ... Unpacking abigen (1.8.20+bionic) ... Selecting previously unselected package bootnode. Preparing to unpack .../1-bootnode_1.8.20+bionic_amd64.deb ... Unpacking bootnode (1.8.20+bionic) ... Selecting previously unselected package evm. Preparing to unpack .../2-evm_1.8.20+bionic_amd64.deb ... Unpacking evm (1.8.20+bionic) ... Selecting previously unselected package geth. Preparing to unpack .../3-geth_1.8.20+bionic_amd64.deb ... Unpacking geth (1.8.20+bionic) ... Selecting previously unselected package puppeth. Preparing to unpack .../4-puppeth_1.8.20+bionic_amd64.deb ... Unpacking puppeth (1.8.20+bionic) ... Selecting previously unselected package rlpdump. Preparing to unpack .../5-rlpdump_1.8.20+bionic_amd64.deb ... Unpacking rlpdump (1.8.20+bionic) ... Selecting previously unselected package wnode. Preparing to unpack .../6-wnode_1.8.20+bionic_amd64.deb ... Unpacking wnode (1.8.20+bionic) ... Selecting previously unselected package ethereum. Preparing to unpack .../7-ethereum_1.8.20+bionic_amd64.deb ... Unpacking ethereum (1.8.20+bionic) ... Setting up bootnode (1.8.20+bionic) ... Setting up puppeth (1.8.20+bionic) ... Setting up evm (1.8.20+bionic) ... Setting up abigen (1.8.20+bionic) ... Setting up rlpdump (1.8.20+bionic) ... Setting up wnode (1.8.20+bionic) ... Setting up geth (1.8.20+bionic) ... Setting up ethereum (1.8.20+bionic) ...
2. インストール確認
geth --helpNAME:
   geth - the go-ethereum command line interface
   Copyright 2013-2018 The go-ethereum Authors
USAGE:
   geth [options] command [command options] [arguments...]
   
VERSION:
   1.8.11-stable
   
COMMANDS:
   account                              Manage accounts
   attach                               Start an interactive JavaScript environment (connect to node)
   bug                                  opens a window to report a bug on the geth repo
   console                              Start an interactive JavaScript environment
   copydb                               Create a local chain from a target chaindata folder
   dump                                 Dump a specific block from storage
   dumpconfig                           Show configuration values
   export                               Export blockchain into file
   export-preimages                     Export the preimage database into an RLP stream
   import                               Import a blockchain file
   import-preimages                     Import the preimage database from an RLP stream
   init                                 Bootstrap and initialize a new genesis block
   js                                   Execute the specified JavaScript files
   license                              Display license information
   makecache                            Generate ethash verification cache (for testing)
   makedag                              Generate ethash mining DAG (for testing)
   monitor                              Monitor and visualize node metrics
   removedb                             Remove blockchain and state databases
   version                              Print version numbers
   wallet                               Manage Ethereum presale wallets
   help, h                              Shows a list of commands or help for one command
   
ETHEREUM OPTIONS:
  --config value                        TOML configuration file
  --datadir "/home/ligi/.ethereum"      Data directory for the databases and keystore
  --keystore                            Directory for the keystore (default = inside the datadir)
  --nousb                               Disables monitoring for and managing USB hardware wallets
  --networkid value                     Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby) (default: 1)
  --testnet                             Ropsten network: pre-configured proof-of-work test network
  --rinkeby                             Rinkeby network: pre-configured proof-of-authority test network
  --syncmode "fast"                     Blockchain sync mode ("fast", "full", or "light")
  --gcmode value                        Blockchain garbage collection mode ("full", "archive") (default: "full")
  --ethstats value                      Reporting URL of a ethstats service (nodename:secret@host:port)
  --identity value                      Custom node name
  --lightserv value                     Maximum percentage of time allowed for serving LES requests (0-90) (default: 0)
  --lightpeers value                    Maximum number of LES client peers (default: 100)
  --lightkdf                            Reduce key-derivation RAM & CPU usage at some expense of KDF strength
  
DEVELOPER CHAIN OPTIONS:
  --dev                                 Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
  --dev.period value                    Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)
  
ETHASH OPTIONS:
  --ethash.cachedir                     Directory to store the ethash verification caches (default = inside the datadir)
  --ethash.cachesinmem value            Number of recent ethash caches to keep in memory (16MB each) (default: 2)
  --ethash.cachesondisk value           Number of recent ethash caches to keep on disk (16MB each) (default: 3)
  --ethash.dagdir "/home/ligi/.ethash"  Directory to store the ethash mining DAGs (default = inside home folder)
  --ethash.dagsinmem value              Number of recent ethash mining DAGs to keep in memory (1+GB each) (default: 1)
  --ethash.dagsondisk value             Number of recent ethash mining DAGs to keep on disk (1+GB each) (default: 2)
  
TRANSACTION POOL OPTIONS:
  --txpool.nolocals                     Disables price exemptions for locally submitted transactions
  --txpool.journal value                Disk journal for local transaction to survive node restarts (default: "transactions.rlp")
  --txpool.rejournal value              Time interval to regenerate the local transaction journal (default: 1h0m0s)
  --txpool.pricelimit value             Minimum gas price limit to enforce for acceptance into the pool (default: 1)
  --txpool.pricebump value              Price bump percentage to replace an already existing transaction (default: 10)
  --txpool.accountslots value           Minimum number of executable transaction slots guaranteed per account (default: 16)
  --txpool.globalslots value            Maximum number of executable transaction slots for all accounts (default: 4096)
  --txpool.accountqueue value           Maximum number of non-executable transaction slots permitted per account (default: 64)
  --txpool.globalqueue value            Maximum number of non-executable transaction slots for all accounts (default: 1024)
  --txpool.lifetime value               Maximum amount of time non-executable transaction are queued (default: 3h0m0s)
  
PERFORMANCE TUNING OPTIONS:
  --cache value                         Megabytes of memory allocated to internal caching (default: 1024)
  --cache.database value                Percentage of cache memory allowance to use for database io (default: 75)
  --cache.gc value                      Percentage of cache memory allowance to use for trie pruning (default: 25)
  --trie-cache-gens value               Number of trie node generations to keep in memory (default: 120)
  
ACCOUNT OPTIONS:
  --unlock value                        Comma separated list of accounts to unlock
  --password value                      Password file to use for non-interactive password input
  
API AND CONSOLE OPTIONS:
  --rpc                                 Enable the HTTP-RPC server
  --rpcaddr value                       HTTP-RPC server listening interface (default: "localhost")
  --rpcport value                       HTTP-RPC server listening port (default: 8545)
  --rpcapi value                        API's offered over the HTTP-RPC interface
  --ws                                  Enable the WS-RPC server
  --wsaddr value                        WS-RPC server listening interface (default: "localhost")
  --wsport value                        WS-RPC server listening port (default: 8546)
  --wsapi value                         API's offered over the WS-RPC interface
  --wsorigins value                     Origins from which to accept websockets requests
  --ipcdisable                          Disable the IPC-RPC server
  --ipcpath                             Filename for IPC socket/pipe within the datadir (explicit paths escape it)
  --rpccorsdomain value                 Comma separated list of domains from which to accept cross origin requests (browser enforced)
  --rpcvhosts value                     Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")
  --jspath loadScript                   JavaScript root path for loadScript (default: ".")
  --exec value                          Execute JavaScript statement
  --preload value                       Comma separated list of JavaScript files to preload into the console
  
NETWORKING OPTIONS:
  --bootnodes value                     Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)
  --bootnodesv4 value                   Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)
  --bootnodesv5 value                   Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)
  --port value                          Network listening port (default: 30303)
  --maxpeers value                      Maximum number of network peers (network disabled if set to 0) (default: 25)
  --maxpendpeers value                  Maximum number of pending connection attempts (defaults used if set to 0) (default: 0)
  --nat value                           NAT port mapping mechanism (any|none|upnp|pmp|extip:) (default: "any")
  --nodiscover                          Disables the peer discovery mechanism (manual peer addition)
  --v5disc                              Enables the experimental RLPx V5 (Topic Discovery) mechanism
  --netrestrict value                   Restricts network communication to the given IP networks (CIDR masks)
  --nodekey value                       P2P node key file
  --nodekeyhex value                    P2P node key as hex (for testing)
  
MINER OPTIONS:
  --mine                                Enable mining
  --minerthreads value                  Number of CPU threads to use for mining (default: 8)
  --etherbase value                     Public address for block mining rewards (default = first account created) (default: "0")
  --targetgaslimit value                Target gas limit sets the artificial target gas floor for the blocks to mine (default: 4712388)
  --gasprice "18000000000"              Minimal gas price to accept for mining a transactions
  --extradata value                     Block extra data set by the miner (default = client version)
  
GAS PRICE ORACLE OPTIONS:
  --gpoblocks value                     Number of recent blocks to check for gas prices (default: 20)
  --gpopercentile value                 Suggested gas price is the given percentile of a set of recent transaction gas prices (default: 60)
  
VIRTUAL MACHINE OPTIONS:
  --vmdebug                             Record information useful for VM and contract debugging
  
LOGGING AND DEBUGGING OPTIONS:
  --metrics                             Enable metrics collection and reporting
  --fakepow                             Disables proof-of-work verification
  --nocompaction                        Disables db compaction after import
  --verbosity value                     Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)
  --vmodule value                       Per-module verbosity: comma-separated list of = (e.g. eth/*=5,p2p=4)
  --backtrace value                     Request a stack trace at a specific logging statement (e.g. "block.go:271")
  --debug                               Prepends log messages with call-site location (file and line number)
  --pprof                               Enable the pprof HTTP server
  --pprofaddr value                     pprof HTTP server listening interface (default: "127.0.0.1")
  --pprofport value                     pprof HTTP server listening port (default: 6060)
  --memprofilerate value                Turn on memory profiling with the given rate (default: 524288)
  --blockprofilerate value              Turn on block profiling with the given rate (default: 0)
  --cpuprofile value                    Write CPU profile to the given file
  --trace value                         Write execution trace to the given file
  
WHISPER (EXPERIMENTAL) OPTIONS:
  --shh                                 Enable Whisper
  --shh.maxmessagesize value            Max message size accepted (default: 1048576)
  --shh.pow value                       Minimum POW accepted (default: 0.2)
  
DEPRECATED OPTIONS:
  --fast                                Enable fast syncing through state downloads (replaced by --syncmode)
  --light                               Enable light client mode (replaced by --syncmode)
  
MISC OPTIONS:
  --help, -h                            show help
  
COPYRIGHT:
   Copyright 2013-2018 The go-ethereum Authors
COMMANDS: account アカウントを管理する attach インタラクティブなJavaScript環境を起動する(ノードに接続する) bug gethリポジトリのバグを報告するウィンドウを開く console インタラクティブなJavaScript環境を起動する copydb ターゲットのチェーンデータフォルダからローカルチェーンを作成する dump 特定のブロックをストレージからダンプする dumpconfig 設定値を表示する export ブロックチェーンをファイルにエクスポート export-preimages preimageデータベースをRLPストリームにエクスポートする import ブロックチェーンファイルをインポートする import-preimages RLPストリームからプリイメージデータベースをインポートする init ブートストラップして新しいジェネシスブロックを初期化する js 指定されたJavaScriptファイルを実行する license ライセンス情報を表示する makecache ethash検証キャッシュを生成する(テスト用) makedag エタッシュマイニングDAGの生成(テスト用) monitor ノードメトリクスを監視および視覚化する removedb ブロックチェーンと状態データベースを削除する version バージョン番号を印刷する wallet Ethereumプリセール財布の管理 help, h コマンドのリストまたは1つのコマンドのヘルプを表示します ETHEREUM OPTIONS: --config value TOML設定ファイル --datadir "/home/ligi/.ethereum" データベースとキーストアのデータディレクトリ --keystore キーストアのディレクトリ(デフォルト=データディレクトリ内) --nousb USBハードウェアウォレットの監視と管理を無効にします。 --networkid value ネットワーク識別番号(整数, 1=本番, 2=Morden (使われていない), 3=Ropstenテストネットワーク, 4=Rinkebyテストネットワーク) (デフォルトは 1) --testnet Ropstenネットワーク:事前設定済みの作業確認テストネットワーク --rinkeby Rinkebyネットワーク:事前設定された認証証明テストネットワーク --syncmode "fast" ブロックチェーン同期モード( "fast"、 "full"、または "light") --gcmode value ブロックチェーンガベージコレクションモード( "full"、 "archive")(デフォルト: "full") --ethstats value ethstatsサービスのレポートURL(nodename:secret @ host:port) --identity value カスタムノード名 --lightserv value LES要求を処理するために許可されている時間の最大パーセンテージ(0?90)(デフォルト:0) --lightpeers value LESクライアントピアの最大数(デフォルト:100) --lightkdf KDFの強度を犠牲にして、キー派生RAMとCPUの使用量を減らす DEVELOPER CHAIN OPTIONS: --dev 事前に資金を供給された開発者アカウントを使用して、マイニングを有効にした一時的な証明ネットワーク --dev.period value 開発者モードで使用するブロック期間(0 =トランザクションが保留中の場合にのみ採掘)(デフォルト:0) ETHASH OPTIONS: --ethash.cachedir ethash検証キャッシュを保存するディレクトリ(デフォルト= datadirの内側) --ethash.cachesinmem value メモリに保持する最近のethashキャッシュの数(各16MB)(デフォルト:2) --ethash.cachesondisk value ディスク上に保持する最近のethashキャッシュの数(各16MB)(デフォルト:3) --ethash.dagdir "/home/ligi/.ethash" ethashマイニングDAGを保存するディレクトリ(デフォルト=ホームフォルダ内) --ethash.dagsinmem value メモリ内に保持する最近のエタッシュマイニングDAGの数(各1 GB)(デフォルト:1) --ethash.dagsondisk value ディスク上に保持する最近のエタッシュマイニングDAGの数(各1 GB)(デフォルト:2) TRANSACTION POOL OPTIONS: --txpool.nolocals ローカルで送信されたトランザクションの価格免除を無効にします --txpool.journal value ノードの再起動に耐えるためのローカルトランザクション用のディスクジャーナル(デフォルト: "transactions.rlp") --txpool.rejournal value ローカルトランザクションジャーナルを再生成する時間間隔(デフォルト:1h0m0s) --txpool.pricelimit value プールへの受け入れを強制するための最低ガス価格制限(デフォルト:1) --txpool.pricebump value 既存の取引を置き換える価格バンプ率(デフォルト:10) --txpool.accountslots value アカウントごとに保証されている実行可能トランザクションスロットの最小数(デフォルト:16) --txpool.globalslots value 全アカウントの実行可能トランザクションスロットの最大数(デフォルト:4096) --txpool.accountqueue value アカウントごとに許可されている実行不能トランザクションスロットの最大数(デフォルト:64) --txpool.globalqueue value 全アカウントの実行不可トランザクションスロットの最大数(デフォルト:1024) --txpool.lifetime value 実行不能トランザクションがキューに入れられる最大時間(デフォルト:3h0m0s) PERFORMANCE TUNING OPTIONS: --cache value 内部キャッシュに割り当てられているメガバイト単位のメモリ(デフォルト:1024) --cache.database value データベースioに使用するキャッシュメモリの許容量の割合(デフォルト:75) --cache.gc value トライプルーニングに使用するキャッシュメモリ許容量の割合(デフォルト:25) --trie-cache-gens value メモリに保持するトライノードの世代数(デフォルト:120) ACCOUNT OPTIONS: --unlock value ロックを解除するアカウントのカンマ区切りリスト --password value 非対話型パスワード入力に使用するパスワードファイル API AND CONSOLE OPTIONS: --rpc HTTP-RPCサーバーを有効にする --rpcaddr value HTTP-RPCサーバーリスニングインタフェース(デフォルト: "localhost") --rpcport value HTTP-RPCサーバーのリスニングポート(デフォルト:8545) --rpcapi value HTTP-RPCインターフェースを介して提供されるAPI --ws WS-RPCサーバーを有効にする --wsaddr value WS-RPCサーバー待機インターフェース(デフォルト: "localhost") --wsport value WS-RPCサーバーの待機ポート(デフォルト:8546) --wsapi value WS-RPCインターフェースを介して提供されるAPI --wsorigins value WebSocketリクエストを受け付ける元のもの --ipcdisable IPC-RPCサーバーを無効にする --ipcpath データディレクトリ内のIPCソケット/パイプのファイル名(明示的なパスはそれをエスケープします) --rpccorsdomain value クロスオリジンリクエストを受け付けるドメインのカンマ区切りリスト(ブラウザによる) --rpcvhosts value 要求を受け付ける仮想ホスト名のコンマ区切りリスト(サーバー強制)。 ワイルドカード「*」を受け入れます。 (デフォルト: "localhost") --jspath loadScript loadScriptのJavaScriptルートパス(デフォルト: "。") --exec value JavaScriptステートメントを実行する --preload value コンソールにプリロードするJavaScriptファイルのコンマ区切りリスト NETWORKING OPTIONS: --bootnodes value P2Pディスカバリーブートストラップ用のカンマ区切りのenode URL(代わりにライトサーバーの場合はv4 + v5に設定) --bootnodesv4 value P2P v4ディスカバリーブートストラップ用のカンマ区切りenode URL(ライトサーバー、フルノード) --bootnodesv5 value P2P v5ディスカバリーブートストラップ(ライトサーバー、ライトノード)用のカンマ区切りのenode URL --port value ネットワーク待機ポート(デフォルト:30303) --maxpeers value ネットワークピアの最大数(0に設定されている場合はネットワークが無効)(デフォルト:25) --maxpendpeers value 保留中の接続試行の最大数(0に設定されている場合はデフォルトが使用されます)(デフォルト:0) --nat value NATポートマッピングメカニズム(any | none | upnp | pmp | extip:)(デフォルト: "any") --nodiscover ピア検出メカニズムを無効にします(手動ピア追加) --v5disc 実験的なRLPx V 5(トピック検出)メカニズムを有効にします。 --netrestrict value ネットワーク通信を特定のIPネットワークに制限します(CIDRマスク)。 --nodekey value P2Pノード鍵ファイル --nodekeyhex value 16進数としてのP2Pノードキー(テスト用) MINER OPTIONS: --mine マイニングを有効にする --minerthreads value マイニングに使用するCPUスレッド数(デフォルト:8) --etherbase value ブロックマイニング報酬の公開アドレス(デフォルト=最初に作成されたアカウント)(デフォルト: "0") --targetgaslimit value ターゲットガス制限は、鉱山に採掘するブロックの人工ターゲットガスフロアを設定します(デフォルト:4712388)。 --gasprice "18000000000" 取引の採掘に必要な最小限のガス価格 --extradata value マイナーによる追加データセットのブロック(デフォルト=クライアントバージョン) GAS PRICE ORACLE OPTIONS: --gpoblocks value GAS価格をチェックするための最近のブロック数(デフォルト:20) --gpopercentile value 推奨GAS価格は、最近のトランザクションGAS価格のセットに対するデフォルトのパーセンタイルです(デフォルト:60)。 VIRTUAL MACHINE OPTIONS: --vmdebug VMおよび契約のデバッグに役立つ情報を記録する LOGGING AND DEBUGGING OPTIONS: --metrics 指標の収集と報告を有効にする --fakepow 作業証明の検証を無効にします --nocompaction インポート後にデータベースの圧縮を無効にします。 --verbosity value ログの冗長性:0 =無音、1 =エラー、2 =警告、3 =情報、4 =デバッグ、5 =詳細(デフォルト:3) --vmodule value モジュールごとの冗長性:<パターン> = <レベル>のコンマ区切りリスト(例:eth / * = 5、p2p = 4) --backtrace value 特定のロギングステートメント(例: "block.go:271")でスタックトレースを要求します --debug ログメッセージに通話サイトの場所(ファイルと行番号)を付加します。 --pprof pprof HTTPサーバーを有効にする --pprofaddr value pprof HTTPサーバーリスニングインタフェース(デフォルト: "127.0.0.1") --pprofport value pprof HTTPサーバーの待ち受けポート(デフォルト:6060) --memprofilerate value 与えられたレートでメモリプロファイリングを有効にします(デフォルト:524288) --blockprofilerate value 与えられたレートでブロックプロファイリングを有効にします(デフォルト:0) --cpuprofile value 与えられたファイルにCPUプロファイルを書き込む --trace value 与えられたファイルに実行トレースを書き込む WHISPER (EXPERIMENTAL) OPTIONS: --shh WHISPERを有効にする --shh.maxmessagesize value 許容最大メッセージサイズ(デフォルト:1048576) --shh.pow value 受け入れられる最低捕虜(デフォルト:0.2) DEPRECATED OPTIONS: --fast 状態のダウンロードによる高速同期を有効にします(--syncmodeに置き換えられました) --light ライトクライアントモードを有効にします(--syncmodeに置き換えられました) MISC OPTIONS: --help, -h ヘルプを表示 COPYRIGHT: Copyright 2013-2018 The go-ethereum Authors 
supervisor による geth プロセスの自動起動化
1. supervisor のインストール
sudo apt-get install -y supervisor
sudo mkdir /var/log/supervisor/jobssudo apt-get install -y supervisor Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-meld3 python-minimal python-pkg-resources python2.7 python2.7-minimal Suggested packages: python-doc python-tk python-setuptools python2.7-doc binutils binfmt-support supervisor-doc The following NEW packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-meld3 python-minimal python-pkg-resources python2.7 python2.7-minimal supervisor 0 upgraded, 10 newly installed, 0 to remove and 88 not upgraded. Need to get 4380 kB of archives. After this operation, 18.9 MB of additional disk space will be used. Get:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7-minimal amd64 2.7.15~rc1-1ubuntu0.1 [334 kB] Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python2.7-minimal amd64 2.7.15~rc1-1ubuntu0.1 [1304 kB] Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 python-minimal amd64 2.7.15~rc1-1 [28.1 kB] Get:4 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7-stdlib amd64 2.7.15~rc1-1ubuntu0.1 [1912 kB] Get:5 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python2.7 amd64 2.7.15~rc1-1ubuntu0.1 [238 kB] Get:6 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libpython-stdlib amd64 2.7.15~rc1-1 [7620 B] Get:7 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 python amd64 2.7.15~rc1-1 [140 kB] Get:8 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 python-pkg-resources all 39.0.1-2 [128 kB] Get:9 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 python-meld3 all 1.0.2-2 [30.9 kB] Get:10 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 supervisor all 3.3.1-1.1 [256 kB] Fetched 4380 kB in 0s (15.6 MB/s) Selecting previously unselected package libpython2.7-minimal:amd64. (Reading database ... 84002 files and directories currently installed.) Preparing to unpack .../0-libpython2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb ... Unpacking libpython2.7-minimal:amd64 (2.7.15~rc1-1ubuntu0.1) ... Selecting previously unselected package python2.7-minimal. Preparing to unpack .../1-python2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb ... Unpacking python2.7-minimal (2.7.15~rc1-1ubuntu0.1) ... Selecting previously unselected package python-minimal. Preparing to unpack .../2-python-minimal_2.7.15~rc1-1_amd64.deb ... Unpacking python-minimal (2.7.15~rc1-1) ... Selecting previously unselected package libpython2.7-stdlib:amd64. Preparing to unpack .../3-libpython2.7-stdlib_2.7.15~rc1-1ubuntu0.1_amd64.deb ... Unpacking libpython2.7-stdlib:amd64 (2.7.15~rc1-1ubuntu0.1) ... Selecting previously unselected package python2.7. Preparing to unpack .../4-python2.7_2.7.15~rc1-1ubuntu0.1_amd64.deb ... Unpacking python2.7 (2.7.15~rc1-1ubuntu0.1) ... Selecting previously unselected package libpython-stdlib:amd64. Preparing to unpack .../5-libpython-stdlib_2.7.15~rc1-1_amd64.deb ... Unpacking libpython-stdlib:amd64 (2.7.15~rc1-1) ... Setting up libpython2.7-minimal:amd64 (2.7.15~rc1-1ubuntu0.1) ... Setting up python2.7-minimal (2.7.15~rc1-1ubuntu0.1) ... Linking and byte-compiling packages for runtime python2.7... Setting up python-minimal (2.7.15~rc1-1) ... Selecting previously unselected package python. (Reading database ... 84749 files and directories currently installed.) Preparing to unpack .../python_2.7.15~rc1-1_amd64.deb ... Unpacking python (2.7.15~rc1-1) ... Selecting previously unselected package python-pkg-resources. Preparing to unpack .../python-pkg-resources_39.0.1-2_all.deb ... Unpacking python-pkg-resources (39.0.1-2) ... Selecting previously unselected package python-meld3. Preparing to unpack .../python-meld3_1.0.2-2_all.deb ... Unpacking python-meld3 (1.0.2-2) ... Selecting previously unselected package supervisor. Preparing to unpack .../supervisor_3.3.1-1.1_all.deb ... Unpacking supervisor (3.3.1-1.1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for ureadahead (0.100.0-20) ... Processing triggers for systemd (237-3ubuntu10.9) ... Processing triggers for man-db (2.8.3-2) ... Setting up libpython2.7-stdlib:amd64 (2.7.15~rc1-1ubuntu0.1) ... Setting up python2.7 (2.7.15~rc1-1ubuntu0.1) ... Setting up libpython-stdlib:amd64 (2.7.15~rc1-1) ... Setting up python (2.7.15~rc1-1) ... Setting up python-meld3 (1.0.2-2) ... Setting up python-pkg-resources (39.0.1-2) ... Setting up supervisor (3.3.1-1.1) ... Created symlink /etc/systemd/system/multi-user.target.wants/supervisor.service → /lib/systemd/system/supervisor.service. Processing triggers for systemd (237-3ubuntu10.9) ... Processing triggers for ureadahead (0.100.0-20) ...
2. supervisor に geth プロセスを追加
sudo vi /etc/supervisor/conf.d/geth.conf
※ geth のパラメータは前述の geth help 参照
[program:Geth]
command=/usr/bin/geth --syncmode "fast" --trie-cache-gens=240 --maxpeers=100 --cache=2048 --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpccorsdomain * --rpcapi eth,net,web3
user=root
autorestart=true
stdout_logfile=/var/log/supervisor/jobs/geth.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=5
stdout_capture_maxbytes=1MB
redirect_stderr=true3. supervisor を再起動し設定を反映
sudo supervisorctl reloadgeth の同期確認
1. geth で接続し同期開始の確認
geth attach http://localhost:8545
  > eth.blockNumber
  > web3.eth.syncing
  > net.peerCountgeth attach http://localhost:8545
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.20-stable-24d727b6/linux-amd64/go1.10.4
 modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
> eth.blockNumber
0
> web3.eth.syncing
{
  currentBlock: 2577,
  highestBlock: 6942752,
  knownStates: 26071,
  pulledStates: 3729,
  startingBlock: 0
}
> net.peerCount
1
> 
同期中 :web3.eth.syncing でレスポンス、eth.blockNumber が 0
 同期完了:web3.eth.syncing が false
ノード構築後、イーサリアムのウォレットを作るには、web3ライブラリを使用します。
 CRYPTO LIFE