Execution Clientのプルーニング

注記

これはgethnethermindのユーザー向けです。 Besuはプルーニングする必要はありません

主要なExecution clientとしてgethまたはnethermindを使用している場合、ノードの空きディスク容量が時間の経過とともにゆっくりと減少していくことに気付くでしょう。 Execution clientはこれに最も大きく寄与します。rocketpool service configでキャッシュに割り当てたRAMの量に応じて、1日あたり数ギガバイトの速度で増加することがあります。

これに対処するため、Execution clientはプルーニングと呼ばれる特別な機能を提供しており、安全にデータベースをスキャンしてクリーンアップし、空き容量を回復できます。 GethまたはNethermindを使用するすべてのNode Operatorは、いずれプルーニングを行う必要があります。

2 TBのSSDを使用している場合、通常、プルーニングの間隔は数ヶ月になります。 1 TBのSSDユーザーの場合、より頻繁にプルーニングする必要があります。

Grafanaダッシュボードを有効にしている場合、ノードの使用済みディスク容量が80%を超えたら、Execution clientのプルーニングを検討し始める良い目安になります。

プルーニングの時期が来たと判断したら、Smartnodeはリクエストに応じてプルーニングを実行する機能を備えています。 以下を読んで、仕組みと予想される動作を学んでください。

注記

Execution clientのプルーニングはDockerモードでのみ可能です。

Hybridモードの外部クライアントやNativeモードなど、独自のExecution clientを使用している場合、Smartnodeを使用してExecution clientをプルーニングすることはできません。 手動で行う必要があります。 Execution clientのドキュメントを参照して、プルーニング方法を学んでください。

前提条件

以下のタブから使用しているクライアントを選択してください。

Geth
Nethermind

Gethをプルーニングするということは、主要なExecution clientをオフラインにして、自身をクリーンアップさせることを意味します。 これが発生すると、Smartnode(およびConsensus client)は正常に機能するためにETH1チェーンにアクセスする他の方法が必要になります。

これを提供する最も簡単な方法はfallbackノードを使用することです。 rocketpool service configを使用して既にfallbackノードを設定している場合、Gethコンテナがメンテナンスのためにダウンすると、Smartnodeは自動的にそれに切り替わります。 また、Consensus clientにもfallbackを使用するよう通知します。

警告

fallbackノードが設定されていない場合、プルーニングプロセス中にノードは検証を停止します。 完了してネットワークと再同期するまで、すべてのアテステーションとブロック提案を逃します。 この間、検証の失敗によりETHを失います!

これを念頭に置いて、Gethを正常にプルーニングするには以下の2つの条件が必要です。

  • 動作するfallbackノードが設定されていること
  • SSDに少なくとも50 GBの空き容量が残っていること

プルーニングの開始

以下のタブから使用しているクライアントを選択してください。

Geth
Nethermind

Gethをプルーニングする場合は、このコマンドを実行するだけです。

rocketpool service prune-eth1

fallback clientペアが有効になっていない場合、次の警告が表示されます。

This will shut down your main execution client and prune its database, freeing up disk space.
Once pruning is complete, your execution client will restart automatically.

You do not have a fallback execution client configured.
Your node will no longer be able to perform any validation duties (attesting or proposing blocks) until Geth is done pruning and has synced again.
Please configure a fallback client with `rocketpool service config` before running this.
Are you sure you want to prune your main execution client? [y/n]

有効になっている場合は、代わりに次のプロンプトが表示されます。

This will shut down your main execution client and prune its database, freeing up disk space.
Once pruning is complete, your execution client will restart automatically.

You have fallback clients enabled. Rocket Pool (and your consensus client) will use that while the main client is pruning.
Are you sure you want to prune your main execution client? [y/n]

承認すると、Smartnodeが準備を進める際にいくつかの詳細が表示され、最後に成功メッセージが表示されるはずです。

Are you sure you want to prune your main ETH1 client? [y/n]
y

Your disk has 303 GiB free, which is enough to prune.
Stopping rocketpool_eth1...
Provisioning pruning on volume rocketpool_eth1clientdata...
Restarting rocketpool_eth1...

Done! Your main ETH1 client is now pruning. You can follow its progress with `rocketpool service logs eth1`.
Once it's done, it will restart automatically and resume normal operation.
NOTE: While pruning, you **cannot** interrupt the client (e.g. by restarting) or you risk corrupting the database!
You must let it run to completion!

これでGethがプルーニングを開始し、設定完了です。 進捗状況は次のコマンドで確認できます。

rocketpool service logs eth1

プルーニングが完了すると自動的に再起動し、Smartnodeはfallbackの代わりに再びGethを使用するようになります。