Skip to content

Commit 2e06774

Browse files
authored
Merge pull request #1985 from ipfs/ipns-corrections
correct dht expiration time and improve ipns docs
2 parents 84a4445 + 6207f4a commit 2e06774

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/styles/Vocab/ipfs-docs-vocab/accept.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Arbol('s)?
6464
auditable
6565
Audius
6666
auspinner
67+
blockchain
6768
blockstore
6869
Browserify
6970
callouts?
@@ -169,7 +170,8 @@ Qm
169170
rasterio
170171
READMEs?
171172
referenceable
172-
reprovider
173+
reprovide
174+
reprovide(r)
173175
reproviding
174176
retrievability
175177
roadmaps

docs/concepts/ipns.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Yet, there are many situations where content-addressed data needs to be regularl
3333

3434
The InterPlanetary Name System (IPNS) is a system for creating such mutable pointers to CIDs known as **names** or **IPNS names**. IPNS names can be thought of as links that can be updated over time, while retaining the verifiability of content addressing.
3535

36+
By analogy, IPNS names are like tags in git, which can be updated over time, and CIDs are like commit hashes in Git, which point to a snapshot of the files in the repository.
37+
3638
::: callout
3739
An IPNS name can point to any arbitrary content path (`/ipfs/` or `/ipns/`), *including another IPNS name or DNSLink path*. However, it most commonly points to a fully resolved and immutable path, i.e. `/ipfs/[CID]`.
3840
:::
@@ -121,7 +123,7 @@ The main implication of this difference is that IPNS operations (publishing and
121123

122124
The DHT is the default transport mechanism for IPNS records in many IPFS implementations.
123125

124-
Due to the ephemeral nature of the DHT, peers forget records after 24 hours. This applies to any record in the DHT, irrespective of the `validity` (also referred to as `lifetime`) field in the IPNS record.
126+
Due to the ephemeral nature of the DHT, records expire [after 48 hours](https://github.com/libp2p/specs/tree/b5f7fce29b32d4c7d0efe37b019936a11e5db872/kad-dht#content-provider-advertisement-and-discovery). This applies to any record in the DHT, irrespective of the `validity` (also referred to as `lifetime`) field in the IPNS record.
125127

126128
Therefore, IPNS records need to be regularly (re-)published to the DHT. Moreover, publishing to the DHT at regular intervals ensures that the IPNS name can be resolved even when there's high node churn (nodes coming and going.)
127129

@@ -173,7 +175,7 @@ Availability means resolving to a valid IPNS record, at the cost of potentially
173175

174176
#### IPNS record validity
175177

176-
When setting the `validity` (referred to as [`lifetime` by Kubo](https://github.com/ipfs/kubo/blob/master/docs/config.md#ipnsrecordlifetime)) field of an IPNS record, you typically need to choose whether you favor **consistency** (short validity period, e.g. 24 hours) or **availability** (long validity period, e.g. 1 month), due to the inherent trade-off between the two.
178+
When setting the `validity` (referred to as [`lifetime` by Kubo](https://github.com/ipfs/kubo/blob/master/docs/config.md#ipnsrecordlifetime)) field of an IPNS record, you typically need to choose whether you favor **consistency** (short validity period, e.g. 48 hours) or **availability** (long validity period, e.g. 1 month), due to the inherent trade-off between the two.
177179

178180
#### Practical considerations
179181

docs/how-to/gateway-troubleshooting.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ If providers were found in the DHT, do the following:
106106

107107
### No providers returned
108108

109-
If no providers are returned, the issue may lie in the content publishing lifecycle, specifically _reprovider runs_, the continuous process in which a node advertises provider records. _Provider records_ are mappings of CIDs to network addresses, and have an expiration time of 24 hours, which accounts for provider churn. Generally speaking, as more files are added to an IPFS node, the longer reprovide runs take. When a reprovide run takes longer than 24 hours (the expiration time for provider records), CIDs will no longer be discoverable.
109+
If no providers are returned, the issue may lie in the content publishing lifecycle, specifically _reprovider runs_, the continuous process in which a node advertises provider records. _Provider records_ are mappings of CIDs to network addresses, and have an expiration time of 48 hours, which accounts for provider churn. Generally speaking, as more files are added to an IPFS node, the longer reprovide runs take. When a reprovide run takes longer than 48 hours (the expiration time for provider records), CIDs will no longer be discoverable.
110110

111111
:::
112112
You can learn more about the content publishing lifecycle in [How IPFS works](../concepts/how-ipfs-works.md).
@@ -129,16 +129,16 @@ With this in mind, if no providers are returned, do the following:
129129
LastReprovideBatchSize: 1k (1,858)
130130
```
131131

132-
1. Note the value for `LastReprovideDuration`. If it is close to 24 hours, select one of the following options, keeping in mind that each has tradeoffs:
132+
2. Note the value for `LastReprovideDuration`. If it is close to 48 hours, select one of the following options, keeping in mind that each has tradeoffs:
133133

134134
- **Enable the [Accelerated DHT Client](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#accelerated-dht-client) in Kubo**. This configuration improves content publishing times significantly by maintaining more connections to peers and a larger routing table and batching advertising of provider records. However, this performance boost comes at the cost of increased resource consumption.
135135

136136
- **Change the reprovider strategy from `all` to either `pinned` or `roots`.** In both cases, only provider records for explicitly pinned content are advertised. Differences and tradeoffs are noted below:
137137
- The `pinned` strategy will advertise both the root CIDs and child block CIDs (the entire DAG) of explicitly pinned content.
138138
- The `roots` strategy will only advertise the root CIDs of pinned content, reducing the total number of provides in each run. This strategy is the most efficient, but should be done with caution, as it will limit discoverability only to root CIDs. In other words, if you are adding folders of files to an IPFS node, only the CID for the pinned folder will be advertised. All the blocks will still be retrievable with Bitswap once a connection to the node is established.
139139

140-
1. Manually trigger a reprovide run:
140+
3. Manually trigger a reprovide run:
141141

142142
```shell
143143
ipfs bitswap reprovide
144-
```
144+
```

0 commit comments

Comments
 (0)