import MuiAlert from '@material-ui/lab/Alert' import { ReactElement, useContext } from 'react' import CodeBlockTabs from '../../../components/CodeBlockTabs' import ExpandableList from '../../../components/ExpandableList' import ExpandableListItem from '../../../components/ExpandableListItem' import ExpandableListItemInput from '../../../components/ExpandableListItemInput' import ExpandableListItemNote from '../../../components/ExpandableListItemNote' import StatusIcon from '../../../components/StatusIcon' import { CheckState, Context } from '../../../providers/Bee' import { Context as SettingsContext } from '../../../providers/Settings' export default function NodeConnectionCheck(): ReactElement | null { const { status, isLoading } = useContext(Context) const { setDebugApiUrl, apiDebugUrl, isDesktop } = useContext(SettingsContext) const { checkState, isEnabled } = status.debugApiConnection if (!isEnabled) return null return ( Connection to Bee Debug API } > {checkState === CheckState.OK ? 'The connection to the Bee node debug API has been successful' : 'Could not connect to your Bee node debug API.'} {checkState === CheckState.ERROR && !isDesktop && (
  • Check the status of your node by running the below command to see if your node is running.
  • If your node is running, check your firewall settings to make sure that port 1635 (or your custom specified port) is bound to localhost. If your node is not running try executing the below command to start your bee node
  • Your debug node API should never be completely open to the internet. If you want to connect remotely, make sure your firewall settings are set to only allow specific trusted IP addresses and block all other ports. A simple google search for "what is my ip" will show you your computers public IP address to allow.
  • Run the commands to validate your node is running and see the log output.
  • Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter{' '} debug-api-enable must be set to true and{' '} cors-allowed-origins must be set to your host domain or IP (you can also use the wildcard {"cors-allowed-origins: ['*']"}). If edits are made to the configuration run the restart command below for changes to take effect.
  • } />
    )}
    ) }