BitswapConfig class
Configuration for the Bitswap protocol, including the optional HTTP gateway fallback used when P2P block exchange fails.
Constructors
-
BitswapConfig({int maxConcurrentRequests = 10, List<
String> httpFallbackGateways = const <String>[], Duration p2pTimeout = const Duration(seconds: 30), Duration httpTimeout = const Duration(seconds: 10), bool enableHttpFallback = false, int maxHttpBlockSize = 2 * 1024 * 1024, bool allowPrivateGateways = false, @visibleForTesting bool verifyHttpBlocks = true}) -
Creates a new BitswapConfig.
const
-
BitswapConfig.fromJson(Map<
String, dynamic> json) -
Creates a BitswapConfig from a JSON map.
factory
Properties
- allowPrivateGateways → bool
-
Whether private/loopback gateway URLs (e.g.
127.0.0.1) are allowed.final - enableHttpFallback → bool
-
Whether the HTTP gateway fallback is enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
httpFallbackGateways
→ List<
String> -
Ordered list of HTTP gateway base URLs to use as a fallback.
final
- httpTimeout → Duration
-
Timeout applied to each HTTP fallback request.
final
- maxConcurrentRequests → int
-
Maximum number of concurrent P2P Bitswap requests.
final
- maxHttpBlockSize → int
-
Maximum allowed HTTP block response size in bytes.
final
- p2pTimeout → Duration
-
Timeout applied to each P2P Bitswap request attempt.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verifyHttpBlocks → bool
-
Whether to verify HTTP-fetched blocks against their CID.
final
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