Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,24 @@ GECKOTERMINAL_BASE_URL=http://pricing-proxy:8080/geckoterminal
# observes when the same chat receives alerts from several chains. Leave
# unset on single-chain stacks. Free-form value, rendered upper-cased.
# CHAIN=Mainnet

# Minter-guard auto-deny watcher.
#
# When enabled, the watcher iterates PROPOSED minters at the end of every
# monitoring cycle and submits denyMinter() for any address not on the
# committed whitelist (src/monitoringV2/config/whitelist.{testnet,mainnet}.json).
# Bridge proposals are not exempted: the bridge type is inferred from a trivial
# usd() view call and is therefore unsafe to exclude.
#
# GUARD_ENABLED true/false. Disables the watcher entirely if false.
# GUARD_PRIVATE_KEY Hex private key (0x...) of the signer. Must hold or be
# delegated enough voting power to pass checkQualified()
# on the JUSD reserve.
# GUARD_HELPER_ADDRESS Address passed as the single helper to denyMinter().
# Use the equity holder that delegated to the signer.
# GUARD_WHITELIST_FILE Absolute path to the whitelist JSON inside the
# container (e.g. /app/src/monitoringV2/config/whitelist.mainnet.json).
# GUARD_ENABLED=false
# GUARD_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000
# GUARD_HELPER_ADDRESS=0x0000000000000000000000000000000000000000
# GUARD_WHITELIST_FILE=/app/src/monitoringV2/config/whitelist.mainnet.json
8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM node:lts-alpine

# bw CLI is used by entrypoint.sh to fetch GUARD_PRIVATE_KEY from Vaultwarden at container start.
# Installed as root before switching user so the global npm prefix is writable.
RUN apk add --no-cache bash && npm install -g @bitwarden/cli@2024.9.0

RUN mkdir /app && chown -R node:node /app
WORKDIR /app
USER node
Expand All @@ -17,11 +13,7 @@ COPY --chown=node . .
RUN npm run prisma:generate
RUN npm run build

# Entrypoint optionally fetches GUARD_PRIVATE_KEY from Vaultwarden, then execs npm.
COPY --chown=node --chmod=0755 entrypoint.sh /app/entrypoint.sh

# Expose port
EXPOSE 3001

ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["npm", "run", "start:migrate"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The monitoring service continuously syncs blockchain data to provide real-time i
- Collateral aggregation by token type
4. **Token Prices**: Fetches real-time prices from GeckoTerminal API with caching
5. **API Endpoints**: Serves data via REST API for frontend consumption
6. **Minter Guard**: Optional auto-deny watcher (opt-in via `GUARD_ENABLED=true`). At the end of every monitoring cycle it submits `denyMinter()` for any `PROPOSED` minter not on a committed whitelist (`src/monitoringV2/config/whitelist.{testnet,mainnet}.json`). Requires `GUARD_PRIVATE_KEY` and `GUARD_HELPER_ADDRESS`. See `.env.example`.

## Tech Stack

Expand Down
62 changes: 0 additions & 62 deletions entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/monitoringV2/config/whitelist.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_comment": "Whitelist of approved generic minters (lowercase addresses). Empty = deny any new minter proposal. Bridges are never auto-denied (different type). Update via PR and redeploy.",
"_comment": "Whitelist of approved minter addresses (lowercase). Empty = deny any new minter proposal, including bridges (bridge type is inferred from a trivial usd() view call and is therefore unsafe to exempt). Add legitimate proposals here via PR + redeploy before they pass the application period.",
"minters": []
}
2 changes: 1 addition & 1 deletion src/monitoringV2/config/whitelist.testnet.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_comment": "Whitelist of approved generic minters (lowercase addresses). Empty = deny any new minter proposal. Bridges are never auto-denied (different type). Update via PR and redeploy.",
"_comment": "Whitelist of approved minter addresses (lowercase). Empty = deny any new minter proposal, including bridges (bridge type is inferred from a trivial usd() view call and is therefore unsafe to exempt). Add legitimate proposals here via PR + redeploy before they pass the application period.",
"minters": []
}
Loading