-
Notifications
You must be signed in to change notification settings - Fork 3
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
Dual rpc provider #36
base: main
Are you sure you want to change the base?
Conversation
@@ -1,7 +1,6 @@ | |||
.DS_Store | |||
/node_modules | |||
*-lock.* | |||
*.lock | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't ignore package-lock.json
src/utils/pegRpcProviderByModulus.ts
Outdated
// - is provided by client application | ||
// - is of number type (so modulus operation won't throw) | ||
// CURRRENTLY THIS BLOCK WILL NEVER BE ENTERED | ||
if (clientIdentifier && typeof clientIdentifier === 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't a header value always be a string? We should just make client identifier any string, then hash the string and take a modulus on the hash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really didn't want the conditional to be entered until we're ready so I added the typeof
check
In the dual rpc provider paradigm,
index.ts
serves as the "router" for determining if a request should be proxied to Helius or Triton, where theheliusHandler
function provided byheliusHandler.ts
handles Helius requests andtritonHandler
function provided bytritonHandler.ts
handles Triton requests.heliusHandler
is largely identical to the previousindex.ts
file.