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

feat: make js-ipfs cli and daemon behave like go-ipfs #1067

Merged
merged 6 commits into from
Nov 14, 2017

Conversation

dryajov
Copy link
Member

@dryajov dryajov commented Nov 11, 2017

This is needed to make js-ipfs consistent with how go-ipfs behaves - needed for ipfs/js-ipfsd-ctl#170.

@ghost ghost assigned dryajov Nov 11, 2017
@ghost ghost added the status/in-progress In progress label Nov 11, 2017
Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

@dryajov could you please add a test to this PR?

@dryajov
Copy link
Member Author

dryajov commented Nov 11, 2017

will do!

@dryajov dryajov force-pushed the fix/missing-swarm-addrs branch from b1e8d36 to 66bc4e1 Compare November 13, 2017 10:15
@dryajov
Copy link
Member Author

dryajov commented Nov 13, 2017

Added SIGTERM handler for go-ipfs compat

@dryajov
Copy link
Member Author

dryajov commented Nov 13, 2017

(test are on the way)

@dryajov
Copy link
Member Author

dryajov commented Nov 13, 2017

EDIT: this is resolved.

I've added the test for missing Addresses.Swarm, but I'm running into a weird error. When passing my configuration with the ipfs-exec utility I get this error on daemon start:

Command failed: /Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/src/cli/bin.js daemon
/Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/src/http/index.js:106
          const api = config.Addresses.API.split('/')
                                           ^

TypeError: config.Addresses.API.split is not a function
    at node._repo.config.get (/Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/src/http/index.js:106:44)
    at store.get (/Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/node_modules/ipfs-repo/src/config.js:45:9)
    at /Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)

Initializing daemon...
{ API: [ '/ipfs/QmAbc', '/ipfs/QmDef' ],
  Gateway: [ '/ipfs/QmAbc', '/ipfs/QmDef' ] }

Error: Command failed: /Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/src/cli/bin.js daemon
/Users/dryajov/personal/projects/ipfs/ipfs/js-ipfs/src/http/index.js:106
          const api = config.Addresses.API.split('/')
                                           ^

TypeError: config.Addresses.API.split is not a function
    at node._repo.config.get (src/http/index.js:106:44)
    at store.get (node_modules/ipfs-repo/src/config.js:45:9)
    at node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)

Initializing daemon...
{ API: [ '/ipfs/QmAbc', '/ipfs/QmDef' ],
  Gateway: [ '/ipfs/QmAbc', '/ipfs/QmDef' ] }

    at Promise.all.then.arr (node_modules/execa/index.js:236:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

essentially failing to deserialize Addresses.API as an array. I'm not sure what the issue might be. This has definitely left me head scratching - need to investigate some more. (it might also be the consequence of working at 5am 👅 )

@dryajov dryajov changed the title feat: pre-start throws if Adresses.Swarm is missing [WIP] feat: make js-ipfs cli and daemon behave like go-ipfs Nov 13, 2017
@dryajov
Copy link
Member Author

dryajov commented Nov 13, 2017

all issues resolved and tests added.

@dryajov dryajov changed the title [WIP] feat: make js-ipfs cli and daemon behave like go-ipfs feat: make js-ipfs cli and daemon behave like go-ipfs Nov 14, 2017
Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

Thank you @dryajov :)

@daviddias daviddias merged commit 7dd4e01 into master Nov 14, 2017
@daviddias daviddias deleted the fix/missing-swarm-addrs branch November 14, 2017 09:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants