Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 2 #101

Open
wants to merge 112 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
6b2ed4d
Revert "Shutdown notice."
0xngmi Mar 6, 2022
6dd9534
remove multichain & add sorting by chain
0xngmi Mar 6, 2022
f3120c6
add SSR and optimize
0xngmi Mar 6, 2022
c2ab136
change favicon
0xngmi Mar 6, 2022
d063d33
move chains.js
0xngmi Mar 6, 2022
211de94
add yarn.lock
0xngmi Mar 6, 2022
83e4cca
remove unused code
0xngmi Mar 6, 2022
0f96aba
add fathom
0xngmi Mar 6, 2022
4ba7128
add testnets switch
mintdart Mar 6, 2022
d89f901
add chainlist.org domain
0xngmi Mar 7, 2022
ac9d711
add chain icons
mintdart Mar 7, 2022
b5be804
rework chain icons
0xngmi Mar 8, 2022
ea313b4
move testnet toggle to header
mintdart Mar 8, 2022
15a06d1
add rpc list url table
mintdart Mar 12, 2022
48183db
fix sorting url list by height and latency
mintdart Mar 12, 2022
7124483
add loading indicator
mintdart Mar 13, 2022
f43f870
try using axios to calc latency
mintdart Mar 14, 2022
ee04ded
add extra rpcs
0xngmi Mar 14, 2022
2cbf2f1
update rpcs
0xngmi Mar 14, 2022
d00a250
update header styles
mintdart Mar 15, 2022
5bc4549
include option to add network with different rpc urls
mintdart Mar 15, 2022
e0fdea5
cleanup
mintdart Mar 15, 2022
426c57a
show data of websocket server nodes
mintdart Mar 16, 2022
a4b3957
add trust score sto rpc urls
mintdart Mar 17, 2022
3b31001
Update index.js
0xngmi Mar 17, 2022
a6b1b75
smol fix
0xngmi Mar 18, 2022
c4a998b
update table header
mintdart Mar 18, 2022
3e1bce4
fix harmony rpcs
0xngmi Mar 18, 2022
f6886cb
Merge pull request #2 from DefiLlama/rpc-list
0xngmi Mar 18, 2022
001eaf5
remove add to wallet buttons for eth mainnet urls
mintdart Mar 18, 2022
2646662
add link to docs on how to add endpoints manually
mintdart Mar 18, 2022
49e4131
cleanup
mintdart Mar 18, 2022
91723ea
Merge pull request #4 from DefiLlama/rpc-list
mintdart Mar 18, 2022
49e5986
add new telos rpcs
realdealshaman Mar 18, 2022
42b8ce9
add link to docs
mintdart Mar 18, 2022
f1ae75c
add links to discord and addl rpc endpoints
mintdart Mar 19, 2022
fc2ea04
Add Hermes DeFi RPC (Harmony)
AustinHDev Mar 19, 2022
9a44a3b
change names to chain ID
realdealshaman Mar 23, 2022
39ab196
add compatibility with chainId changes
0xngmi Mar 27, 2022
2fa3c34
Add URL search parameter
GimluCom Mar 29, 2022
40bbbb8
Merge pull request #7 from GimluCom/patch-1
0xngmi Mar 29, 2022
7f8e723
Merge pull request #5 from Hermes-defi/hermes-dev
0xngmi Mar 29, 2022
6a54967
Update extraRpcs.json
defido Mar 30, 2022
cee93e0
Add additional public DFK Chain RPC
blockjoe Mar 30, 2022
0069b90
Merge pull request #9 from blockjoe/patch-1
0xngmi Mar 30, 2022
607e18f
Merge pull request #8 from defido/patch-1
realdealshaman Mar 30, 2022
4f913c6
Update extraRpcs.json
RichardJamesLopez Mar 31, 2022
97b94ea
add bnb48 club rpc
du5 Apr 1, 2022
bf9fd6c
Merge pull request #11 from du5/patch-1
realdealshaman Apr 6, 2022
d2b8814
Merge pull request #10 from RichardJamesLopez/patch-1
realdealshaman Apr 6, 2022
1a434a3
feat: initial bnbchainlist
randomx999 Apr 13, 2022
af36202
Merge pull request #1 from node-real/feature/bnbchainlist/devin
devinxl Apr 13, 2022
8033d71
feat: update bas info
randomx999 Apr 13, 2022
e11ef79
Merge pull request #2 from node-real/feature/bnbchainlist/devin
devinxl Apr 13, 2022
977b3a5
feat: migrate to custom server
randomx999 Apr 14, 2022
242f61d
Merge pull request #3 from node-real/feature/migrate-docker/random
devinxl Apr 14, 2022
a4c932e
feat: add s3
randomx999 Apr 15, 2022
73c4aa0
Merge pull request #4 from node-real/feature/static-cdn/devin
devinxl Apr 15, 2022
5642f23
feat: update cdn
randomx999 Apr 20, 2022
b58ab4c
Merge pull request #6 from node-real/feature/update-cdn/random
devinxl Apr 20, 2022
33ac029
fix: assetPrefix error
randomx999 Apr 20, 2022
4f293b9
Merge pull request #7 from node-real/fix/static-cache/random
devinxl Apr 20, 2022
a0e02f2
fix: background image display
randomx999 Apr 20, 2022
4693be1
Merge pull request #8 from node-real/fix/image/random
devinxl Apr 20, 2022
04693cb
fix: hack for assetPrefix
randomx999 Apr 20, 2022
338e49a
Merge pull request #9 from node-real/fix/runtimeConfigUnfined/random
devinxl Apr 20, 2022
88855be
feat: update rpc value
randomx999 Apr 21, 2022
396f8cc
Merge pull request #10 from node-real/feature/update-rpcs/random
devinxl Apr 21, 2022
cd669f4
feat: update rpc order and remove broken rpc
randomx999 Apr 21, 2022
51f8c07
Merge pull request #11 from node-real/feature/update-rpcs/random
devinxl Apr 21, 2022
5bf6261
feat: add powered by nodereal
randomx999 Apr 22, 2022
5891d22
Merge pull request #12 from node-real/feature/add-power/random
devinxl Apr 22, 2022
8f20ca9
feat: add powered by nodereal
randomx999 Apr 24, 2022
66f3b13
chore: resolve conflict
randomx999 Apr 24, 2022
f0b6147
Merge pull request #13 from node-real/feature/add-power/random
devinxl Apr 24, 2022
f6fe34c
feat: update nodereal test explorer
randomx999 Apr 29, 2022
4e1507b
Merge pull request #15 from node-real/feature/update-nodereal-sidecha…
devinxl Apr 29, 2022
681ce9a
feat: update ars rpc and faucets
randomx999 May 16, 2022
43c9f26
Merge pull request #16 from node-real/feature/update-ars/devin
devinxl May 16, 2022
bff7db2
feat: Add cube and gal sidechain and remove rerandunt field
randomx999 Jun 1, 2022
10b9b40
fix: lint
randomx999 Jun 1, 2022
024a710
feat: update cube and gal info
randomx999 Jun 2, 2022
2c2d1cb
Merge pull request #18 from node-real/feat/add_gal_cube/devin
devinxl Jun 2, 2022
ce39745
fix: change symbol length
randomx999 Jun 2, 2022
603610f
Merge pull request #19 from node-real/fix/cube/devin
devinxl Jun 2, 2022
72198ef
Update chains.json
danielimkk Jun 6, 2022
0b19656
Update chains.json
danielimkk Jun 6, 2022
da9c235
Merge pull request #20 from danielimkk/main
devinxl Jun 22, 2022
5e0f0e0
add Nodereal rpc endpoints
Jun 28, 2022
043bf87
Merge pull request #21 from huihzhao/main
devinxl Jun 29, 2022
9cfa1c4
fix: remove wss rpc address
devinxl Jun 29, 2022
1f8a34a
Merge pull request #22 from node-real/fix/remove_wss_rpc
devinxl Jun 29, 2022
3795663
feat: Update cube-bsc chainId
devinxl Aug 9, 2022
a81421f
Merge pull request #25 from node-real/feat/update-cube-chainId/devin
devinxl Aug 9, 2022
241c356
feat: Update cube-bsc configuration
devinxl Aug 9, 2022
69cebe8
Merge pull request #26 from node-real/feat/update-cube-chainId/devin
devinxl Aug 9, 2022
48ad514
feat: Update BAS-CUBE info
devinxl Sep 22, 2022
ceed698
Merge pull request #27 from node-real/feat/update-cube-info/devin
devinxl Sep 22, 2022
fa97698
feat: Update FNCY network
devinxl Nov 16, 2022
003a5fd
Merge pull request #33 from node-real/feat/add-fncy/devin
devinxl Nov 16, 2022
6984229
Update chains.json
devinxl Nov 27, 2022
df68730
Merge pull request #34 from node-real/devinxl-patch-1
devinxl Nov 28, 2022
b16cc90
Update chains.json
combo-labs Mar 29, 2023
02965dd
Update chains.json
combo-labs Mar 29, 2023
fb09e0a
Merge pull request #41 from combo-labs/main
aiden-cao Mar 31, 2023
aebb39c
feat: add combo logo
aiden-cao Mar 31, 2023
a4ceade
Merge pull request #42 from node-real/feat/add-combo-logo
aiden-cao Mar 31, 2023
6692bc3
register greenfield testnet
unclezoro Apr 4, 2023
c40e32a
Merge pull request #43 from unclebai/gnfd_testnet
aiden-cao Apr 4, 2023
640954e
add gnfd logo
unclezoro Apr 4, 2023
0edb671
Merge pull request #44 from unclebai/walt/gnfd_logo
aiden-cao Apr 4, 2023
5b39e7a
Create SECURITY.md
Ameralameri Jul 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ yarn-error.log*

