3

I am using the API to access IPFS and access is OK with a status code 200 but the API call fails. Here is the code:

 this.IpfsAPI = IpfsAPI('162.243.237.41', '5001', {protocol: 'http'})
var zstr = 'hello world from Zillerium2'
    this.IpfsAPI.add(new Buffer(zstr), function (err, res){
          console.log("hello");
          if(err || !res) return console.error("ipfs add error", err, res);
          else{

The call returns the following - does anyone have any experience or idea about the X-Stream error:

 Request URL:http://162.243.237.41:5001/api/v0/object/get?
arg=QmQHoSC2We7F3kskZExSpjUbwCVWDnaW1VQT44b14n5rLG&stream -channels=true
Request Method:POST
Status Code:200 OK
Remote Address:162.243.237.41:5001
Response Headers
view source
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:X-Stream-Output, X-Chunked-Output, X-        Content-Length  
Access-Control-Allow-Origin:http://jenbil.com:3000
Access-Control-Expose-Headers:X-Stream-Output, X-Chunked-Output, X-Content-Length   
Content-Type:application/json   
 Date:Sat, 06 May 2017 15:00:20 GMT 
Server:go-ipfs/0.4.8

Trailer:X-Stream-Error

Transfer-Encoding:chunked
Vary:Origin
Request Headers
view source
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:0
Host:162.243.237.41:5001
Origin:http://jenbil.com:3000
Referer:http://jenbil.com:3000/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Query String Parameters
view source
view URL encoded
arg:QmQHoSC2We7F3kskZExSpjUbwCVWDnaW1VQT44b14n5rLG
stream-channels:true
1
  • I just saw this - gateway.ipfs.io/ipfs/… printing Hello World from Zillerium - so it seems that some of the adds have been working and the issue is therefore related to the stream being returned. It seems to me the API has been working for some calls but not returning the correct data to complete the protocol end to end. This must be related to some kind of terminating data for the data stream from IPFS. May 7, 2017 at 7:31

1 Answer 1

1

The X-Stream error indicates that errors have occurred fetching the rest of the IPFS blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.