Closed ThalusA closed 3 years ago
Ok so never mind. I needed js-ipfs. So now my code is like that :
<script src="https://cdn.jsdelivr.net/npm/orbit-db@0.26.1/dist/orbitdb.js" integrity="sha256-hyVW35Y+JfcPUDLNCNcl8ELtT0p8XQQkk8TG0qU/Cxo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/ipfs@0.55.3/dist/index.min.js" integrity="sha256-kAWcJOwLFbB/Pkai8zGd97qUtYVGfOVvFCsH4+RK8YY=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/ipfs-http-client@50.1.1/dist/index.min.js" integrity="sha256-EjtfQnFY9TWI8ZHFqKjHcqgHHnrE2uQrzQgaYgKro7I=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/ipfs-provider@2.0.1/dist/index.min.js" integrity="sha256-0gpmoxZ7DiHqTnHEQM575Y8HWk1dxrlzwRejOm6yIIw=" crossorigin="anonymous"></script>
<script src="index.js"></script>
<script>
console.log(window)
const { getIpfs, providers } = window.IpfsProvider;
const { httpClient, jsIpfs, windowIpfs } = providers;
const ipfsGetter = getIpfs({
loadHttpClientModule: () => window.IpfsHttpClient,
loadJsIpfsModule: () => window.Ipfs,
providers: [
windowIpfs({ permissions: { commands: ['add', 'cat', 'id', 'version'] } }),
httpClient(),
jsIpfs()
]
});
ipfs_browser(ipfsGetter, window.OrbitDB);
</script>
Hi, I don't really understand why with default configuration, the ipfs-provider doesn't work. I'm currently working on a browser-only environment without anykind of advance usage with webpack, browserify or anything.
That's how I'm getting ipfs object getter:
And that's how I'm accessing to it (index.js):
However ipfs object getter always return undefined even if window.IpfsHttpClient exists. Could you help me with that small issue ?