# vercel
.vercel
.idea
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM node:14 as builder

ARG COMMIT_SHA
ENV COMMIT_SHA=$COMMIT_SHA

WORKDIR /opt/app

COPY . .
RUN yarn
ENV NODE_ENV production
RUN yarn build

ARG STATIC_BUCKET

RUN apt-get update && apt-get install -y awscli

RUN aws s3 cp /opt/app/.next/static s3://${STATIC_BUCKET}/static/_next/static --recursive --cache-control "private, max-age=259200" \
&& aws s3 cp /opt/app/public s3://${STATIC_BUCKET}/static --recursive --cache-control "private, max-age=259200"

FROM node:14

RUN mkdir /mnt/efs

WORKDIR /opt/app
COPY --from=builder /opt/app/.next .next
COPY --from=builder /opt/app/node_modules node_modules
COPY --from=builder /opt/app/package.json package.json
COPY --from=builder /opt/app/yarn.lock yarn.lock
COPY --from=builder /opt/app/public/connectors public/connectors

EXPOSE 3000

ENV NODE_ENV production

CMD [ "yarn", "start" ]
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
5 changes: 5 additions & 0 deletions base/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import getConfig from "next/config";

const { publicRuntimeConfig = {} } = getConfig()

export const assetPrefix = publicRuntimeConfig.assetPrefix || 'https://www.bnbchainlist.org/static';
176 changes: 176 additions & 0 deletions components/RPCList/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
import { Button, Paper } from '@material-ui/core';
import { useEffect, useMemo } from 'react';
import useRPCData from '../../hooks/useRPCData';
import { useAccount, useRpcStore } from '../../stores';
import { addToNetwork, renderProviderText } from '../../utils/utils';
import classes from './index.module.css';
import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';

