2024-09-25 23:00:00 +02:00
|
|
|
# PLC mirror
|
2024-04-13 21:38:58 +02:00
|
|
|
|
2024-09-25 23:00:00 +02:00
|
|
|
Syncs PLC operations log into a local table, and allows resolving `did:plc:`
|
|
|
|
DIDs without putting strain on https://plc.directory and hitting rate limits.
|
2024-04-13 21:38:58 +02:00
|
|
|
|
2024-10-26 03:53:15 +02:00
|
|
|
## Build Instructions
|
|
|
|
```bash
|
2024-10-26 03:54:30 +02:00
|
|
|
cd cmd/plc-mirror
|
|
|
|
podman build -t plc-mirror:latest .
|
2024-10-26 03:53:15 +02:00
|
|
|
```
|
|
|
|
|
2024-04-13 21:38:58 +02:00
|
|
|
## Setup
|
|
|
|
|
2024-10-26 03:59:57 +02:00
|
|
|
```bash
|
|
|
|
podman run \
|
|
|
|
-dit \
|
|
|
|
--name plc-mirror \
|
|
|
|
-p 8080:8080 -p 11004:11004 \
|
|
|
|
-e PLC_POSTGRES_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}?sslmode=disable" \
|
|
|
|
plc-mirror:latest
|
|
|
|
```
|
2024-04-13 21:38:58 +02:00
|
|
|
|
2024-09-25 23:00:00 +02:00
|
|
|
## Usage
|
2024-04-13 21:38:58 +02:00
|
|
|
|
2024-09-25 23:00:00 +02:00
|
|
|
You can directly replace `https://plc.directory` with a URL to the exposed port
|
|
|
|
(11004 by default).
|
2024-04-13 21:38:58 +02:00
|
|
|
|
2024-09-25 23:00:00 +02:00
|
|
|
Note that on the first run it will take quite a few hours to download everything,
|
|
|
|
and the mirror with respond with 500 if it's not caught up yet.
|