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

feat: rpc_headers in cast and config #9429

Merged
merged 8 commits into from
Nov 29, 2024
Merged

Conversation

yash-atreya
Copy link
Member

Motivation

Closes #9422

Solution

  • Add rpc_headers to Config
  • Add --headers flag to RpcOpts

Usage:

cast rpc "eth_blockNumber" --rpc-url --headers "Authorization:Bearer 0xtoken, custom:value"

Users can also set the ETH_RPC_HEADERS environment variable to avoid specifying headers on every cast call.

@yash-atreya yash-atreya changed the title Yash/headers rpc opt feat: rpc_headers in cast and config Nov 28, 2024
@yash-atreya yash-atreya enabled auto-merge (squash) November 28, 2024 14:17
@zerosnacks zerosnacks self-requested a review November 29, 2024 08:51
@yash-atreya yash-atreya merged commit af0fee2 into master Nov 29, 2024
22 checks passed
@yash-atreya yash-atreya deleted the yash/headers-rpc-opt branch November 29, 2024 13:09
rplusq pushed a commit to rplusq/foundry that referenced this pull request Nov 29, 2024
* feat: specify `rpc_headers` in cast and config

* test
@yash-atreya yash-atreya self-assigned this Dec 2, 2024
@grandizzy grandizzy added T-feature Type: feature C-cast Command: cast labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-feature Type: feature
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

feat(cast): add ability to specify request headers
4 participants