Skip to content

Commit

Permalink
sender-proxy env vars config
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Oct 30, 2024
1 parent edfcd29 commit fc08d73
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 64 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ cover-html: ## Run tests with coverage and open the HTML report
unlink /tmp/go-sim-lb.cover.tmp

.PHONY: docker
docker: ## Build the HTTP server Docker image
docker:
DOCKER_BUILDKIT=1 docker build \
--platform linux/amd64 \
--build-arg VERSION=${VERSION} \
--file sender.dockerfile \
--file Dockerfile \
--tag tdx-orderflow-proxy-sender-proxy \
.

Expand Down
42 changes: 10 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,37 +83,15 @@ COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--listen-address value address to listen on for requests (default: "127.0.0.1:8080")
--builder-confighub-endpoint value address of the builder config hub enpoint (directly or throught the cvm-proxy) (default: "http://127.0.0.1:14892")
--orderflow-signer-key value ordreflow will be signed with this address (default: "0xfb5ad18432422a84514f71d63b45edf51165d33bef9c2bd60957a48d4c4cb68e")
--max-request-body-size-bytes value Maximum size of the request body, if 0 default will be used (default: 0)
--metrics-addr value address to listen on for Prometheus metrics (metrics are served on $metrics-addr/metrics) (default: "127.0.0.1:8090")
--log-json log in JSON format (default: false)
--log-debug log debug messages (default: false)
--log-uid generate a uuid and add to all log messages (default: false)
--log-service value add 'service' tag to logs (default: "tdx-orderflow-proxy-sender")
--pprof enable pprof debug endpoint (pprof is served on $metrics-addr/debug/pprof/*) (default: false)
--help, -h show help
dvush@ripper> ./build/sender-proxy -h ~/flashbots/orderflow-proxy
NAME:
sender-proxy - Serve API, and metrics
USAGE:
sender-proxy [global options] command [command options]
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--listen-address value address to listen on for requests (default: "127.0.0.1:8080")
--builder-confighub-endpoint value address of the builder config hub enpoint (directly or throught the cvm-proxy) (default: "http://127.0.0.1:14892")
--orderflow-signer-key value ordreflow will be signed with this address (default: "0xfb5ad18432422a84514f71d63b45edf51165d33bef9c2bd60957a48d4c4cb68e")
--max-request-body-size-bytes value Maximum size of the request body, if 0 default will be used (default: 0)
--metrics-addr value address to listen on for Prometheus metrics (metrics are served on $metrics-addr/metrics) (default: "127.0.0.1:8090")
--log-json log in JSON format (default: false)
--log-debug log debug messages (default: false)
--log-uid generate a uuid and add to all log messages (default: false)
--log-service value add 'service' tag to logs (default: "tdx-orderflow-proxy-sender")
--pprof enable pprof debug endpoint (pprof is served on $metrics-addr/debug/pprof/*) (default: false)
--listen-address value address to listen on for requests (default: "127.0.0.1:8080") [$LISTEN_ADDRESS]
--builder-confighub-endpoint value address of the builder config hub enpoint (directly or throught the cvm-proxy) (default: "http://127.0.0.1:14892") [$BUILDER_CONFIGHUB_ENDPOINT]
--orderflow-signer-key value ordreflow will be signed with this address (default: "0xfb5ad18432422a84514f71d63b45edf51165d33bef9c2bd60957a48d4c4cb68e") [$ORDERFLOW_SIGNER_KEY]
--max-request-body-size-bytes value Maximum size of the request body, if 0 default will be used (default: 0) [$MAX_REQUEST_BODY_SIZE_BYTES]
--metrics-addr value address to listen on for Prometheus metrics (metrics are served on $metrics-addr/metrics) (default: "127.0.0.1:8090") [$METRICS_ADDR]
--log-json log in JSON format (default: false) [$LOG_JSON]
--log-debug log debug messages (default: false) [$LOG_DEBUG]
--log-uid generate a uuid and add to all log messages (default: false) [$LOG_UID]
--log-service value add 'service' tag to logs (default: "tdx-orderflow-proxy-sender") [$LOG_SERVICE]
--pprof enable pprof debug endpoint (pprof is served on $metrics-addr/debug/pprof/*) (default: false) [$PPROF]
--help, -h show help
```
70 changes: 40 additions & 30 deletions cmd/sender-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,66 @@ import (
var flags []cli.Flag = []cli.Flag{
// input and output
&cli.StringFlag{
Name: "listen-address",
Value: "127.0.0.1:8080",
Usage: "address to listen on for requests",
Name: "listen-address",
Value: "127.0.0.1:8080",
Usage: "address to listen on for requests",
EnvVars: []string{"LISTEN_ADDRESS"},
},
&cli.StringFlag{
Name: "builder-confighub-endpoint",
Value: "http://127.0.0.1:14892",
Usage: "address of the builder config hub enpoint (directly or throught the cvm-proxy)",
Name: "builder-confighub-endpoint",
Value: "http://127.0.0.1:14892",
Usage: "address of the builder config hub enpoint (directly or throught the cvm-proxy)",
EnvVars: []string{"BUILDER_CONFIGHUB_ENDPOINT"},
},
&cli.StringFlag{
Name: "orderflow-signer-key",
Value: "0xfb5ad18432422a84514f71d63b45edf51165d33bef9c2bd60957a48d4c4cb68e",
Usage: "ordreflow will be signed with this address",
Name: "orderflow-signer-key",
Value: "0xfb5ad18432422a84514f71d63b45edf51165d33bef9c2bd60957a48d4c4cb68e",
Usage: "ordreflow will be signed with this address",
EnvVars: []string{"ORDERFLOW_SIGNER_KEY"},
},
&cli.Int64Flag{
Name: "max-request-body-size-bytes",
Value: 0,
Usage: "Maximum size of the request body, if 0 default will be used",
Name: "max-request-body-size-bytes",
Value: 0,
Usage: "Maximum size of the request body, if 0 default will be used",
EnvVars: []string{"MAX_REQUEST_BODY_SIZE_BYTES"},
},

// logging, metrics and debug
&cli.StringFlag{
Name: "metrics-addr",
Value: "127.0.0.1:8090",
Usage: "address to listen on for Prometheus metrics (metrics are served on $metrics-addr/metrics)",
Name: "metrics-addr",
Value: "127.0.0.1:8090",
Usage: "address to listen on for Prometheus metrics (metrics are served on $metrics-addr/metrics)",
EnvVars: []string{"METRICS_ADDR"},
},
&cli.BoolFlag{
Name: "log-json",
Value: false,
Usage: "log in JSON format",
Name: "log-json",
Value: false,
Usage: "log in JSON format",
EnvVars: []string{"LOG_JSON"},
},
&cli.BoolFlag{
Name: "log-debug",
Value: false,
Usage: "log debug messages",
Name: "log-debug",
Value: false,
Usage: "log debug messages",
EnvVars: []string{"LOG_DEBUG"},
},
&cli.BoolFlag{
Name: "log-uid",
Value: false,
Usage: "generate a uuid and add to all log messages",
Name: "log-uid",
Value: false,
Usage: "generate a uuid and add to all log messages",
EnvVars: []string{"LOG_UID"},
},
&cli.StringFlag{
Name: "log-service",
Value: "tdx-orderflow-proxy-sender",
Usage: "add 'service' tag to logs",
Name: "log-service",
Value: "tdx-orderflow-proxy-sender",
Usage: "add 'service' tag to logs",
EnvVars: []string{"LOG_SERVICE"},
},
&cli.BoolFlag{
Name: "pprof",
Value: false,
Usage: "enable pprof debug endpoint (pprof is served on $metrics-addr/debug/pprof/*)",
Name: "pprof",
Value: false,
Usage: "enable pprof debug endpoint (pprof is served on $metrics-addr/debug/pprof/*)",
EnvVars: []string{"PPROF"},
},
}

Expand Down

0 comments on commit fc08d73

Please sign in to comment.