Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I serve to a gateway #49

Closed
konsumer opened this issue Apr 7, 2017 · 11 comments
Closed

How do I serve to a gateway #49

konsumer opened this issue Apr 7, 2017 · 11 comments

Comments

@konsumer
Copy link

konsumer commented Apr 7, 2017

I've got a browser-based demo here that correctly generates a new file and stores it in IndexDB via ipfs-js.

How do I make it's content available on a gateway? I tried using bootstrap.add on hosts from the the node config but that didn't seem to work (or throw an error.)

@daviddias
Copy link
Member

@konsumer you have to add the Bootstrap nodes when you create the instance:

const ipfs = new Ipfs({
  config: {
    Bootstrap: [
      "/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
      "/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx",
      "/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
      "/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
      "/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
      "/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
      "/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
      "/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
    ]
  }
})

Let me know if it works for you :)

This will be added by default once ipfs/js-ipfs#740 is merged.

@konsumer
Copy link
Author

konsumer commented Apr 7, 2017

That totally worked! Thanks so much!

@daviddias
Copy link
Member

Closing this one. Keep us posted of future developments :)

@JohnAllen
Copy link

JohnAllen commented Aug 28, 2017

This example no longer works, even when removing the 502-returning bootstrap servers. Any thoughts as to why this isn't working? This is a pretty big bottleneck for us right now with what we're working on -- any help would be greatly appreciated!

Just tested some other content added from the command line that is working, so it's not the gateway!

@daviddias
Copy link
Member

@JohnAllen could you share the issue you are having? I just loaded it and it worked:

image

@konsumer
Copy link
Author

konsumer commented Aug 29, 2017

I think it doesn't actually get posted to ipfs (it's not available on the gateway.) See this issue

@ghost
Copy link

ghost commented Aug 29, 2017

Please file issues with js-ipfs or go-ipfs in the respective repos. This repo is for tracking the work on integrating IPFS into web browsers.

@daviddias
Copy link
Member

@lgierth he did, that was the issue linked on the comment above ipfs/js-ipfs#967 ;)

@ghost
Copy link

ghost commented Aug 29, 2017

Oh got it -- sorry

@JohnAllen
Copy link

Will stay in the other, more-to-the-point, issue. (but yeah example works just doesn't pin and isn't available on gateway)

@buzz
Copy link

buzz commented Jun 15, 2018

Hey, I'm trying the example. The gateway is not able to fetch from the browser.

Tracked your progress through ipfs/js-ipfs#967 and ipfs/js-ipfs#973.

My fork is here: https://codepen.io/anon/pen/LrzBLa?editors=0010

Am I missing something?

EDIT: Opened discuss thread https://discuss.ipfs.io/t/serving-a-gateway-from-a-js-ipfs-web-app/3222

EDIT: Seems to be resolved: ipfs/js-ipfs#1380 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants