Skip to content

make sure exec matches the passed node type #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2018
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"detect-node": "^2.0.3",
"hapi": "^16.6.2",
"hat": "0.0.3",
"ipfs-api": "^17.2.5",
"ipfs-repo": "^0.18.5",
"joi": "^13.0.2",
"lodash.clone": "^4.5.0",
Expand All @@ -93,6 +92,7 @@
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "0.4.13",
"ipfs": "^0.27.5",
"ipfs-api": "^17.3.0",
Copy link
Member

Choose a reason for hiding this comment

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

@dryajov only realized after that ipfs-api is now a devDep. Does this mean that folks have to pass ipfs-api everytime they want to spawn a node?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

What was the rationale behind moving it?

"is-running": "1.0.5",
"mkdirp": "^0.5.1",
"pre-commit": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/remote-node/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = (server) => {
path: '/spawn',
handler: (request, reply) => {
const payload = request.payload || {}
const ctrl = new CtrlFactory(payload.type)
const ctrl = new CtrlFactory({ type: payload.type })
ctrl.spawn(payload.opts, (err, ipfsd) => {
if (err) {
return reply(boom.badRequest(err))
Expand Down
8 changes: 8 additions & 0 deletions test/start-stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ module.exports = (type) => {
expect(ipfsd).to.exist()
})

it('daemon exec path should match type', () => {
let execPath = type === 'js'
? 'ipfs/src/cli/bin.js'
: 'go-ipfs-dep/go-ipfs/ipfs'

expect(ipfsd.exec).to.have.string(execPath)
})

it('daemon should not be running', (done) => {
ipfsd.pid((pid) => {
expect(pid).to.not.exist()
Expand Down