IPFSConfig constructor
- bool offline = false,
- NetworkConfig? network,
- DHTConfig? dht,
- @Deprecated('StorageConfig is never read; use the top-level path fields.') StorageConfig? storage,
- SecurityConfig? security,
- GatewayConfig? gateway,
- BitswapConfig? bitswap,
- GraphsyncConfig? graphsync,
- bool debug = true,
- bool verboseLogging = true,
- bool enablePubSub = true,
- bool enableDHT = true,
- bool enableRPC = false,
- String? rpcApiKey,
- @Deprecated('Use NetworkConfig.circuitRelay.enabled; this option is ignored.') bool enableCircuitRelay = true,
- bool enableContentRouting = true,
- bool enableDNSLinkResolution = true,
- @Deprecated('IPLD is a core dependency and cannot be disabled; this flag is ignored.') bool enableIPLD = true,
- bool enableGraphsync = true,
- bool enableMetrics = true,
- bool enableIpnsPubSub = false,
- @Deprecated('Logging is always enabled; use logLevel to control verbosity.') bool enableLogging = true,
- @Deprecated('Structured logging is not wired into the node runtime; ' 'this option is ignored.') bool enableStructuredLogging = false,
- int ipnsCacheSize = 1000,
- String logLevel = 'info',
- @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.') bool enableQuotaManagement = true,
- @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.') int defaultBandwidthQuota = 1048576,
- int maxConcurrentBitswapRequests = 10,
- String datastorePath = './ipfs_data/datastore',
- String keystorePath = './ipfs_keystore',
- String blockStorePath = 'blocks',
- @Deprecated('No libp2p bridge transport exists; this flag is ignored.') bool enableLibp2pBridge = false,
- String libp2pListenAddress = '/ip4/0.0.0.0/tcp/4001',
- Uint8List? libp2pIdentitySeed,
- String? nodeId,
- @Deprecated('No repository garbage-collection loop exists; this flag is ignored.') Duration garbageCollectionInterval = const Duration(hours: 24),
- @Deprecated('No repository garbage-collection loop exists; this flag is ignored.') bool garbageCollectionEnabled = true,
- MetricsConfig metrics = const MetricsConfig(),
- String dataPath = './ipfs_data',
- Keystore? keystore,
- @Deprecated('Use GraphsyncConfig.defaultMaxDepth; this flag is ignored.') int maxSelectorDepth = 32,
- @Deprecated('Use GraphsyncConfig.defaultMaxBlocks; this flag is ignored.') int maxSelectorNodes = 10000,
- @Deprecated('Custom config entries are never read; this option is ignored.') Map<
String, dynamic> customConfig = const {}, - String? swarmKeyPath,
- Uint8List? privateNetworkPsk,
Creates a new IPFSConfig with the specified options.
Implementation
IPFSConfig({
this.offline = false,
NetworkConfig? network,
DHTConfig? dht,
@Deprecated('StorageConfig is never read; use the top-level path fields.')
// ignore: deprecated_member_use_from_same_package
StorageConfig? storage,
SecurityConfig? security,
GatewayConfig? gateway,
BitswapConfig? bitswap,
GraphsyncConfig? graphsync,
this.debug = true,
this.verboseLogging = true,
this.enablePubSub = true,
this.enableDHT = true,
this.enableRPC = false,
this.rpcApiKey,
@Deprecated(
'Use NetworkConfig.circuitRelay.enabled; this option is ignored.',
)
this.enableCircuitRelay = true,
this.enableContentRouting = true,
this.enableDNSLinkResolution = true,
@Deprecated(
'IPLD is a core dependency and cannot be disabled; this flag is ignored.',
)
this.enableIPLD = true,
this.enableGraphsync = true,
this.enableMetrics = true,
this.enableIpnsPubSub = false,
@Deprecated('Logging is always enabled; use logLevel to control verbosity.')
this.enableLogging = true,
@Deprecated(
'Structured logging is not wired into the node runtime; '
'this option is ignored.',
)
this.enableStructuredLogging = false,
this.ipnsCacheSize = 1000,
this.logLevel = 'info',
@Deprecated('No bandwidth quota subsystem exists; this flag is ignored.')
this.enableQuotaManagement = true,
@Deprecated('No bandwidth quota subsystem exists; this flag is ignored.')
this.defaultBandwidthQuota = 1048576,
this.maxConcurrentBitswapRequests = 10,
this.datastorePath = './ipfs_data/datastore',
this.keystorePath = './ipfs_keystore',
this.blockStorePath = 'blocks',
@Deprecated('No libp2p bridge transport exists; this flag is ignored.')
this.enableLibp2pBridge = false,
this.libp2pListenAddress = '/ip4/0.0.0.0/tcp/4001',
this.libp2pIdentitySeed,
String? nodeId,
@Deprecated(
'No repository garbage-collection loop exists; this flag is ignored.',
)
this.garbageCollectionInterval = const Duration(hours: 24),
@Deprecated(
'No repository garbage-collection loop exists; this flag is ignored.',
)
this.garbageCollectionEnabled = true,
this.metrics = const MetricsConfig(),
this.dataPath = './ipfs_data',
Keystore? keystore,
@Deprecated('Use GraphsyncConfig.defaultMaxDepth; this flag is ignored.')
this.maxSelectorDepth = 32,
@Deprecated('Use GraphsyncConfig.defaultMaxBlocks; this flag is ignored.')
this.maxSelectorNodes = 10000,
@Deprecated('Custom config entries are never read; this option is ignored.')
this.customConfig = const {},
this.swarmKeyPath,
this.privateNetworkPsk,
}) : network = network ?? NetworkConfig(),
dht = dht ?? const DHTConfig(),
// ignore: deprecated_member_use_from_same_package
storage = storage ?? const StorageConfig(),
security = security ?? const SecurityConfig(),
gateway = gateway ?? const GatewayConfig(),
bitswap = bitswap ?? const BitswapConfig(),
graphsync = graphsync ?? const GraphsyncConfig(),
nodeId = nodeId ?? _generateDefaultNodeId(),
keystore = keystore ?? Keystore() {
// Sync top-level PNET fields into the nested network config so the
// router only has to inspect [network].
this.network.swarmKeyPath ??= swarmKeyPath;
this.network.privateNetworkPsk ??= privateNetworkPsk;
}