feat: make blockchain JSON RPC configurable from settings (#494)

* feat: make blockchain JSON RPC configurable from settings

* chore: expose the settings directly

* feat: restart bee node when blockchain RPC changes, add notification and error logging
This commit is contained in:
Vojtech Simetka
2022-07-27 08:45:03 +02:00
committed by GitHub
parent f82444f212
commit 408b565935
10 changed files with 126 additions and 78 deletions
+1 -3
View File
@@ -18,7 +18,6 @@ import { Token } from '../models/Token'
import type { Balance, ChequebookBalance, Settlements } from '../types'
import { WalletAddress } from '../utils/wallet'
import { Context as SettingsContext } from './Settings'
import { Context as TopUpContext } from './TopUp'
const REFRESH_WHEN_OK = 30_000
const REFRESH_WHEN_ERROR = 5_000
@@ -192,8 +191,7 @@ function getStatus(
let isRefreshing = false
export function Provider({ children }: Props): ReactElement {
const { beeApi, beeDebugApi } = useContext(SettingsContext)
const { provider } = useContext(TopUpContext)
const { beeApi, beeDebugApi, provider } = useContext(SettingsContext)
const [apiHealth, setApiHealth] = useState<boolean>(false)
const [debugApiHealth, setDebugApiHealth] = useState<Health | null>(null)
const [nodeAddresses, setNodeAddresses] = useState<NodeAddresses | null>(null)