Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit b64d8e8

Browse files
committed
feat(spec): generic API spec
1 parent 23788f6 commit b64d8e8

File tree

3 files changed

+792
-1
lines changed

3 files changed

+792
-1
lines changed

API/generic/README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
generic API
2+
===========
3+
4+
#### `id`
5+
6+
> Returns the identity of the Peer
7+
8+
##### `Go` **WIP**
9+
10+
##### `JavaScript` - ipfs.id([callback])
11+
12+
`callback` must follow `function (err, identity) {}` signature, where `err` is an error if the operation was not successful. `identity` is an object with the Peer identity.
13+
14+
If no `callback` is passed, a promise is returned.
15+
16+
Example:
17+
18+
```js
19+
ipfs.id(function (err, identity) {
20+
if (err) {
21+
throw err
22+
}
23+
console.log(identity)
24+
})
25+
```
26+
27+
#### `version`
28+
29+
> Returns the implementation version
30+
31+
##### `Go` **WIP**
32+
33+
##### `JavaScript` - ipfs.version([callback])
34+
35+
`callback` must follow `function (err, version) {}` signature, where `err` is an error if the operation was not successful. `version` is the version string of the implementation.
36+
37+
If no `callback` is passed, a promise is returned.
38+
39+
Example:
40+
41+
```js
42+
ipfs.version(function (err, version) {
43+
if (err) {
44+
throw err
45+
}
46+
console.log(version)
47+
})
48+
```

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "interface-ipfs-core",
33
"version": "0.9.0",
44
"description": "A test suite and interface you can use to implement a IPFS core interface.",
5-
"main": "lib/index.js",
5+
"main": "src/index.js",
66
"jsnext:main": "src/index.js",
77
"scripts": {
88
"test": "exit(0)",

0 commit comments

Comments
 (0)