var React = require('react') var Link = require('react-router').Link var Icon = require('icon.jsx') module.exports = React.createClass({ getInitialState: function () { return {} }, componentWillReceiveProps: function (props) { if (props.api) { this.checkStatus(props.api) } }, componentDidMount: function () { this.checkStatus(this.props.api) }, checkStatus: function (boards) { if (boards) { if (!this.isMounted()) return if (boards.isInit) { this.setState({ connected: true }) } else { if (boards.init_error) { this.setState({ error: boards.init_error }) } else { boards.getEventEmitter().on('init', error => { if (!this.isMounted()) return if (error) { this.setState({ error }) } else { this.setState({ connected: true }) clearTimeout(this.timer) } }) } } } else this.startTimer() }, componentWillUnmount: function () { if (this.timer) clearTimeout(this.timer) }, startTimer: function () { this.timer = setTimeout(_ => { if (this.isMounted()) { console.log('Connection to go-ipfs has timed out (probably due to CORS)') this.setState({ long: true }) this.checkStatus() } }, 5000) }, render: function () { var opt = require('options.jsx').get() if (this.state.error || this.state.long) { return (
{this.state.error || 'connection to go-ipfs failed'}
You don't have an IPFS node running at {opt.addr}:{opt.port}
or it is not reachable.
The IPFS Boards prototype requires a full IPFS node. Please start one by following the
go-ipfs
documentation.
It's probably one of these issues:
{opt.addr}:{opt.port}
. Go to the Settings Page to configure the connection.Still can't fix it? File a issue on GitHub, we'll be happy to help!