Skip to content

Commit f95444b

Browse files
committed
swarm/services/ens: improve README
1 parent 10585b2 commit f95444b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

swarm/services/ens/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,22 @@ ens.setContentHash("swarm","0x7420f14a28e276dd39da6a967dec332a932256717451155fbd
5757
```
5858

5959
The content hash argument is the bzz hash as returned by a swarm upload, e.g., using `bzz.upload`:
60+
The name here will allow the name setting, if the top-level domain is 'swarm', it dispatches to the
61+
resolver just registered.
6062

6163
```js
6264
bzz.upload("path/to/my/directory", "index.html")
6365
```
6466

65-
Here the second argument is the relative path to the asset mapped on to the root hash of entire collection, effectively the landing page served on the bare hash (and therefore the root of the domain registered with that hash) as url.
67+
Here the second argument to `bzz.upload` is the relative path to the asset mapped on to the root hash of entire collection, effectively the landing page served on the bare hash (and therefore the root of the domain registered with that hash) as url.
68+
69+
The same resolver will allow setting subdomains:
70+
71+
```js
72+
ens.setContentHash("album.swarm","7a59235e5f9c23bf74deb4838e24f75a77f786163f404c8004d79b5674625db0")
73+
// {}
74+
```
75+
6676

6777

6878
### `ens.resolve(name)`
@@ -74,7 +84,7 @@ ens.resolve("swarm")
7484
// "7420f14a28e276dd39da6a967dec332a932256717451155fbd3870b202b561c4"
7585
```
7686

77-
The same is used within swarm to resolve hostnames in urls, hence you can use the set names of registered domains in a bzz-scheme url `bzz://swarm` or normal http using a swarm http proxy: `localhost:32200/bzz:/swarm`.
87+
This same backend method is used within swarm to resolve hostnames in urls, hence you can use the set names of registered domains in a bzz-scheme url `bzz://swarm` or normal http using a swarm http proxy: `http://localhost:32200/bzz:/swarm`.
7888

7989
## Development
8090

0 commit comments

Comments
 (0)