export default function RPCList({ chain }) {
const chains = useRPCData(chain.rpc);
const specialChain = [];
const normalChain = [];
chains.forEach(item => {
if (item.data && item.data.url.includes('nodereal.io')) {
specialChain.push(item);
} else {
normalChain.push(item);
}
});

const data = useMemo(() => {
const sortedData = specialChain.concat(normalChain?.sort((a, b) => {
if (a.isLoading) {
return 1;
}

const h1 = a?.data?.height;
const h2 = b?.data?.height;
const l1 = a?.data?.latency;
const l2 = b?.data?.latency;

if (!h2) {
return -1;
}

if (h2 - h1 > 0) {
return 1;
}
if (h2 - h1 < 0) {
return -1;
}
if (h1 === h2) {
if (l1 - l2 < 0) {
return -1;
} else {
return 1;
}
}
}));

const topRpc = sortedData[0]?.data ?? {};

return sortedData.map(({ data, ...rest }) => {
const { height = null, latency = null, url = '' } = data || {};

let trust = 'transparent';
let disableConnect = false;

if (!height || !latency || topRpc.height - height > 3 || topRpc.latency - latency > 5000) {
trust = 'red';
} else if (topRpc.height - height < 2 && topRpc.latency - latency > -600) {
trust = 'green';
} else {
trust = 'orange';
}

if (url.includes('wss://') || url.includes('API_KEY')) disableConnect = true;

const lat = latency ? (latency / 1000).toFixed(3) + 's' : null;

return { ...rest, data: { ...data, height, latency: lat, trust, disableConnect } };
});
}, [chains]);

const darkMode = window.localStorage.getItem('yearn.finance-dark-mode') === 'dark';

const isEthMainnet = chain?.name === 'Ethereum Mainnet';

return (
<Paper elevation={1} className={classes.disclosure}>
<table
className={classes.table}
style={{ '--border-color': darkMode ? 'hsl(0deg 0% 39% / 33%)' : 'hsl(0deg 0% 17% / 4%)' }}
>
<caption>{`${chain.name} RPC URL List`}</caption>
<thead>
<tr>
<th>RPC Server Address</th>
<th>Height</th>
<th>Latency</th>
<th>Score</th>
<th></th>
</tr>
</thead>
<tbody>
{data.map((item, index) => (
<Row values={item} chain={chain} isEthMainnet={isEthMainnet} key={index} />
))}
</tbody>
</table>
{isEthMainnet && (
<p className={classes.helperText}>
Follow{' '}
<a
href="https://docs.llama.fi/chainlist/how-to-change-ethereums-rpc"
target="_blank"
rel="noopener noreferrer"
>
this
</a>{' '}
guide to change RPC endpoint's of Ethereum Mainnet
</p>
)}
</Paper>
);
}

