Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoPittella committed Dec 6, 2024
1 parent d0d3fcc commit f7f98b7
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions bin/tx-prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,6 @@ miden-tx-prover start-worker --host 0.0.0.0 --port 8082

This will spawn a worker using the hosts and ports defined in the command options. In case that one of the values is not present, it will default to `0.0.0.0` for the host and `50051` for the port.

### Health check

Along with the worker service, a health check service is also spawned using the host and port defined in the command options, it will default to `0.0.0.0` for the host and `50052` for the port. It listens for requests in the `/health` path and returns a `200 OK` status code if the worker is running.

Example of starting the worker service with a health check service running:

```bash
# Starts the worker service with a health check service running in the host 127.0.0.1 and port 8083
miden-tx-prover start-worker --health-check-host 127.0.0.1 --health-check-port 8083
```

And to check if the worker is running, you can run:

```bash
curl http://127.0.0.1:8083/health
```

This will return a `200 OK` status code if the worker is running.

## Proxy

First, you need to create a configuration file for the proxy with:
Expand All @@ -78,6 +59,8 @@ max_queue_items = 10
max_retries_per_request = 1
# Maximum amount of requests that a given IP address can make per second
max_req_per_sec = 5
# Interval to check the health of the workers
health_check_interval_secs = 1

[[workers]]
host = "0.0.0.0"
Expand Down Expand Up @@ -121,6 +104,12 @@ This changes will be persisted to the configuration file.

Note that, in order to update the workers, the proxy must be running in the same computer as the command is being executed because it will check if the client address is localhost to avoid any security issues.

### Health check

The worker service implements the [gRPC Health Check](https://grpc.io/docs/guides/health-checking/) standard, and includes the methods described in this [official proto file](https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto).

The proxy service uses this health check to determine if a worker is available to receive requests. If a worker is not available, it will be removed from the set of workers that the proxy can use to send requests, and will persist this change in the configuration file.

## Logging

Both the worker and the proxy will use the `info` log level by default, but it can be changed by setting the `RUST_LOG` environment variable.
Expand Down

0 comments on commit f7f98b7

Please sign in to comment.