# get_gld_slv feeder — upload, install, upgrade

Binary product name: **`get_gld_slv`**  
Host: `https://gd.g77k.com`

| Endpoint | URL |
|----------|-----|
| API base | `https://gd.g77k.com/feeder_api.php` |
| Pretty base | `https://gd.g77k.com/api/feeder` |
| **One-line install / upgrade** | `https://gd.g77k.com/api/feeder/install` |
| This doc | `https://gd.g77k.com/api/feeder/docs` |

Auth:

- Header: `X-Api-Key: gd_YOUR_KEY`
- Or: `Authorization: Bearer gd_YOUR_KEY`
- Upload always needs a key with **upload** scope.
- Download/install needs a key only if admin enables “require key”.

Create keys in **Admin → Feeder binaries** (shown once).

Max upload: **120 MiB**.

---

## One-line install / upgrade (Linux + systemd)

```bash
# Install or upgrade latest get_gld_slv, enable auto-start
curl -sSL 'https://gd.g77k.com/api/feeder/install' | sudo bash

# If download requires an API key:
curl -sSL 'https://gd.g77k.com/api/feeder/install' | sudo GD_API_KEY=gd_YOUR_KEY bash
```

What the installer does:

1. Detects arch (`x86_64` / `aarch64`)
2. Downloads latest `get_gld_slv` for `linux` + that arch
3. Installs to `/usr/local/bin/get_gld_slv`
4. Writes `/etc/systemd/system/get_gld_slv.service` and enables it
5. On upgrade: `systemctl stop` → replace binary → `daemon-reload` → `start`

Optional env for the service (create once, survives upgrades):

```bash
sudo tee /etc/default/get_gld_slv >/dev/null <<'EOF'
# Extra args / env for get_gld_slv (edit to taste)
# RUST_LOG=info
EOF
sudo systemctl restart get_gld_slv
```

Useful commands:

```bash
sudo systemctl status get_gld_slv
sudo journalctl -u get_gld_slv -f
sudo systemctl restart get_gld_slv
```

---

## Upload (CI / LLM)

```bash
curl -X POST 'https://gd.g77k.com/api/feeder/upload' \
  -H 'X-Api-Key: gd_YOUR_KEY' \
  -F 'file=@target/release/get_gld_slv' \
  -F 'version=1.2.3' \
  -F 'platform=linux' \
  -F 'arch=x86_64' \
  -F 'name=get_gld_slv' \
  -F 'notes=CI build'
```

| Field | Required | Description |
|-------|----------|-------------|
| `file` | yes | Binary |
| `version` | yes | e.g. `1.2.3` |
| `platform` | no | default `linux` |
| `arch` | no | default `x86_64` |
| `name` | no | default `get_gld_slv` |
| `notes` | no | free text |
| `sha256` | no | optional integrity check |

Same version/platform/arch/name **overwrites** the previous file (clients re-run install to upgrade).

---

## Manifest / download

```bash
curl 'https://gd.g77k.com/api/feeder/manifest?name=get_gld_slv'

curl -L -o get_gld_slv \
  'https://gd.g77k.com/api/feeder/download?latest=1&platform=linux&arch=x86_64&name=get_gld_slv'
```

---

## Admin checklist

1. `https://gd.g77k.com/admin.php` → sign in  
2. **Feeder binaries** → create key (`upload+download`)  
3. CI uploads with `name=get_gld_slv`  
4. Hosts run: `curl -sSL 'https://gd.g77k.com/api/feeder/install' | sudo bash`  
5. Optional: require API key for download/install  
