This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict' | ||
|
||
const Command = require('ronin').Command | ||
const IPFS = require('../../ipfs-core') | ||
const debug = require('debug') | ||
const log = debug('cli:version') | ||
log.error = debug('cli:version:error') | ||
|
||
module.exports = Command.extend({ | ||
desc: 'Shows IPFS version information', | ||
|
||
options: { | ||
number: { | ||
alias: 'n', | ||
type: 'boolean', | ||
default: false | ||
}, | ||
commit: { | ||
type: 'boolean', | ||
default: false | ||
}, | ||
repo: { | ||
type: 'boolean', | ||
default: false | ||
} | ||
}, | ||
|
||
run: (name) => { | ||
var node = new IPFS() | ||
node.version((err, version) => { | ||
if (err) { return log.error(err) } | ||
|
||
console.log(version) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict' | ||
|
||
const Command = require('ronin').Command | ||
const IPFS = require('../../../ipfs-core') | ||
const debug = require('debug') | ||
const log = debug('cli:version') | ||
log.error = debug('cli:version:error') | ||
|
||
module.exports = Command.extend({ | ||
desc: 'Show peers in the bootstrap list', | ||
|
||
options: {}, | ||
|
||
run: (name) => { | ||
var node = new IPFS() | ||
node.bootstrap.list((err, list) => { | ||
if (err) { return log.error(err) } | ||
list.forEach(node => { console.log(node) }) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict' | ||
|
||
const Command = require('ronin').Command | ||
const IPFS = require('../../ipfs-core') | ||
const debug = require('debug') | ||
const log = debug('cli:version') | ||
log.error = debug('cli:version:error') | ||
|
||
module.exports = Command.extend({ | ||
desc: 'Shows IPFS version information', | ||
|
||
options: { | ||
number: { | ||
alias: 'n', | ||
type: 'boolean', | ||
default: false | ||
}, | ||
commit: { | ||
type: 'boolean', | ||
default: false | ||
}, | ||
repo: { | ||
type: 'boolean', | ||
default: false | ||
} | ||
}, | ||
|
||
run: (name) => { | ||
var node = new IPFS() | ||
node.version((err, version) => { | ||
if (err) { return log.error(err) } | ||
|
||
console.log(version) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
const server = require('./../index.js').server | ||
const resources = require('./../resources') | ||
|
||
server.route({ | ||
method: 'GET', | ||
path: '/api/v0/bootstrap', | ||
handler: resources.version.list | ||
}) | ||
|
||
server.route({ | ||
method: 'POST', | ||
path: '/api/v0/boostrap', | ||
This comment has been minimized.
Sorry, something went wrong. |
||
handler: resources.version.add | ||
}) | ||
|
||
server.route({ | ||
method: 'DELETE', | ||
path: '/api/v0/boostrap', | ||
This comment has been minimized.
Sorry, something went wrong. |
||
handler: resources.version.add | ||
}) |
2 comments
on commit ef701dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed that you meant that there was typos, fixed on master, thanks @ralphtheninja :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
bootstrap
?