Parityノード運用のナレッジ
知見がばらけているのでかける人はどんどん書き込んで欲しいです。
ライブで詰まった問題とかも書いているので情報ある方はお気軽にぜひ
起動オプション
config.tomlのデフォルトで書かれている内容で、現在は使われないオプションも結構あるので注意
同期オプション
Warp-sync
5000ブロックごとに作られるstate のスナップショットをはじめにダウンロードするショートカット同期オプション。デフォルトでTrue
Pruning= archive / fast
全てのブロックのstateを保持するpruning=archiveモード
ある程度の期間以外でstateを捨てていくpruning=fastモード
state保持オプション
pruning-history
fast sync でstateを保持するブロック数指定
検証内容
Ethereumにおけるparityクライアントのstate保存オプションを検証する
tracingオプション
コントラクトの実行結果をトレースするオプション
traceDBという概念のものに入っているらしい
これをすると、ERC20トークンとかで書き込まれるイベントログを集めることができる
オプションの優劣関係
tracing=on だとwarp-syncができない模様 ( Warning: Warp Sync is disabled because tracing is turned on.)
pruning-historyがpruninge-memoryより優先される模様
ログの見方
同期ログの見方
2018-12-19 06:51:59 UTC Syncing #6883046 0x21ce…85d2 0.44 blk/s 33.6 tx/s 2 Mgas/s 1713+ 1 Qed #6884761 25/25 peers 7 MiB chain 7 GiB db 112 MiB queue 5 MiB sync RPC: 0 conn, 427 req/s, 59 µs 0x21ce…85d2 - 現在のブロックハッシュ
0.44block/s - 秒間ブロックダウンロードスピード per second
33.6tx/s - 秒間トランザクションスピード per second
2Mgas/s - million gas processed/s
1713+ - unverified queue size
1 Qed - verified queue size
7 MiB chain - ブロックチェーンのキャッシュで使われているメモリ
7 GiB db - 7 GiB dbB使っている。
112MiB queue - queue 利用メモリ
5 MiB sync - 同期で使われているメモリ
RPC: 0conn - RPC接続数
427 req/s -
59 µs -
このコードで作られているらしい
少し古いけどQAサイトでの質問
Reorgログ
2018-12-24 07:15:55 UTC Reorg to #6942977 0x0e98…cf76 (0x4246…c7ba #6942975 0x0510…82c6 0xdb1a…45dc) Reorgはログが出る
同期後のsnapshotログ
これは何?
2019-01-08 08:13:55 UTC Snapshot: 40643 accounts 5000 blocks 108314356 bytes
「何もしてないのに動かなくなりました」
同期が止まった
接続peerが不調で新規ブロックが投げれてこない => 他Peerと繋ぎ直し
リソース不足で同期したブロックをディスクに書き込むのが追いつかない => freeコマンドなどでメモリ使用状況などを確認
DBと接続できない
DBが壊れた = > 原因と良い解決法が見つからず。rocksDBでChecksumのエラー?ログは以下。
2018-12-19 07:02:16 UTC DB corrupted: Invalid argument: You have to open all column families. Column families not opened: col7, col6,col5, col4, col0, col1, col2, col3, attempting repair
以下でも課題に上がっている
DBのロックが残っている
=> LOCKファイルを削除する
Failed to open database Custom { kind: Other, error: StringError("IO error: while open a file for lock: /home/parity/.local/share/io.parity.ethereum/chains/ethereum/db/906a34e69aec8c0d/overlayrecent/db/LOCK: Permission denied") }
ノードが立ち上がらない
Parityノードを立ち上げる際にError upgrading parity data: CannotCreateConfigPathのエラーが出る場合
Parityノードを立ち上げる際にError upgrading parity data: CannotWriteVersionFileのエラーが出る場合
=> 「chains/ver.lock」が作れない時に起こる。権限問題か、すでにあるなど。ちなみに中にはParityのバージョン番号が書かれている
There's no longer error message.
It happens when db_path is not writable, thus chains/ver.lock cannot be created.
Mining Option
notify-work
when provided with url, parity will make a HTTP POST request each time new mining job is available. The payload will be json-encoded parameters of the mining job.