
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
ipfs-redux-bundle
Advanced tools
This library is being deprecated and replaced with more flexible ipfs-provider.
This library will not be maintained.
A redux bundle to create an IPFS instance and pass it as an
extraArg
to other store methods.
See https://reduxbundler.com for more info on the wonders of redux bundles.
This module tries to connect to IPFS via multiple providers, in order:
ipfs-companion
the IPFS instance from IPFS Companion directly.window.ipfs
in the current page via IPFS Companion.js-ipfs-http-client
with either a user provided apiAddress
, the current origin, or the default /ip4/127.0.0.1/tcp/5001
address.js-ipfs
disabled by default. Pass tryJsIpfs: true, getJsIpfs: () => Promise
to enable it. See Enable js-ipfsAdd ipfs-redux-bundle
to your store
bundles/index.js
import { composeBundles } from 'redux-bundler'
import ipfsBundle from 'ipfs-redux-bundle'
// ... import other bundles
export default composeBundles(
ipfsBundle({
// These are the defaults:
tryCompanion: true, // set false to bypass ipfs-companion verification
tryWindow: true, // set false to bypass window.ipfs verification
tryApi: true, // set false to bypass js-ipfs-http-client verification. Uses data from ipfsApi variable in localStorage
tryJsIpfs: false, // set true to attempt js-ipfs initialisation.
getJsIpfs: null // must be set to a js-ipfs instance if tryJsIpfs is true.
})
// ... add bundles here
)
In your app, you can now connect
up the doInitIpfs
function. Here we init IPFS when our root component mounts:
App.js
import React, { Component } from 'react'
import { connect } from 'redux-bundler-react'
export class App extends Component {
componentDidMount () {
this.props.doInitIpfs()
}
render () {
// ipfs-css powered gorgeous ui here.
}
}
export default connect(
'doInitIpfs',
App
)
To enable js-ipfs, intialise the bundle with the following opts
ipfsBundle({
tryJsIpfs: true,
getJsIpfs: () => import('ipfs')
})
tryJsIpfs
should be set to true
getJsIpfs
should be a function that returns a promise that resolves with a JsIpfs
constructor. This works well with dynamic import()
, so you can lazily load js-ipfs when it is needed.Adds the following methods to the redux store.
store.selectIpfsReady()
boolean
- Is the IPFS instance ready to use yet?store.selectIpfsInitFailed()
boolean
- Did the IPFS instance fail to start?store.selectIpfsInvalidAddress()
boolean
- Is the last API Address you tried to use invalid?store.selectIpfsProvider()
string
- Can be window.ipfs
, js-ipfs-api
or js-ipfs
.store.selectIpfsApiAddress()
string
- The API address of the IPFS instance.store.doInitIpfs()
window.ipfs
if you have IPFS Companion installed, or a js-ipfs-http-client
instance otherwise.store.doStopIpfs()
js-ipfs
.store.doUpdateIpfsApiAddress(address)
address
.store.doDismissIpfsInvalidAddress()
Feel free to dive in! Open an issue or submit PRs.
MIT © Protocol Labs
FAQs
A redux bundle to create an IPFS instance
The npm package ipfs-redux-bundle receives a total of 18 weekly downloads. As such, ipfs-redux-bundle popularity was classified as not popular.
We found that ipfs-redux-bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.