Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 781ac2f

Browse files
committed
feat(name): add name.publish spec
1 parent 244f052 commit 781ac2f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

API/name/README.md

+52
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11
name API
22
========
33

4+
#### `publish`
5+
6+
> Publish an IPNS name with a given value.
7+
8+
##### `Go` **WIP**
9+
10+
##### `JavaScript` - ipfs.name.publish(value, [options, callback])
11+
12+
`value` is a base58 encoded IPFS multihash, such as: `/ipfs/QmbezGequPwcsWo8UL4wDF6a8hYwM1hmbzYv2mnKkEWaUp`.
13+
14+
`options` is an object that may contain:
15+
16+
```JavaScript
17+
{
18+
resolve: // bool - Resolve given path before publishing. Default: true.
19+
lifetime: // string - Time duration of the record. Defaulg: 24h
20+
ttl: // string - Time duration this record should be cached
21+
}
22+
```
23+
24+
`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash publishes, such as:
25+
26+
```JavaScript
27+
{
28+
name: "/ipns/QmHash.."
29+
value: "/ipfs/QmHash.."
30+
}
31+
```
32+
33+
If no `callback` is passed, a promise is returned.
34+
35+
Example:
36+
37+
```JavaScript
38+
// TODO
39+
```
40+
41+
#### `resolve`
42+
43+
> Resolve an IPNS name.
44+
45+
##### `Go` **WIP**
46+
47+
##### `JavaScript` - ipfs.name.resolve(value, [options, callback])
48+
49+
If no `callback` is passed, a promise is returned.
50+
51+
-r, --recursive bool - Resolve until the result is not an IPNS name. Default: false.
52+
-n, --nocache bool - Do not use cached entries. Default: false.
53+
54+
Example:
55+
456

0 commit comments

Comments
 (0)