import type { ReactElement } from 'react' import { Typography, Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core/' import MuiAlert from '@material-ui/lab/Alert' import { ExpandMoreSharp } from '@material-ui/icons/' import ConnectToHost from '../../../components/ConnectToHost' import CodeBlockTabs from '../../../components/CodeBlockTabs' import { debugApiHost } from '../../../constants' type Props = StatusHookCommon export default function NodeConnectionCheck({ isLoading, isOk }: Props): ReactElement | null { if (isLoading) return null const changeDebugApiUrl = (
Debug API ({debugApiHost})
) if (isOk) { return changeDebugApiUrl } return (
{changeDebugApiUrl}
We cannot connect to your nodes debug API at {debugApiHost}. Please check the following to troubleshoot your issue. } aria-controls="panel1a-content" id="panel1a-header"> Troubleshoot
  1. Check the status of your node by running the below command to see if your node is running.
  2. 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
  3. 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.
  4. Run the commands to validate your node is running and see the log output.
  5. 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. If edits are made to the configuration run the restart command below for changes to take effect.
) }