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

Unable to get / put objects sequentially #836

Closed
gaieges opened this issue Apr 23, 2017 · 3 comments
Closed

Unable to get / put objects sequentially #836

gaieges opened this issue Apr 23, 2017 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@gaieges
Copy link

gaieges commented Apr 23, 2017

This may be a noob question, but for some reason I'm unable to put and object into the store, and then simply get it right after. Here's what I'm working with as a simple demo:

var IPFS = require('ipfs');

var ipfs = new IPFS({start: true, init: true})

var obj = {
  Data: new Buffer('awesome data here 123556'), 
  Links:[]
};


var meh = ipfs.on('ready', () => {
  ipfs.object.put(obj,(putErr,putNode) => { 
    if( putErr )
      return console.error(putErr)

    var hash = putNode.toJSON().multihash

    console.log("successfully put: %s", hash );

    ipfs.object.get(hash,(gotErr, gotNode) => {
      if( gotErr )
        return console.error(gotErr)

      console.log( "successfully got: %s", gotNode.toJSON() ); 
    })
  })

})

Theoretically based on my understanding, this should work fine - it should put the object (which it does successfully) and then spit it out again. However what I'm seeing is that it hangs when get'ing the object, even when running on the same host.

Any thoughts?

@daviddias
Copy link
Member

Hi @gaieges, there was indeed a bug that was fixed with #849 by @kenshyx, you should not see this problem anymore. Thanks for the report :)

@daviddias daviddias added the kind/bug A bug in existing code (including security flaws) label May 19, 2017
@gaieges
Copy link
Author

gaieges commented Jun 5, 2017

Confirmed this fixed it, thank you! (Sorry for the delay)

@daviddias
Copy link
Member

Thanks! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants