I have javascript app (ReactJs) which will run as an android hybrid app on mobile devices. I do not want to run full IPFS node on a mobile device, because it will consume a lot of its memory and energy. How can I connect my app to IPFS then?
I saw https://github.com/ipfs/js-ipfs-api#importing-the-module-and-usage, but it does not look usable for a mobile device again as it runs as a separated service.
Probably I have to connect to some IPFS node at the internet through IPFS API (https://ipfs.io/docs/api/), however is there a way to discover running nodes on the runtime and also to choose the fastest/closest one?
js-ipfs paves the way for the Browser implementation of the IPFS protocol. Written entirely in JavaScript, it runs in a Browser, a Service Worker, a Web Extension and Node. js, opening the door to a world of possibilities. js-ipfs runs in a Browser, a Service Worker, a Web Extension and Node.
Alternatively, you can access IPFS content from any browser by using a public gateway such as https://ipfs.io or https://cloudflare-ipfs.com. A gateway will automatically route you to IPFS content using the link, and there's a long list of alternative gateways available.
You have a couple of options here:
js-ipfs
node instance when you need it and garbage collect it afterward.Are you developing a PWA? js-ipfs
works well on Chrome in Android phones, check https://github.com/ipfs/js-ipfs/tree/master/examples to learn how to get started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With