const Shimmer = () => {
const darkMode = window.localStorage.getItem('yearn.finance-dark-mode') === 'dark';
const linearGradient = darkMode
? 'linear-gradient(90deg, rgb(255 247 247 / 7%) 0px, rgb(85 85 85 / 80%) 40px, rgb(255 247 247 / 7%) 80px)'
: 'linear-gradient(90deg, #f4f4f4 0px, rgba(229, 229, 229, 0.8) 40px, #f4f4f4 80px)';
return <div className={classes.shimmer} style={{ '--linear-gradient': linearGradient }}></div>;
};

const Row = ({ values, chain, isEthMainnet }) => {
const { data, isLoading, refetch } = values;

const rpcs = useRpcStore((state) => state.rpcs);
const addRpc = useRpcStore((state) => state.addRpc);
const account = useAccount((state) => state.account);

useEffect(() => {
// ignore first request to a url and refetch to calculate latency which doesn't include DNS lookup
if (data && !rpcs.includes(data.url)) {
refetch();
addRpc(data.url);
}
}, [data, rpcs, addRpc, refetch]);

return (
<tr>
<td>{isLoading ? <Shimmer /> : data?.url}</td>
<td>{isLoading ? <Shimmer /> : data?.height}</td>
<td>{isLoading ? <Shimmer /> : data?.latency}</td>
<td className={classes.trustScore} style={{ '--trust-color': data?.trust ?? 'transparent' }}>
{isLoading ? <Shimmer /> : <FiberManualRecordIcon />}
</td>
<td>
{isLoading ? (
<Shimmer />
) : (
<>
{isEthMainnet ? (
<CopyUrl url={data?.url} />
) : (
!data.disableConnect && (
<Button style={{ padding: '0 8px' }} onClick={() => addToNetwork(account, chain, data?.url)}>
{renderProviderText(account)}
</Button>
)
)}
</>
)}
</td>
</tr>
);
};

const CopyUrl = ({ url = '' }) => {
return (
<Button style={{ padding: '0 8px' }} onClick={() => navigator.clipboard.writeText(url)}>
Copy URL
</Button>
);
};
65 changes: 65 additions & 0 deletions components/RPCList/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.disclosure {
grid-column: 1 / -1;
position: relative;
padding: 30px;
overflow-x: auto;
}

.table {
border-collapse: collapse;
margin: 0 auto;
}

.table {
white-space: nowrap;
}

.table caption,
.table th,
.table td {
padding: 4px 12px;
border: 1px solid var(--border-color);
}

.table caption {
font-size: 1rem;
font-weight: 500;
border-bottom: 0;
}

.table th {
font-weight: 500;
}

.shimmer {
border-radius: 4px;
height: 20px;
width: 100%;
min-width: 40px;
background-image: var(--linear-gradient);
background-size: 600px;
animation: loading 2s infinite;
}

.trustScore {
text-align: center;
color: var(--trust-color);
}

.helperText {
text-align: center;
}

.helperText a {
text-decoration: underline;
}

@keyframes loading {
0% {
background-position: -100px;
}
40%,
100% {
background-position: 140px;
}
}
Loading