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

feat: Add diag/sys command #129

Merged
merged 1 commit into from
Nov 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ function IpfsAPI (host_or_multiaddr, port) {
}

self.diag = {
net: command('diag/net')
net: command('diag/net'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove this command (daig net) from the api? we'll be deprecating it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on 0.3.10? We can deprecate it when that IPFS version is released.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it deprecated? :( It has some nice details, is there an alternative to get this data?

sys: command('diag/sys')
}

self.block = {
Expand Down
12 changes: 12 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,18 @@ describe('IPFS Node.js API wrapper tests', () => {
done()
})
})

it('.diag.sys', function (done) {
apiClients['a'].diag.sys((err, res) => {
if (err) {
throw err
}
assert(res)
assert(res.memory)
assert(res.diskinfo)
done()
})
})
})

describe('.block', function () {
Expand Down