Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
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

Description

@gaieges

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions