Skip to content

Commit 1d489d4

Browse files
committed
Expand payjoin-service README
1 parent 6fce76d commit 1d489d4

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

payjoin-service/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,52 @@
33
Unified Payjoin Directory and OHTTP Relay service. Combines [payjoin-directory](../payjoin-directory/README.md) and [ohttp-relay](../ohttp-relay/README.md) into a single binary.
44

55
Note that this binary is under active development and thus the CLI and configuration file may be unstable.
6+
7+
## Configuration
8+
9+
payjoin-service reads configuration from `config.toml` (or the path given with `--config`). Every setting can also be supplied via environment variables prefixed with `PJ_`, using double underscores for nesting (e.g., `PJ_TELEMETRY__ENDPOINT`).
10+
11+
## Running the service
12+
13+
### Cargo
14+
15+
```sh
16+
cargo run
17+
```
18+
19+
### Docker Compose
20+
21+
A simple [docker-compose.yml](docker-compose.yml) is provided for convenience.
22+
23+
```sh
24+
docker compose up
25+
```
26+
27+
### Nix
28+
29+
The rust-payjoin flake also provides `payjoin-service` as a package.
30+
31+
```sh
32+
nix run .#payjoin-service -- --config payjoin-service/config.toml
33+
```
34+
35+
## Telemetry
36+
37+
payjoin-service supports **optional** OpenTelemetry-based telemetry (metrics, traces, and logs). Build with `--features telemetry` and add a `[telemetry]` section to your config:
38+
39+
```toml
40+
[telemetry]
41+
endpoint = "https://otlp-gateway-prod-us-west-0.grafana.net/otlp"
42+
auth_token = "<base64 instanceID:token>"
43+
operator_domain = "your-domain.example.com"
44+
```
45+
46+
Or set the equivalent environment variables:
47+
48+
```sh
49+
export PJ_TELEMETRY__ENDPOINT="https://otlp-gateway-prod-us-west-0.grafana.net/otlp"
50+
export PJ_TELEMETRY__AUTH_TOKEN="<base64 instanceID:token>"
51+
export PJ_TELEMETRY__OPERATOR_DOMAIN="your-domain.example.com"
52+
```
53+
54+
When no `[telemetry]` section is present and no `PJ_TELEMETRY__*` variables are set, the service uses local-only console tracing.

0 commit comments

Comments
 (0)