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

jsipfs init works but no results #286

Closed
MasterJames opened this issue May 28, 2016 · 10 comments
Closed

jsipfs init works but no results #286

MasterJames opened this issue May 28, 2016 · 10 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws)

Comments

@MasterJames
Copy link

MasterJames commented May 28, 2016

when I run jsipfs init it does create the config so show will display the Identity.PeerId etc.
but it doesn't actually display what is shown in the demos as in results with the ipfs cat /ipfs/PeerId/readme
Maybe one needs some extra steps explained in the repo README to add files etc.?

When I add a with files add NewFile.txt it says
added ID NewFile.txt as expected
if I files get /ipfs/ID it says
error EISDIR: illegal operation on a directory, open 'C:\WORK_FOLDER\IPFS\ipfs'

If I put "files get /ifps/ID/NewFile.txt" is says
error Non-base58 character

jsipfs ls ID results in a blank line, while the files get shows the directory in the EISDIR: illegal operation on a directory error and if I look there is nothing there (after adding from outside). If I move the file in from the parent folder it was added from I see no change.

Now If I files add from within the target folder in will create a directory with the same hash and the files is still there. Putting the file inside the folder named from the hash makes no difference to ls /ipfs/ID as it will always display blank.

@MasterJames
Copy link
Author

#285

@MasterJames
Copy link
Author

If I'm running the daemon straight or with my own mount points it won't allow files add NewFile.txt
TypeError: ipfs.files.add is not a function
With call stack...


    at npm\node_modules\ipfs\src\cli\commands\files\add.js:62:30
    at Object.exports.getIPFS (npm\node_modules\ipfs\src\cli\utils.js:46:3)
    at npm\node_modules\ipfs\src\cli\commands\files\add.js:58:13
    at f (npm\node_modules\ipfs\node_modules\once\once.js:17:25)
    at Glob.<anonymous> (npm\node_modules\ipfs\node_modules\glob\glob.js:146:7)
    at emitOne (events.js:77:13)
    at Glob.emit (events.js:169:7)
    at Glob._finish (npm\node_modules\ipfs\node_modules\glob\glob.js:194:8)
    at done (npm\node_modules\ipfs\node_modules\glob\glob.js:179:14)
    at Glob._processGlobStar2 (npm\node_modules\ipfs\node_modules\glob\glob.js:631:12)

@daviddias
Copy link
Member

ipfs cat /ipfs/PeerId/readme

It shouldn't be your peerId, but actually the folder hash that contains the Readme

On the second set of questions, we haven't really tests js-ipfs on Windows, mainly because we don't have anyone that is completely focused on using the platform that can inform us how robust is the experience on Windows. Would you like to help us? :D

Nevertheless, trying this, found a couple of bugs with init and cat, since they don't have the same behaviour as go-ipfs. //cc @nginnever @noffle

» ipfs init
initializing ipfs node at /Users/ground-control/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmY2XAK2hUJHpeFNo7t6o3RYUEhRV8BhL7otLCcDR3Tppg
to get started, enter:

        ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

» jsipfs files cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
error   Non-base58 character
» jsipfs files cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
error   Non-base58 character
» jsipfs files cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
error   undefined
» jsipfs files cat QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
error   undefined
» rm ~/.ipfs
rm: /Users/ground-control/.ipfs: is a directory
» rm -r ~/.ipfs
» jsipfs init
» jsipfs files cat QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
error   ENOENT: no such file or directory, open '/Users/ground-control/.ipfs/blocks/12209d6c/12209d6c2be50f706953479ab9df2ce3edca90b68053c00b3004b7f0accbe1e8eedf.data'
» jsipfs files cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
error   ENOENT: no such file or directory, open '/Users/ground-control/.ipfs/blocks/12209d6c/12209d6c2be50f706953479ab9df2ce3edca90b68053c00b3004b7f0accbe1e8eedf.data'
»

@MasterJames
Copy link
Author

MasterJames commented May 28, 2016

with jsipfs trying ipfs will say not recognized
Ya very different commands files add files get ?... files cat too even.
Potentially I could help but I'm too new to it, never even tried the 'go' version. Total turn off by it until I found this one. JavaScript is the way forward.

@MasterJames
Copy link
Author

MasterJames commented May 28, 2016

What's up with this
https://github.com/ipfs/js-ipfs-unixfs-engine/blob/master/src/importer.js#L36

  this._read = (n) => {}

  this._write = (fl, enc, next) => {
    this.read()

It calls a blank function?

@daviddias
Copy link
Member

You have to 'implement it' in order to be able to do https://github.com/ipfs/js-ipfs-unixfs-engine/blob/master/src/importer.js#L61 this.push to the stream

@MasterJames
Copy link
Author

MasterJames commented May 28, 2016

From Duplex?
https://github.com/nodejs/readable-stream/blob/01fb5608a970b42c900b96746cadc13d27dd9d7e/lib/_stream_transform.js
Hmmm...
doesn't this
this._read = (n) => {}
damage/overwrite it?

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) milestone 2 labels Jul 27, 2016
@daviddias
Copy link
Member

Hey @MasterJames, is this still a issue, could you confirm?

@victorb
Copy link
Member

victorb commented Sep 2, 2016

jsipfs init still shows no output, compared to go-ipfs that includes some getting started information. See example:

$ rm -r ~/.ipfs
$ ipfs init
initializing ipfs node at /Users/victor/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmdkKUnxKiDqEXd9QjPJGqUdXfgoqUFNZJTDQQCMtFJ4EV
to get started, enter:

    ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

$ rm -r ~/.ipfs
$ jsipfs init
$

@daviddias daviddias added the exp/novice Someone with a little familiarity can pick up label Sep 7, 2016
victorb added a commit that referenced this issue Sep 10, 2016
Shows exactly same information as go-ipfs except for change of the cmd +
cat so `ipfs cat` turns into `jsipfs files cat` instead. Ref: issue #286
victorb added a commit that referenced this issue Sep 12, 2016
Shows exactly same information as go-ipfs except for change of the cmd +
cat so `ipfs cat` turns into `jsipfs files cat` instead. Ref: issue #286
victorb added a commit that referenced this issue Sep 12, 2016
Shows exactly same information as go-ipfs except for change of the cmd +
cat so `ipfs cat` turns into `jsipfs files cat` instead. Ref: issue #286
@daviddias
Copy link
Member

Done in #475

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants