StorageConfig class

Configuration options for IPFS storage.

Controls storage paths, size limits, and garbage collection settings.

Example:

final config = StorageConfig(
  baseDir: '/var/ipfs',
  maxStorageSize: 50 * 1024 * 1024 * 1024, // 50GB
  enableGC: true,
);
Annotations
  • @Deprecated('StorageConfig is never read; use IPFSConfig.datastorePath, ' 'IPFSConfig.blockStorePath, and IPFSConfig.keystorePath instead.')

Constructors

StorageConfig({String baseDir = '.ipfs', int maxStorageSize = 10 * 1024 * 1024 * 1024, String blocksDir = 'blocks', String datastoreDir = 'datastore', String keysDir = 'keys', bool enableGC = true, Duration gcInterval = const Duration(hours: 1), int maxBlockSize = 1024 * 1024 * 2})
Creates a new StorageConfig with default paths and limits.
const
StorageConfig.fromJson(Map<String, dynamic> json)
Creates a StorageConfig from a JSON map.
factory

Properties

baseDir → String
Base directory for all IPFS data
final
blockPath → String
Computed path to the block storage directory.
no setter
blocksDir → String
Directory for block storage
final
datastoreDir → String
Directory for datastore
final
datastorePath → String
Computed path to the datastore directory.
no setter
enableGC → bool
Whether to enable garbage collection
final
gcInterval → Duration
Garbage collection interval
final
hashCode → int
The hash code for this object.
no setterinherited
keysDir → String
Directory for keys
final
keysPath → String
Computed path to the keys directory.
no setter
maxBlockSize → int
Maximum size for a single block
final
maxStorageSize → int
Maximum storage size in bytes
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this configuration to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited