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

Commit

Permalink
feat(spec): generic API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Aug 16, 2016
1 parent 23788f6 commit b64d8e8
Show file tree
Hide file tree
Showing 3 changed files with 792 additions and 1 deletion.
48 changes: 48 additions & 0 deletions API/generic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
generic API
===========

#### `id`

> Returns the identity of the Peer
##### `Go` **WIP**

##### `JavaScript` - ipfs.id([callback])

`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.

If no `callback` is passed, a promise is returned.

Example:

```js
ipfs.id(function (err, identity) {
if (err) {
throw err
}
console.log(identity)
})
```

#### `version`

> Returns the implementation version
##### `Go` **WIP**

##### `JavaScript` - ipfs.version([callback])

`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.

If no `callback` is passed, a promise is returned.

Example:

```js
ipfs.version(function (err, version) {
if (err) {
throw err
}
console.log(version)
})
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "interface-ipfs-core",
"version": "0.9.0",
"description": "A test suite and interface you can use to implement a IPFS core interface.",
"main": "lib/index.js",
"main": "src/index.js",
"jsnext:main": "src/index.js",
"scripts": {
"test": "exit(0)",
Expand Down
Loading

0 comments on commit b64d8e8

Please sign in to comment.