ipfs: support pre-0.38 Provide config

This commit is contained in:
root 2025-10-09 16:05:35 +00:00
parent 870863790a
commit 46011690f3
1 changed files with 5 additions and 2 deletions

View File

@ -11,8 +11,11 @@ ipfs config --json Gateway.NoFetch true
# DHT client mode with accelerated providing # DHT client mode with accelerated providing
ipfs config --json Routing '{ "Type": "dhtclient", "AcceleratedDHTClient": true }' ipfs config --json Routing '{ "Type": "dhtclient", "AcceleratedDHTClient": true }'
# Reprovider config was renamed to Provide in go-ipfs 0.38+ # Reprovider config name changed in go-ipfs 0.38+. Try the new key first, then fall back.
ipfs config --json Provide '{ "Interval": "22h", "Strategy": "pinned+mfs", "Enabled": true }' PROVIDER_CFG='{ "Interval": "22h", "Strategy": "pinned+mfs", "Enabled": true }'
if ! ipfs config --json Provide "$PROVIDER_CFG" 2>/dev/null; then
ipfs config --json Reprovider "$PROVIDER_CFG"
fi
# Keep connection manager within reasonable bounds # Keep connection manager within reasonable bounds
ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }' ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }'