Skip to content

Commit 71dd8a0

Browse files
fix(ops): resolve nginx config crash on frontend start and simulate tokenomics for dashboards
1 parent 51b0b66 commit 71dd8a0

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Dockerfile.frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM nginx:stable-alpine
1313
RUN apk add --no-cache curl
1414

1515
COPY --from=build /app/dist /usr/share/nginx/html
16-
COPY nginx.conf /etc/nginx/conf.d/default.conf
16+
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
1717

1818
EXPOSE 80
1919
CMD ["nginx", "-g", "daemon off;"]

tokenomics_metrics_exporter.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,40 @@ def generate_metrics(self) -> bytes:
292292
return generate_latest(self.registry)
293293

294294

295+
def run_simulation(exporter):
296+
import time, random
297+
298+
last_escrow = 85000450
299+
last_wallets = 8540
300+
last_balance = 14630
301+
while True:
302+
last_escrow += random.randint(-50000, 100000)
303+
last_wallets += random.randint(0, 5)
304+
last_balance += random.randint(-10, 15)
305+
payload = {
306+
"mint_rate_per_min": random.uniform(140.0, 160.0),
307+
"token_supply_total": 1000000000,
308+
"token_supply_minted": 125000000 + random.randint(1000, 5000),
309+
"bridge_inflow_per_min": random.uniform(400.0, 500.0),
310+
"bridge_outflow_per_min": random.uniform(250.0, 350.0),
311+
"bridge_escrow_total": last_escrow,
312+
"bridge_collateral_ratio_percent": random.uniform(150.0, 160.0),
313+
"unique_wallets_count": last_wallets,
314+
"wallet_average_balance": last_balance,
315+
"top_10_holder_concentration_percent": 12.4,
316+
"wallet_liquidity_ratio_percent": random.uniform(34.0, 35.0),
317+
}
318+
exporter.ingest_event(payload)
319+
time.sleep(10)
320+
321+
295322
def create_app(source_file: str):
296323
app = Flask(__name__)
297324
exporter = TokenomicsMetricsExporter(source_file=source_file)
325+
import threading
326+
327+
t = threading.Thread(target=run_simulation, args=(exporter,), daemon=True)
328+
t.start()
298329

299330
@app.route("/metrics", methods=["GET"])
300331
def metrics():

0 commit comments

Comments
 (0)