Skip to content

Commit

Permalink
seperate quicknode geth vs. reth metrics via different provider naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Jul 15, 2024
1 parent 68282c3 commit 2badfec
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/handlers/evm/provider/ProviderName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export enum ProviderName {
INFURA = 'INFURA',
QUIKNODE = 'QUIKNODE', // quicknode doesn't have letter c in the RPC endpoint
QUIKNODE_GETH = 'QUIKNODE_GETH',
QUIKNODE_RETH = 'QUIKNODE_RETH',
FORNO = 'FORNO',
ALCHEMY = 'ALCHEMY',
NIRVANA = 'NIRVANA',
Expand All @@ -10,7 +12,17 @@ export enum ProviderName {
export function deriveProviderName(url: string): ProviderName {
for (const name in ProviderName) {
if (url.toUpperCase().includes(name)) {
return ProviderName[name as keyof typeof ProviderName]
if (url.toUpperCase().includes(ProviderName.QUIKNODE)) {
if (url.toLowerCase().includes('solitary')) {
return ProviderName.QUIKNODE_GETH
} else if (url.toLowerCase().includes('ancient')) {
return ProviderName.QUIKNODE_RETH
} else {
return ProviderName.QUIKNODE
}
} else {
return ProviderName[name as keyof typeof ProviderName]
}
}
}

Expand Down

0 comments on commit 2badfec

Please sign in to comment.