-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f708999
commit a8b89d4
Showing
11 changed files
with
211 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client' | ||
|
||
import React, { FC, ReactElement } from 'react'; | ||
import { QueryClient, QueryClientProvider } from 'react-query'; | ||
import { RecoilRoot } from 'recoil'; | ||
import 'react-tooltip/dist/react-tooltip.css' | ||
import 'react-toastify/dist/ReactToastify.min.css' | ||
import 'rodal/lib/rodal.css' | ||
|
||
const queryClient = new QueryClient() | ||
|
||
export interface ProviderProps { | ||
children: ReactElement | ReactElement[] | ||
} | ||
|
||
const Providers:FC<ProviderProps> = ({children}) => { | ||
return ( | ||
<RecoilRoot> | ||
<QueryClientProvider client={queryClient}> | ||
{children} | ||
</QueryClientProvider> | ||
</RecoilRoot> | ||
) | ||
} | ||
|
||
export default Providers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
|
||
import React, { FC } from 'react'; | ||
import Main, { InitProps } from './Main'; | ||
import Providers from './Providers'; | ||
import '../src/i18n' | ||
|
||
const Wrapper:FC<InitProps> = (props) => { | ||
return ( | ||
<Providers> | ||
<Main {...props}/> | ||
</Providers> | ||
) | ||
} | ||
|
||
export default Wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { NextFetchRequestInit } from '../../src/types'; | ||
import fetchFromApi from '../../utilities/fetchFromApi'; | ||
|
||
const validatorUrl = process.env.VALIDATOR_URL; | ||
const beaconUrl = process.env.BEACON_URL; | ||
const apiToken = process.env.API_TOKEN; | ||
|
||
export const fetchVersion = async () => { | ||
const response = await fetch(`${validatorUrl}/lighthouse/version`, { | ||
method: 'GET', | ||
headers: { | ||
'Authorization': `Bearer ${apiToken}`, | ||
} | ||
} as NextFetchRequestInit); | ||
|
||
if (!response.ok) { | ||
throw new Error(`HTTP error! status: ${response.status}`); | ||
} | ||
|
||
return await response.json(); | ||
} | ||
|
||
export const fetchBeaconNodeVersion = async () => await fetchFromApi(`${beaconUrl}/eth/v1/node/version`) | ||
export const fetchValidatorAuthKey = async () => await fetchFromApi(`${validatorUrl}/lighthouse/auth`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { Metadata } from 'next' | ||
|
||
export const metadata: Metadata = { | ||
title: 'Siren', | ||
description: 'User interface built for Lighthouse that connects to a Lighthouse Beacon Node and a Lighthouse Validator Client to monitor performance and display key validator metrics.', | ||
} | ||
|
||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
<div id="root">{children}</div> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { fetchBeaconNodeVersion, fetchValidatorAuthKey } from './api/config'; | ||
import Wrapper from './Wrapper'; | ||
import '../src/global.css' | ||
|
||
export default async function Page() { | ||
const version = await fetchBeaconNodeVersion() | ||
const apiKey = await fetchValidatorAuthKey() | ||
|
||
return ( | ||
<Wrapper apiTokenPath={apiKey?.token_path} beaconNodeVersion={version?.data?.version}/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters