[Enhancement] Support an absolute persistent data directory

オープン
#30 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

まず src/store.ts の現在のパス解決から始め、次に #22 に記載されたストレージパスの統合と、#23 のチェックポイント状態を追跡します。起動時の検証、永続化、マイグレーション、ロールバックが現在どのように機能しているかを確認します。完了とは、実効ディレクトリが一貫して使用され、レガシー動作が維持され、安全でないパスが安全に失敗し、一覧にある再起動およびマイグレーションのチェックに合格することです。

索引モデルが issue の本文から書いたものです。

説明

enhancement Infrastructure IPFS

Summary

Allow operators to configure an explicit absolute directory for all persistent IPFS node data.

Details

The current storeFolder setting is always joined to the operating-system home directory in src/store.ts. It selects a folder below the user's home but does not provide a clear, validated way to use a dedicated path such as /srv/adamant-ipfs or /mnt/ipfs-data.

Add an optional absolute dataDir setting. When it is absent, preserve the existing ~/<storeFolder> behavior exactly so current installations continue to use the same blockstore, datastore, peer identity, pins, and lifecycle registry.

Changing the resolved data directory to an empty location creates a new peer identity and makes existing content appear missing. The implementation and migration documentation must therefore fail safely and make the selected path explicit.

Checklist

  • Add an optional absolute dataDir configuration value
  • Preserve storeFolder as the backward-compatible fallback when dataDir is absent
  • Reject empty, relative, root, malformed, or non-directory values during startup validation
  • Resolve the effective data directory in one reusable helper
  • Place blockstore and datastore below the resolved directory
  • Log the resolved data directory at startup without exposing sensitive data
  • Verify that the directory can be created, opened, and written before starting Helia
  • Detect and clearly report a likely accidental switch from a populated legacy directory to an empty data directory
  • Document a stop, copy, permissions, verification, and rollback procedure for moving an existing node
  • Add tests for the legacy default, an explicit absolute path, invalid paths, and restart persistence

Notes

The broad checklist in #16 marked data-directory configuration as complete, but the current implementation still resolves storeFolder from the user's home directory. This focused issue defines the remaining operational requirement.

The datastore contains the libp2p private key under /pkcs8/self. A correct migration must preserve it together with the blockstore and lifecycle registry, or the process starts as a different peer.

Coordinate the change with the storage paths used by disk-reserve checks, storage metrics, upload admission, replication intake, and garbage collection from #22.

Verification

  • Start with no dataDir and confirm that an existing ~/<storeFolder> retains the same Peer ID, pins, registry records, and readable CIDs
  • Start with an explicit temporary absolute directory and confirm that blockstore and datastore data survive a restart
  • Move a populated test store with the documented procedure and confirm byte-identical retrieval of legacy CIDs
  • Confirm disk usage, free-space reserve, upload admission, replication, and garbage collection all inspect the configured filesystem
  • Confirm invalid or unsafe paths abort startup with a controlled configuration error
  • Exercise the rollback procedure and confirm that the original store remains usable

Coordination with persistent health state

The persistent data directory must also contain the checkpoint and repair-cycle state introduced by #23. Moving only the blockstore and datastore while leaving that operational state behind could reset the freshness watermark, lose the recorded membership or placement version, or make height move backwards after restart.

When dataDir is absent, preserve the existing location of all legacy data and introduce any new checkpoint state without moving current stores. The migration and rollback procedure must treat peer identity, pins, lifecycle registry, repair cursor/cycle evidence, and checkpoint state as one consistency unit.

Additional checklist
  • Store checkpoint, repair-cycle, and related operational state below the effective persistent data directory
  • Preserve or safely invalidate that state during data-directory migration without allowing a false ready checkpoint
Additional verification
  • Move a populated test data directory and confirm peer identity, content, lifecycle records, repair-cycle evidence, and checkpoint monotonicity survive together
  • Start with missing or mismatched checkpoint state and confirm the node falls back to starting or stale rather than reporting ready
主要言語
TypeScript
スター
309
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Adamant-im/ipfs-node のほかの issue

Adamant-im/ipfs-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。