Allow custom headers in validator client HTTP requests (#15884)

* Allow custom headers in validator client HTTP requests

* changelog <3

* improve flag description

* Bastin's review

* James' review

* add godoc for NodeConnectionOption
This commit is contained in:
Radosław Kapka
2025-10-22 15:47:35 +02:00
committed by GitHub
parent 3ecb5d0b67
commit 2f090c52d9
15 changed files with 160 additions and 9 deletions

View File

@@ -45,6 +45,13 @@ var (
Usage: "Beacon node REST API provider endpoint.",
Value: "http://127.0.0.1:3500",
}
// BeaconRESTApiHeaders defines a list of headers to send with all HTTP requests to the beacon node.
BeaconRESTApiHeaders = &cli.StringFlag{
Name: "beacon-rest-api-headers",
Usage: `Comma-separated list of key value pairs to pass as headers for all HTTP calls to the beacon node.
To provide multiple values for the same key, specify the same key for each value.
Example: --grpc-headers=key1=value1,key1=value2,key2=value3`,
}
// CertFlag defines a flag for the node's TLS certificate.
CertFlag = &cli.StringFlag{
Name: "tls-cert",

View File

@@ -51,6 +51,7 @@ func startNode(ctx *cli.Context) error {
var appFlags = []cli.Flag{
flags.BeaconRPCProviderFlag,
flags.BeaconRESTApiProviderFlag,
flags.BeaconRESTApiHeaders,
flags.CertFlag,
flags.GraffitiFlag,
flags.DisablePenaltyRewardLogFlag,

View File

@@ -93,6 +93,7 @@ var appHelpFlagGroups = []flagGroup{
Flags: []cli.Flag{
flags.CertFlag,
flags.BeaconRPCProviderFlag,
flags.BeaconRESTApiHeaders,
flags.EnableRPCFlag,
flags.RPCHost,
flags.RPCPort,