125
- [`Pinning.RemoteServices: Policies.MFS.Enabled`](#pinningremoteservices-policiesmfsenabled)
126
- [`Pinning.RemoteServices: Policies.MFS.PinName`](#pinningremoteservices-policiesmfspinname)
127
- [`Pinning.RemoteServices: Policies.MFS.RepinInterval`](#pinningremoteservices-policiesmfsrepininterval)
128
+ - [`Provide`](#provide)
129
+ - [`Provide.Enabled`](#provideenabled)
130
+ - [`Provide.Strategy`](#providestrategy)
131
+ - [`Provide.DHT`](#providedht)
132
+ - [`Provide.DHT.MaxWorkers`](#providedhtmaxworkers)
133
+ - [`Provide.DHT.Interval`](#providedhtinterval)
134
+ - [`Provide.DHT.SweepEnabled`](#providedhtssweepenabled)
135
+ - [`Provide.DHT.DedicatedPeriodicWorkers`](#providedhtdedicatedperiodicworkers)
136
+ - [`Provide.DHT.DedicatedBurstWorkers`](#providedhtdedicatedburstworkers)
137
+ - [`Provide.DHT.MaxProvideConnsPerWorker`](#providedhtmaxprovideconnsperworker)
138
+ - [`Provide.DHT.KeyStoreBatchSize`](#providedhtkeystorebatchsize)
139
+ - [`Provide.DHT.OfflineDelay`](#providedhtofflinedelay)
140
- [`Provider`](#provider)
141
- [`Provider.Enabled`](#providerenabled)
142
- [`Provider.Strategy`](#providerstrategy)
151
- [`Peering.Peers`](#peeringpeers)
152
- [`Reprovider`](#reprovider)
153
- [`Reprovider.Interval`](#reproviderinterval)
142
- - [`Reprovider.Strategy`](#reproviderstrategy)
143
- - [`Reprovider.Sweep`](#reprovidersweep)
154
+ - [`Reprovider.Strategy`](#providestrategy)
155
- [`Routing`](#routing)
156
- [`Routing.Type`](#routingtype)
157
- [`Routing.AcceleratedDHTClient`](#routingaccelerateddhtclient)
1379
}
1380
}'
1381
```
1371
- - **Performance:** consider running with `Routing.AcceleratedDHTClient=true` and either `Provider.Enabled=false` (avoid providing newly retrieved blocks) or `Provider.WorkerCount=0` (provide as fast as possible, at the cost of increased load)
1382
+ - **Performance:** Consider enabling `Routing.AcceleratedDHTClient=true` to improve content routing lookups. Separately, gateway operators should decide if the gateway node should also co-host and provide (announce) fetched content to the DHT. If providing content, enable `Provide.DHT.SweepEnabled=true` for efficient announcements. If announcements are still not fast enough, adjust `Provide.DHT.MaxWorkers`. For a read-only gateway that doesn't announce content, use `Provide.Enabled=false`.
1383
- **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains:
1384
1385
`http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link`
1404
}
1405
}'
1406
```
1396
- - **Performance:** when running an open, recursive gateway consider running with `Routing.AcceleratedDHTClient=true` and either `Provider.Enabled=false` (avoid providing newly retrieved blocks) or `Provider.WorkerCount=0` (provide as fast as possible, at the cost of increased load)
1407
+ - **Performance:** Consider enabling `Routing.AcceleratedDHTClient=true` to improve content routing lookups. When running an open, recursive gateway, decide if the gateway should also co-host and provide (announce) fetched content to the DHT. If providing content, enable `Provide.DHT.SweepEnabled=true` for efficient announcements. If announcements are still not fast enough, adjust `Provide.DHT.MaxWorkers`. For a read-only gateway that doesn't announce content, use `Provide.Enabled=false`.
1408
1409
* Public [DNSLink](https://dnslink.io/) gateway resolving every hostname passed in `Host` header.
1410
```console
1844
1845
Type: `duration`
1846
1836
-## `Provider`
1837
-
1838
-Configuration applied to the initial one-time announcement of fresh CIDs
1839
-created with `ipfs add`, `ipfs files`, `ipfs dag import`, `ipfs block|dag put`
1840
-commands.
1847
+## `Provide`
1848
1842
-For periodical DHT reprovide settings, see [`Reprovide.*`](#reprovider).
1849
+Configures CID announcements to the routing system, including both immediate
1850
+announcements for new content (provide) and periodic re-announcements
1851
+(reprovide) on systems that require it, like Amino DHT. While designed to support
1852
+multiple routing systems in the future, the current default configuration only supports providing to the Amino DHT.
1853
1844
-### `Provider.Enabled`
1854
+### `Provide.Enabled`
1855
1846
-Controls whether Kubo provider and reprovide systems are enabled.
1856
+Controls whether Kubo provide and reprovide systems are enabled.
1857
1858
> [!CAUTION]
1849
-> Disabling this, will disable BOTH `Provider` system for new CIDs
1850
-> and the periodical reprovide ([`Reprovider.Interval`](#reprovider)) of old CIDs.
1859
+> Disabling this will prevent other nodes from discovering your content.
1860
+> Your node will stop announcing data to the routing system, making it
1861
+> inaccessible unless peers connect to you directly.
1862
1863
Default: `true`
1864
1865
Type: `flag`
1866
1856
-### `Provider.Strategy`
1867
+### `Provide.Strategy`
1868
1858
-Legacy, not used at the moment, see [`Reprovider.Strategy`](#reproviderstrategy) instead.
1869
+Tells the provide system what should be announced. Valid strategies are:
1870
1860
-### `Provider.WorkerCount`
1871
+- `"all"` - announce all CIDs of stored blocks
1872
+- `"pinned"` - only announce recursively pinned CIDs (`ipfs pin add -r`, both roots and child blocks)
1873
+ - Order: root blocks of direct and recursive pins are announced first, then the child blocks of recursive pins
1874
+- `"roots"` - only announce the root block of explicitly pinned CIDs (`ipfs pin add`)
1875
+ - **⚠️ BE CAREFUL:** node with `roots` strategy will not announce child blocks.
1876
+ It makes sense only for use cases where the entire DAG is fetched in full,
1877
+ and a graceful resume does not have to be guaranteed: the lack of child
1878
+ announcements means an interrupted retrieval won't be able to find
1879
+ providers for the missing block in the middle of a file, unless the peer
1880
+ happens to already be connected to a provider and asks for child CID over
1881
+ bitswap.
1882
+- `"mfs"` - announce only the local CIDs that are part of the MFS (`ipfs files`)
1883
+ - Note: MFS is lazy-loaded. Only the MFS blocks present in local datastore are announced.
1884
+- `"pinned+mfs"` - a combination of the `pinned` and `mfs` strategies.
1885
+ - **ℹ️ NOTE:** This is the suggested strategy for users who run without GC and don't want to provide everything in cache.
1886
+ - Order: first `pinned` and then the locally available part of `mfs`.
1887
+
1888
+**Strategy changes automatically clear the provide queue.** When you change `Provide.Strategy` and restart Kubo, the provide queue is automatically cleared to ensure only content matching your new strategy is announced. You can also manually clear the queue using `ipfs provide clear`.
1889
+
1890
+**Memory requirements:**
1891
+
1892
+- Reproviding larger pinsets using the `mfs`, `pinned`, `pinned+mfs` or `roots` strategies requires additional memory, with an estimated ~1 GiB of RAM per 20 million CIDs for reproviding to the Amino DHT.
1893
+- This is due to the use of a buffered provider, which loads all CIDs into memory to avoid holding a lock on the entire pinset during the reprovide cycle.
1894
+
1895
+Default: `"all"`
1896
+
1897
+Type: `optionalString` (unset for the default)
1898
+
1899
+### `Provide.DHT`
1900
+
1901
+Configuration for providing data to Amino DHT peers.
1902
+
1903
+#### Monitoring Provide Operations
1904
+
1905
+You can monitor the effectiveness of your provide configuration through metrics exposed at the Prometheus endpoint: `{Addresses.API}/debug/metrics/prometheus` (default: `http://127.0.0.1:5001/debug/metrics/prometheus`).
1906
+
1907
+Different metrics are available depending on whether you use legacy mode (`SweepEnabled=false`) or sweep mode (`SweepEnabled=true`). See [Provide metrics documentation](https://github.com/ipfs/kubo/blob/master/docs/metrics.md#provide) for details.
1908
+
1909
+To enable detailed debug logging for both providers, set:
1910
+```sh
1911
+GOLOG_LOG_LEVEL=error,provider=debug,dht/provider=debug
1912
+```
1913
+- `provider=debug` enables generic logging (legacy provider and any non-dht operations)
1914
+- `dht/provider=debug` enables logging for the sweep provider
1915
+
1916
+#### `Provide.DHT.Interval`
1917
+
1918
+Sets how often to re-announce content to the DHT. Provider records on Amino DHT
1919
+expire after [`amino.DefaultProvideValidity`](https://github.com/libp2p/go-libp2p-kad-dht/blob/v0.34.0/amino/defaults.go#L40-L43),
1920
+also known as Provider Record Expiration Interval.
1921
1862
-Sets the maximum number of _concurrent_ DHT provide operations (announcement of new CIDs).
1922
+An interval of about half the expiration window ensures provider records
1923
+are refreshed well before they expire. This keeps your content continuously
1924
+discoverable accounting for network churn without overwhelming the network with too frequent announcements.
1925
1864
-[`Reprovider`](#reprovider) operations do **not** count against this limit.
1865
-A value of `0` allows an unlimited number of provide workers.
1926
+- If unset, it uses the implicit safe default.
1927
+- If set to the value `"0"` it will disable content reproviding to DHT.
1928
+
1929
+> [!CAUTION]
1930
+> Disabling this will prevent other nodes from discovering your content via the DHT.
1931
+> Your node will stop announcing data to the DHT, making it
1932
+> inaccessible unless peers connect to you directly. Since provider
1933
+> records expire after `amino.DefaultProvideValidity`, your content will become undiscoverable
1934
+> after this period.
1935
+
1936
+Default: `22h`
1937
+
1938
+Type: `optionalDuration` (unset for the default)
1939
+
1940
+#### `Provide.DHT.MaxWorkers`
1941
+
1942
+Sets the maximum number of _concurrent_ DHT provide operations.
1943
+
1944
+**When `Provide.DHT.SweepEnabled` is false (legacy mode):**
1945
+- Controls NEW CID announcements only
1946
+- Reprovide operations do **not** count against this limit
1947
+- A value of `0` allows unlimited provide workers
1948
+
1949
+**When `Provide.DHT.SweepEnabled` is true:**
1950
+- Controls the total worker pool for both provide and reprovide operations
1951
+- Workers are split between periodic reprovides and burst provides
1952
+- Use a positive value to control resource usage
1953
+- See [`DedicatedPeriodicWorkers`](#providedhtdedicatedperiodicworkers) and [`DedicatedBurstWorkers`](#providedhtdedicatedburstworkers) for task allocation
1954
1955
If the [accelerated DHT client](#routingaccelerateddhtclient) is enabled, each
1956
provide operation opens ~20 connections in parallel. With the standard DHT
1961
1962
> [!CAUTION]
1963
> For nodes without strict connection limits that need to provide large volumes
1876
-> of content immediately, we recommend enabling the `Routing.AcceleratedDHTClient` and
1877
-> setting `Provider.WorkerCount` to `0` (unlimited).
1964
+> of content, we recommend first trying `Provide.DHT.SweepEnabled=true` for efficient
1965
+> announcements. If announcements are still not fast enough, adjust `Provide.DHT.MaxWorkers`.
1966
+> As a last resort, consider enabling `Routing.AcceleratedDHTClient=true` but be aware that it is very resource hungry.
1967
>
1968
> At the same time, mind that raising this value too high may lead to increased load.
1969
> Proceed with caution, ensure proper hardware and networking are in place.
1972
1973
Type: `optionalInteger` (non-negative; `0` means unlimited number of workers)
1974
1975
+#### `Provide.DHT.SweepEnabled`
1976
+
1977
+Whether Provide Sweep is enabled. If not enabled, the legacy
1978
+[`boxo/provider`](https://github.com/ipfs/boxo/tree/main/provider) is used for
1979
+both provides and reprovides.
1980
+
1981
+Provide Sweep is a resource efficient technique for advertising content to
1982
+the Amino DHT swarm. The Provide Sweep module tracks the keys that should be periodically reprovided in
1983
+the `KeyStore`. It splits the keys into DHT keyspace regions by proximity (XOR
1984
+distance), and schedules when reprovides should happen in order to spread the
1985
+reprovide operation over time to avoid a spike in resource utilization. It
1986
+basically sweeps the keyspace _from left to right_ over the
1987
+[`Provide.DHT.Interval`](#providedhtinterval) time period, and reprovides keys
1988
+matching to the visited keyspace region.
1989
+
1990
+Provide Sweep aims at replacing the inefficient legacy `boxo/provider`
1991
+module, and is currently opt-in. You can compare the effectiveness of sweep mode vs legacy mode by monitoring the appropriate metrics (see [Monitoring Provide Operations](#monitoring-provide-operations) above).
1992
+
1993
+Whenever new keys should be advertised to the Amino DHT, `kubo` calls
1994
+`StartProviding()`, triggering an initial `provide` operation for the given
1995
+keys. The keys will be added to the `KeyStore` tracking which keys should be
1996
+reprovided and when they should be reprovided. Calling `StopProviding()`
1997
+removes the keys from the `KeyStore`. However, it is currently tricky for
1998
+`kubo` to detect when a key should stop being advertised. Hence, `kubo` will
1999
+periodically refresh the `KeyStore` at each [`Provide.DHT.Interval`](#providedhtinterval)
2000
+by providing it a channel of all the keys it is expected to contain according
2001
+to the [`Provide.Strategy`](#providestrategy). During this operation,
2002
+all keys in the `Keystore` are purged, and only the given ones remain scheduled.
2003
+
2004
+> [!NOTE]
2005
+> This feature is opt-in for now, but will become the default in a future release.
2006
+> Eventually, this configuration flag will be removed once the feature is stable.
2007
+
2008
+Default: `false`
2009
+
2010
+Type: `flag`
2011
+
2012
+
2013
+#### `Provide.DHT.DedicatedPeriodicWorkers`
2014
+
2015
+Number of workers dedicated to periodic keyspace region reprovides. Only applies when `Provide.DHT.SweepEnabled` is true.
2016
+
2017
+Among the [`Provide.DHT.MaxWorkers`](#providedhtmaxworkers), this
2018
+number of workers will be dedicated to the periodic region reprovide only. The sum of
2019
+`DedicatedPeriodicWorkers` and `DedicatedBurstWorkers` should not exceed `MaxWorkers`.
2020
+Any remaining workers (MaxWorkers - DedicatedPeriodicWorkers - DedicatedBurstWorkers)
2021
+form a shared pool that can be used for either type of work as needed.
2022
+
2023
+Default: `2`
2024
+
2025
+Type: `optionalInteger` (`0` means there are no dedicated workers, but the
2026
+operation can be performed by free non-dedicated workers)
2027
+
2028
+#### `Provide.DHT.DedicatedBurstWorkers`
2029
+
2030
+Number of workers dedicated to burst provides. Only applies when `Provide.DHT.SweepEnabled` is true.
2031
+
2032
+Burst provides are triggered by:
2033
+- Manual provide commands (`ipfs routing provide`)
2034
+- New content matching your `Provide.Strategy` (blocks from `ipfs add`, bitswap, or trustless gateway requests)
2035
+- Catch-up reprovides after being disconnected/offline for a while
2036
+
2037
+Having dedicated burst workers ensures that bulk operations (like adding many CIDs
2038
+or reconnecting to the network) don't delay regular periodic reprovides, and vice versa.
2039
+
2040
+Among the [`Provide.DHT.MaxWorkers`](#providedhtmaxworkers), this
2041
+number of workers will be dedicated to burst provides only. In addition to
2042
+these, if there are available workers in the pool, they can also be used for
2043
+burst provides.
2044
+
2045
+Default: `1`
2046
+
2047
+Type: `optionalInteger` (`0` means there are no dedicated workers, but the
2048
+operation can be performed by free non-dedicated workers)
2049
+
2050
+#### `Provide.DHT.MaxProvideConnsPerWorker`
2051
+
2052
+Maximum number of connections that a single worker can use to send provider
2053
+records over the network.
2054
+
2055
+When reproviding CIDs corresponding to a keyspace region, the reprovider must
2056
+send a provider record to the 20 closest peers to the CID (in XOR distance) for
2057
+each CID belonging to this keyspace region.
2058
+
2059
+The reprovider opens a connection to a peer from that region, sends it all its
2060
+allocated provider records. Once done, it opens a connection to the next peer
2061
+from that keyspace region until all provider records are assigned.
2062
+
2063
+This option defines how many such connections can be open concurrently by a
2064
+single worker.
2065
+
2066
+Default: `16`
2067
+
2068
+Type: `optionalInteger` (non-negative)
2069
+
2070
+#### `Provide.DHT.KeyStoreBatchSize`
2071
+
2072
+During the garbage collection, all keys stored in the KeyStore are removed, and
2073
+the keys are streamed from a channel to fill the KeyStore again with up-to-date
2074
+keys. Since a high number of CIDs to reprovide can easily fill up the memory,
2075
+keys are read and written in batches to optimize for memory usage.
2076
+
2077
+This option defines how many multihashes should be contained within a batch. A
2078
+multihash is usually represented by 34 bytes.
2079
+
2080
+Default: `16384` (~544 KiB per batch)
2081
+
2082
+Type: `optionalInteger` (non-negative)
2083
+
2084
+#### `Provide.DHT.OfflineDelay`
2085
+
2086
+The `SweepingProvider` has 3 states: `ONLINE`, `DISCONNECTED` and `OFFLINE`. It
2087
+starts `OFFLINE`, and as the node bootstraps, it changes its state to `ONLINE`.
2088
+
2089
+When the provider loses connection to all DHT peers, it switches to the
2090
+`DISCONNECTED` state. In this state, new provides will be added to the provide
2091
+queue, and provided as soon as the node comes back online.
2092
+
2093
+After a node has been `DISCONNECTED` for `OfflineDelay`, it goes to `OFFLINE`
2094
+state. When `OFFLINE`, the provider drops the provide queue, and returns errors
2095
+to new provide requests. However, when `OFFLINE` the provider still adds the
2096
+keys to its state, so keys will eventually be provided in the
2097
+[`Provide.DHT.Interval`](#providedhtinterval) after the provider comes back
2098
+`ONLINE`.
2099
+
2100
+Default: `2h`
2101
+
2102
+Type: `optionalDuration`
2103
+
2104
+## `Provider`
2105
+
2106
+### `Provider.Enabled`
2107
+
2108
+**REMOVED**
2109
+
2110
+Replaced with [`Provide.Enabled`](#provideenabled).
2111
+
2112
+### `Provider.Strategy`
2113
+
2114
+**REMOVED**
2115
+
2116
+This field was unused. Use [`Provide.Strategy`](#providestrategy) instead.
2117
+
2118
+### `Provider.WorkerCount`
2119
+
2120
+**REMOVED**
2121
+
2122
+Replaced with [`Provide.DHT.MaxWorkers`](#providedhtmaxworkers).
2123
## `Pubsub`
2124
2125
**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
2287
2288
### `Reprovider.Interval`
2289
2053
-Sets the time between rounds of reproviding local content to the routing
2054
-system.
2055
-
2056
-- If unset, it uses the implicit safe default.
2057
-- If set to the value `"0"` it will disable content reproviding.
2058
-
2059
-Note: disabling content reproviding will result in other nodes on the network
2060
-not being able to discover that you have the objects that you have. If you want
2061
-to have this disabled and keep the network aware of what you have, you must
2062
-manually announce your content periodically or run your own routing system
2063
-and convince users to add it to [`Routing.DelegatedRouters`](https://github.com/ipfs/kubo/blob/master/docs/config.md#routingdelegatedrouters).
2064
-
2065
-> [!CAUTION]
2066
-> To maintain backward-compatibility, setting `Reprovider.Interval=0` will also disable Provider system (equivalent of `Provider.Enabled=false`)
2067
-
2068
-Default: `22h` (`DefaultReproviderInterval`)
2290
+**REMOVED**
2291
2070
-Type: `optionalDuration` (unset for the default)
2292
+Replaced with [`Provide.DHT.Interval`](#providedhtinterval).
2293
2294
### `Reprovider.Strategy`
2295
2074
-Tells reprovider what should be announced. Valid strategies are:
2075
-
2076
-- `"all"` - announce all CIDs of stored blocks
2077
-- `"pinned"` - only announce recursively pinned CIDs (`ipfs pin add -r`, both roots and child blocks)
2078
- - Order: root blocks of direct and recursive pins are announced first, then the child blocks of recursive pins
2079
-- `"roots"` - only announce the root block of explicitly pinned CIDs (`ipfs pin add`)
2080
- - **⚠️ BE CAREFUL:** node with `roots` strategy will not announce child blocks.
2081
- It makes sense only for use cases where the entire DAG is fetched in full,
2082
- and a graceful resume does not have to be guaranteed: the lack of child
2083
- announcements means an interrupted retrieval won't be able to find
2084
- providers for the missing block in the middle of a file, unless the peer
2085
- happens to already be connected to a provider and ask for child CID over
2086
- bitswap.
2087
-- `"mfs"` - announce only the local CIDs that are part of the MFS (`ipfs files`)
2088
- - Note: MFS is lazy-loaded. Only the MFS blocks present in local datastore are announced.
2089
-- `"pinned+mfs"` - a combination of the `pinned` and `mfs` strategies.
2090
- - **ℹ️ NOTE:** This is the suggested strategy for users who run without GC and don't want to provide everything in cache.
2091
- - Order: first `pinned` and then the locally available part of `mfs`.
2092
-
2093
-**Strategy changes automatically clear the provide queue.** When you change `Reprovider.Strategy` and restart Kubo, the provide queue is automatically cleared to ensure only content matching your new strategy is announced. You can also manually clear the queue using `ipfs provide clear`.
2094
-
2095
-**Memory requirements:**
2096
-
2097
-- Reproviding larger pinsets using the `mfs`, `pinned`, `pinned+mfs` or `roots` strategies requires additional memory, with an estimated ~1 GiB of RAM per 20 million items for reproviding to the Amino DHT.
2098
-- This is due to the use of a buffered provider, which avoids holding a lock on the entire pinset during the reprovide cycle.
2099
-
2100
-Default: `"all"`
2101
-
2102
-Type: `optionalString` (unset for the default)
2103
-
2104
-### Reprovider.Sweep
2105
-
2106
-Reprovider Sweep is a resource efficient technique for advertising content to
2107
-the Amino DHT swarm.
2108
-
2109
-The Reprovider module tracks the keys that should be periodically reprovided in
2110
-the `KeyStore`. It splits the keys into DHT keyspace regions by proximity (XOR
2111
-distance), and schedules when reprovides should happen in order to spread the
2112
-reprovide operation over time to avoid a spike in resource utilization. It
2113
-basically sweeps the keyspace _from left to right_ over the
2114
-[`Reprovider.Interval`](#reproviderinterval) time period, and reprovides keys
2115
-matching to the visited keyspace region.
2116
-
2117
-Reprovider Sweep aims at replacing the inefficient legacy `boxo/provider`
2118
-module, and is currently opt-in.
2119
-
2120
-Whenever new keys should be advertised to the Amino DHT, `kubo` calls
2121
-`StartProviding()`, triggering an initial `provide` operation for the given
2122
-keys. The keys will be added to the `KeyStore` tracking which keys should be
2123
-reprovided and when they should be reprovided. Calling `StopProviding()`
2124
-removes the keys from the `KeyStore`. However, it is currently tricky for
2125
-`kubo` to detect when a key should stop being advertised. Hence, `kubo` will
2126
-periodically refresh the `KeyStore` at each [`Reprovider.Interval`](#reproviderinterval)
2127
-by providing it a channel of all the keys it is expected to contain according
2128
-to the [`Reprovider.Strategy`](#reproviderstrategy). During this operation,
2129
-all keys in the `Keystore` are purged, and only the given ones remain scheduled.
2130
-
2131
-#### Reprovider.Sweep.Enabled
2132
-
2133
-Whether Reprovider Sweep is enabled. If not enabled, the
2134
-[`boxo/provider`](https://github.com/ipfs/boxo/tree/main/provider) is used for
2135
-both provides and reprovides.
2136
-
2137
-Default: `false`
2138
-
2139
-Type: `flag`
2140
-
2141
-#### Reprovider.Sweep.MaxWorkers
2142
-
2143
-The maximum number of workers used by the `SweepingReprovider` to provide and
2144
-reprovide CIDs to the DHT swarm.
2145
-
2146
-A worker performs Kademlia `GetClosestPeers` operations (max 1 at a time) to
2147
-explore a region of the DHT keyspace, and then sends provider records to the
2148
-nodes from that keyspace region. `GetClosestPeers` is capped to `10` concurrent
2149
-connections [`amino` DHT
2150
-defaults](https://github.com/libp2p/go-libp2p-kad-dht/blob/master/amino/defaults.go).
2151
-The number of simultaneous connections used to send provider records is defined
2152
-by
2153
-[`Reprovider.Sweep.MaxProvideConnsPerWorker`](#reprovidersweepmaxprovideconnsperworker).
2154
-
2155
-The workers are split between two tasks categories:
2156
-
2157
-1. Periodic reprovides (see
2158
- [`Reprovider.Sweep.DedicatedPeriodicWorkers`](#reprovidersweepdedicatedperiodicworkers))
2159
-2. Burst provides (see
2160
- [`Reprovider.Sweep.DedicatedBurstWorkers`](#reprovidersweepdedicatedburstworkers))
2161
-
2162
-[`Reprovider.Sweep.DedicatedPeriodicWorkers`](#reprovidersweepdedicatedperiodicworkers)
2163
-workers are allocated to the periodic reprovides only,
2164
-[`Reprovider.Sweep.DedicatedBurstWorkers`](#reprovidersweepdedicatedburstworkers)
2165
-workers are allocated to burst provides only, and the rest of
2166
-[`Reprovider.Sweep.MaxWorkers`](#reprovidersweepmaxworkers) can be used for
2167
-either task (first come, first served).
2168
-
2169
-Default: `4`
2170
-
2171
-Type: `optionalInteger` (non-negative)
2172
-
2173
-#### Reprovider.Sweep.DedicatedPeriodicWorkers
2174
-
2175
-Number of workers dedicated to periodic keyspace region reprovides.
2176
-
2177
-Among the [`Reprovider.Sweep.MaxWorkers`](#reprovidersweepmaxworkers), this
2178
-number of workers will be dedicated to the periodic region reprovide only. In
2179
-addition to these, if there are available workers in the pool, they can also be
2180
-used for periodic reprovides.
2181
-
2182
-Default: `2`
2183
-
2184
-Type: `optionalInteger` (`0` means there are no dedicated workers, but the
2185
-operation can be performed by free non-dedicated workers)
2186
-
2187
-#### Reprovider.Sweep.DedicatedBurstWorkers
2188
-
2189
-Number of workers dedicated to burst provides.
2190
-
2191
-Burst provides are triggered when a new keys must be advertised to the DHT
2192
-immediately, or when a node comes back online and must catch up the reprovides
2193
-that should have happened while it was offline.
2194
-
2195
-Among the [`Reprovider.Sweep.MaxWorkers`](#reprovidersweepmaxworkers), this
2196
-number of workers will be dedicated to burst provides only. In addition to
2197
-these, if there are available workers in the pool, they can also be used for
2198
-burst provides.
2199
-
2200
-Default: `1`
2201
-
2202
-Type: `optionalInteger` (`0` means there are no dedicated workers, but the
2203
-operation can be performed by free non-dedicated workers)
2204
-
2205
-#### Reprovider.Sweep.MaxProvideConnsPerWorker
2206
-
2207
-Maximum number of connections that a single worker can use to send provider
2208
-records over the network.
2209
-
2210
-When reproviding CIDs corresponding to a keyspace region, the reprovider must
2211
-send a provider record to the 20 closest peers to the CID (in XOR distance) for
2212
-each CID belonging to this keyspace region.
2213
-
2214
-The reprovider opens a connection to a peer from that region, send it all its
2215
-allocated provider records. Once done, it opens a connection to the next peer
2216
-from that keyspace region until all provider records are assigned.
2217
-
2218
-This option defines how many such connections can be open concurrently by a
2219
-single worker.
2220
-
2221
-Default: `16`
2222
-
2223
-Type: `optionalInteger` (non-negative)
2224
-
2225
-#### Reprovider.Sweep.KeyStoreBatchSize
2226
-
2227
-During the garbage collection, all keys stored in the KeyStore are removed, and
2228
-the keys are streamed from a channel to fill the KeyStore again with up-to-date
2229
-keys. Since a high number of CIDs to reprovide can easily fill up the memory,
2230
-keys are read and written in batches to optimize for memory usage.
2231
-
2232
-This option defines how many multihashes should be contained within a batch. A
2233
-multihash is usually represented by 34 bytes.
2234
-
2235
-Default: `16384` (~544 KiB per batch)
2236
-
2237
-Type: `optionalInteger` (non-negative)
2238
-
2239
-#### Reprovider.Sweep.OfflineDelay
2240
-
2241
-The `SweepingProvider` has 3 states: `ONLINE`, `DISCONNECTED` and `OFFLINE`. It
2242
-starts `OFFLINE`, and as the node bootstraps, it changes its state to `ONLINE`.
2243
-
2244
-When the provider loses connection to all DHT peers, it switches to the
2245
-`DISCONNECTED` state. In this state, new provides will be added to the provide
2246
-queue, and provided as soon as the node comes back online.
2247
-
2248
-After a node has been `DISCONNECTED` for `OfflineDelay`, it goes to `OFFLINE`
2249
-state. When `OFFLINE`, the provider drops the provide queue, and returns errors
2250
-to new provide requests. However, when `OFFLINE` the provide still adds the
2251
-keys to its state, so keys will eventually be provided in the
2252
-[`Reprovider.Interval`](#reproviderinterval) after the provider comes back
2253
-`ONLINE`.
2254
-
2255
-Default: `2h`
2256
-
2257
-Type: `optionalDuration`
2296
+**REMOVED**
2297
2298
+Replaced with [`Provide.Strategy`](#providestrategy).
2299
## `Routing`
2300
2301
Contains options for content, peer, and IPNS routing mechanisms.
2374
- Client DHT operations (reads and writes) should complete much faster
2375
- The provider will now use a keyspace sweeping mode allowing to keep alive
2376
CID sets that are multiple orders of magnitude larger.
2377
+ - **Note:** For improved provide/reprovide operations specifically, consider using
2378
+ [`Provide.DHT.SweepEnabled`](#providedhtssweepenabled) instead, which offers similar
2379
+ benefits with lower resource consumption.
2380
- The standard Bucket-Routing-Table DHT will still run for the DHT server (if
2381
the DHT server is enabled). This means the classical routing table will
2382
still be used to answer other nodes.
2389
- The resource usage is not smooth as the client crawls the network in rounds and reproviding is similarly done in rounds
2390
- Users who previously had a lot of content but were unable to advertise it on the network will see an increase in
2391
egress bandwidth as their nodes start to advertise all of their CIDs into the network. If you have lots of data
2349
- entering your node that you don't want to advertise, then consider using [Reprovider Strategies](#reproviderstrategy)
2392
+ entering your node that you don't want to advertise, then consider using [Provide Strategies](#providestrategy)
2393
to reduce the number of CIDs that you are reproviding. Similarly, if you are running a node that deals mostly with
2394
short-lived temporary data (e.g. you use a separate node for ingesting data then for storing and serving it) then
2395
you may benefit from using [Strategic Providing](experimental-features.md#strategic-providing) to prevent advertising
3661
3662
### `announce-off` profile
3663
3621
-Disables [Reprovider](#reprovider) system (and announcing to Amino DHT).
3664
+Disables [Provide](#provide) system (and announcing to Amino DHT).
3665
3666
> [!CAUTION]
3667
> The main use case for this is setups with manual Peering.Peers config.
3671
3672
### `announce-on` profile
3673
3631
-(Re-)enables [Reprovider](#reprovider) system (reverts [`announce-off` profile](#announce-off-profile)).
3674
+(Re-)enables [Provide](#provide) system (reverts [`announce-off` profile](#announce-off-profile)).
3675
3676
### `legacy-cid-v0` profile
3677