Skip to content

Option to add Infura key. #10

Open
@ChrisCates

Description

Issue Type

Description

I noticed you guys are using Infura in the example. However, when I try to query Infura... I get an ECONNREFUSED error... Looking at the docs here: https://infura.io/docs/ipfs/get/block_get.

It's clear that I need to have an infura key in order to query the IPFS storage... Shouldn't I be able to add a key for infura in the query string?

Steps to reproduce

$ node
> const IPFS = require('ipfs-mini');
undefined
> const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });
undefined
> 
> ipfs.cat('QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j', (err, result) => {
...   console.log(err, result);
... });
undefined
> Error: [ipfs-mini] status 0: Error: connect ECONNREFUSED 34.237.60.131:5001
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
    at exports.XMLHttpRequest.request.onreadystatechange (/Users/chriscates/Projects/UniversalLoginSDK/node_modules/ipfs-mini/lib/index.js:56:18)
    at exports.XMLHttpRequest.dispatchEvent (/Users/chriscates/Projects/UniversalLoginSDK/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
    at setState (/Users/chriscates/Projects/UniversalLoginSDK/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
    at exports.XMLHttpRequest.handleError (/Users/chriscates/Projects/UniversalLoginSDK/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
    at ClientRequest.errorHandler (/Users/chriscates/Projects/UniversalLoginSDK/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
    at ClientRequest.emit (events.js:182:13)
    at ClientRequest.EventEmitter.emit (domain.js:442:20)
    at TLSSocket.socketErrorListener (_http_client.js:391:9)
    at TLSSocket.emit (events.js:182:13)
    at TLSSocket.EventEmitter.emit (domain.js:442:20) null

Versions

  • Node/NPM: LTS (Node: v10.13.0 / NPM: 6.4.1)

  • Browser: N/A

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions