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

Dual rpc provider #36

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Dual rpc provider #36

wants to merge 12 commits into from

Conversation

deasydoesit
Copy link
Collaborator

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 the heliusHandler function provided by heliusHandler.ts handles Helius requests and tritonHandler function provided by tritonHandler.ts handles Triton requests. heliusHandler is largely identical to the previous index.ts file.

@@ -1,7 +1,6 @@
.DS_Store
/node_modules
*-lock.*
*.lock

Copy link
Collaborator Author

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

@deasydoesit deasydoesit requested review from abhay and ChewingGlass July 6, 2023 19:23
// - 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') {

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

Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants