-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support query parameters and HTTP headers for API requests #186
Comments
Hi @cam-schultz , please assign it to me. The values provided by the new fields need to be passed to every requests right? |
Hey @najeal, thanks for offering to take a look at this. @minghinmatthewlam is going to take an initial pass at this to support query parameters for Please feel free to open a PR with any further proposed changes. To close this ticket out, we'll also need to support HTTP headers provided via configuration.
For the Info API and P-Chain API calls, this is correct. The subnet RPC API takes a raw URL, so query parameters are directly supported. Further investigation needs to be done for supporting HTTP headers for subnet RPC calls. |
@cam-schultz thank for the answer. |
@najeal, yes that would be great. Appreciate your patience on this 🙏 |
Context and scope
The relayer makes RPC requests to a handful of Avalanche APIs via the Golang clients. Specifically, the relayer uses:
These clients support HTTP headers and query parameters in the form of the optional
rpc.Option
parameters to each of their method calls.We should add
query-parameters
andhttp-headers
fields to the top-level config to support these options. This would allow us to provide a rate limit bypass token, for example.The relayer also uses ethclient.Client, which supports query parameters in the form of a fully specified URL. HTTP headers are supported via
rpc.Client.SetHeader
. It might make sense to add aquery-parameters
field to thesource-subnets
anddestination-subnets
lists for consistency.The text was updated successfully, but these errors were encountered: