Skip to content

Commit 8f1022a

Browse files
committed
chore: refine ipns howto
1 parent b219b4e commit 8f1022a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/how-to/publish-ipns.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ipfs name publish --key=SecondKey /ipfs/bafybeicklkqcnlvtiscr2hzkubjwnwjinvskffn
105105

106106
## Publishing IPNS names programmatically with JS-IPFS
107107

108-
With [ipfs-core](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-core#readme) (a full IPNS node in JavaScript) you can you can publish an IPNS name as follows:
108+
With [ipfs-core](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-core#readme) (a full IPNS node in JavaScript) you can publish an IPNS name as follows:
109109

110110
```javascript
111111
import * as IPFS from 'ipfs-core'
@@ -118,13 +118,13 @@ const addr = '/ipfs/bafkreidbbor7mvra2xzzl4kmr2sxrtkzaxlzs6rsr5ktgmbtousuzrhlxq'
118118
ipfs.name.publish(addr, options).then(function (res) {
119119
// You now receive a res which contains two fields:
120120
// - name: the name under which the content was published.
121-
// - value: the "real" address to which Name points.
122-
console.log(`https://ipfs.io/ipns/${res.name}`)
121+
// - value: the IPFS path to which the IPNS name points.
122+
console.log(`IPNS name: ${res.name}\n value: ${res.value}`)
123123
})
124124
```
125125

126126
By default, `ipfs.name.publish` will use the Peer ID and set the lifetime to 24 hours. To learn more about the full API, check out the [API docs](https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/NAME.md#ipfsnamepublishvalue-options).
127127

128128
:::warning
129-
Note that when using `ipfs-core`, you're instantiating a full IPFS node. For your IPNS record to propagate through the network, it needs to be connected to other peers. Typically this is not a problem, however, if you're running `ipfs-core` in the browser, you may want to connect it to a long-running IPFS node to ensure it successfully propagates due to [browser connectivity limitations.](https://github.com/ipfs/js-ipfs/blob/master/docs/BROWSERS.md#limitations-of-the-browser-context)
129+
Note that when using `ipfs-core`, you're instantiating a full IPFS node. For your IPNS record to propagate through the network, it needs to be connected to other peers. If you're running `ipfs-core` in the browser, you may want to connect it to a long-running IPFS node to ensure it successfully propagates due to [browser connectivity limitations.](https://github.com/ipfs/js-ipfs/blob/master/docs/BROWSERS.md#limitations-of-the-browser-context).
130130
:::

0 commit comments

Comments
 (0)