From d3ccbb2145bf5c394ec45a86194626291ef9e43f Mon Sep 17 00:00:00 2001 From: defiQUG Date: Mon, 1 Jun 2026 22:26:06 -0700 Subject: [PATCH] Co-authored-by: --- docs/FIXES_TESTING_AND_DEPLOYMENT_TASKS.md | 2 +- docs/MASTER_DOCUMENTATION_INDEX.md | 2 +- docs/deployment/DEPLOYMENT_COMPLETE_STATUS_FINAL.md | 2 +- docs/deployment/DETAILED_TASK_LIST_COMPREHENSIVE.md | 4 ++-- docs/deployment/GAP_ANALYSIS_COMPREHENSIVE.md | 2 +- docs/deployment/LINK_TOKEN_VERIFICATION_COMPLETE.md | 2 +- docs/deployment/PHASE4_POST_DEPLOYMENT_TESTING.md | 4 ++-- docs/deployment/TASK5_TOKEN_LIST_HOSTING.md | 4 ++-- docs/deployment/TASK_COMPLETION_REPORT.md | 4 ++-- scripts/deploy-ccip-receiver-direct.sh | 2 +- services/token-aggregation/DEPLOYMENT_COMPLETE.md | 4 ++-- services/token-aggregation/FINAL_STATUS.md | 4 ++-- services/token-aggregation/IMPLEMENTATION_COMPLETE.md | 4 ++-- services/token-aggregation/IMPLEMENTATION_STATUS.md | 4 ++-- services/token-aggregation/PROXMOX_DEPLOYMENT.md | 4 ++-- services/token-aggregation/QUICK_START.md | 2 +- services/token-aggregation/QUICK_START_COMPLETE.md | 4 ++-- services/token-aggregation/README.md | 4 ++-- services/token-aggregation/README_CONTROL_PANEL.md | 4 ++-- services/token-aggregation/docs/DEPLOYMENT.md | 2 +- services/token-aggregation/scripts/complete-setup.sh | 2 +- services/token-aggregation/scripts/run-migrations.sh | 2 +- services/token-aggregation/scripts/setup.sh | 2 +- services/token-aggregation/src/api/routes/config.ts | 10 +++------- 24 files changed, 38 insertions(+), 42 deletions(-) diff --git a/docs/FIXES_TESTING_AND_DEPLOYMENT_TASKS.md b/docs/FIXES_TESTING_AND_DEPLOYMENT_TASKS.md index 01b86ee..12eeb8e 100644 --- a/docs/FIXES_TESTING_AND_DEPLOYMENT_TASKS.md +++ b/docs/FIXES_TESTING_AND_DEPLOYMENT_TASKS.md @@ -37,7 +37,7 @@ Single checklist for **fixes**, **testing**, and **deployment** (required and op |------|-------------| | Restore DODOPMMIntegration.t.sol test | **DONE.** Test restored; fixed `vm.mockCall(dvm, bytes(""), ...)` and removed redundant grantRole. | | Restore MultiChainBridge.t.sol | **DONE.** Restored; MockCCIPRouter, cancel-bridge flow, XDC convertXdcToEth fix, XRPL recipientData; 8/8 tests pass. | -| WETH9 decimals display | **Documented:** WETH9 `decimals()` returns 0 on-chain, so MetaMask can show e.g. "6,000,000,000.0T WETH" instead of "6 WETH". Workaround: use token list with decimals 18 (e.g. `metamask-integration/docs/METAMASK_TOKEN_LIST.json`) or manual token import with decimals 18. Host token list for auto-discovery. See [PHASE4_POST_DEPLOYMENT_TESTING.md](deployment/PHASE4_POST_DEPLOYMENT_TESTING.md) §4.3. | +| WETH9 decimals display | **Documented:** WETH9 `decimals()` returns 0 on-chain, so MetaMask can show e.g. "6,000,000,000.0T WETH" instead of "6 WETH". Workaround: use token list with decimals 18 (e.g. `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json`) or manual token import with decimals 18. Host token list for auto-discovery. See [PHASE4_POST_DEPLOYMENT_TESTING.md](deployment/PHASE4_POST_DEPLOYMENT_TESTING.md) §4.3. | --- diff --git a/docs/MASTER_DOCUMENTATION_INDEX.md b/docs/MASTER_DOCUMENTATION_INDEX.md index 253edaa..8b1914f 100644 --- a/docs/MASTER_DOCUMENTATION_INDEX.md +++ b/docs/MASTER_DOCUMENTATION_INDEX.md @@ -101,7 +101,7 @@ This is the **master index** of all project documentation. Use this as your star - **[METAMASK_BD.md](operations/integrations/METAMASK_BD.md)** - MetaMask integration details - **[Crypto.com OTC Integration](../../dbis_core/src/core/exchange/crypto-com-otc/README.md)** - Crypto.com OTC 2.0 API for institutional trading (DBIS Core) - **[Exchange Registry](../../dbis_core/src/core/exchange/)** - Multi-exchange price API (Binance, Kraken, Oanda, FXCM) -- **[Ramp API](../../metamask-integration/src/ramps/)** - Fiat on/off-ramp session API (MoonPay, Ramp, Onramper, etc.) +- **[Ramp API](~/projects/metamask-integration/src/ramps/)** - Fiat on/off-ramp session API (MoonPay, Ramp, Onramper, etc.) - **[DeFi Router](../../alltra-lifi-settlement/src/payments/)** - 1inch, ParaSwap, 0x DEX aggregator --- diff --git a/docs/deployment/DEPLOYMENT_COMPLETE_STATUS_FINAL.md b/docs/deployment/DEPLOYMENT_COMPLETE_STATUS_FINAL.md index 03b4987..298458c 100644 --- a/docs/deployment/DEPLOYMENT_COMPLETE_STATUS_FINAL.md +++ b/docs/deployment/DEPLOYMENT_COMPLETE_STATUS_FINAL.md @@ -105,7 +105,7 @@ All deployed contracts use the same admin address, providing consistent access c **Solution**: Host token list publicly for automatic discovery. -**Token List**: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` contains correct decimals. +**Token List**: `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` contains correct decimals. ### 2. ChainID 138 RPC Access diff --git a/docs/deployment/DETAILED_TASK_LIST_COMPREHENSIVE.md b/docs/deployment/DETAILED_TASK_LIST_COMPREHENSIVE.md index f494525..2f85de3 100644 --- a/docs/deployment/DETAILED_TASK_LIST_COMPREHENSIVE.md +++ b/docs/deployment/DETAILED_TASK_LIST_COMPREHENSIVE.md @@ -177,7 +177,7 @@ 9. Test multiple destinations (if configured) 10. Document test results -**Test Script Available**: `explorer-monorepo/scripts/test-end-to-end-bridge.sh` +**Test Script Available**: `~/projects/explorer-monorepo/scripts/test-end-to-end-bridge.sh` **Dependencies**: ChainID 138 RPC access, Mainnet RPC access, funded wallets **Output**: Cross-chain test report @@ -195,7 +195,7 @@ **Description**: Host MetaMask token list publicly for automatic token discovery. **Steps**: -1. Review token list: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` +1. Review token list: `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` 2. Validate token list format and contents 3. Choose hosting option: - Option A: GitHub Pages (free, easy) diff --git a/docs/deployment/GAP_ANALYSIS_COMPREHENSIVE.md b/docs/deployment/GAP_ANALYSIS_COMPREHENSIVE.md index 06a02ab..0a94233 100644 --- a/docs/deployment/GAP_ANALYSIS_COMPREHENSIVE.md +++ b/docs/deployment/GAP_ANALYSIS_COMPREHENSIVE.md @@ -101,7 +101,7 @@ forge verify-contract --chain-id 1 \ **Status**: ⚠️ **BLOCKS AUTOMATIC WALLET INTEGRATION** -**Gap**: Token list exists (`metamask-integration/docs/METAMASK_TOKEN_LIST.json`) but not hosted publicly. +**Gap**: Token list exists (`~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json`) but not hosted publicly. **Impact**: - MetaMask cannot automatically discover tokens diff --git a/docs/deployment/LINK_TOKEN_VERIFICATION_COMPLETE.md b/docs/deployment/LINK_TOKEN_VERIFICATION_COMPLETE.md index 012c01c..536bef4 100644 --- a/docs/deployment/LINK_TOKEN_VERIFICATION_COMPLETE.md +++ b/docs/deployment/LINK_TOKEN_VERIFICATION_COMPLETE.md @@ -18,7 +18,7 @@ - ✅ Decimals: 18 - ✅ Type: ERC20 (MockLinkToken implementation) -**Documentation**: Matches successful deployment documented in `explorer-monorepo/docs/LINK_TOKEN_DEPLOYMENT_SUCCESS.md` +**Documentation**: Matches successful deployment documented in `~/projects/explorer-monorepo/docs/LINK_TOKEN_DEPLOYMENT_SUCCESS.md` --- diff --git a/docs/deployment/PHASE4_POST_DEPLOYMENT_TESTING.md b/docs/deployment/PHASE4_POST_DEPLOYMENT_TESTING.md index aff2463..7409271 100644 --- a/docs/deployment/PHASE4_POST_DEPLOYMENT_TESTING.md +++ b/docs/deployment/PHASE4_POST_DEPLOYMENT_TESTING.md @@ -66,7 +66,7 @@ 6. Verify tokens received on ChainID 138 **Existing Test Scripts Available**: -- `explorer-monorepo/scripts/test-end-to-end-bridge.sh` - E2E bridge test +- `~/projects/explorer-monorepo/scripts/test-end-to-end-bridge.sh` - E2E bridge test - `scripts/test-bridge-transfers.sh` - Bridge transfer test - `scripts/test-bridge-all-7-networks.sh` - Multi-chain test @@ -82,7 +82,7 @@ - Manual token import with correct decimals works as workaround **Token Lists Available**: -- `metamask-integration/docs/METAMASK_TOKEN_LIST.json` - Token list with WETH9/WETH10 +- `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` - Token list with WETH9/WETH10 - Contains correct decimals (18) to fix display issue **Action Required**: diff --git a/docs/deployment/TASK5_TOKEN_LIST_HOSTING.md b/docs/deployment/TASK5_TOKEN_LIST_HOSTING.md index 8266098..debf3fc 100644 --- a/docs/deployment/TASK5_TOKEN_LIST_HOSTING.md +++ b/docs/deployment/TASK5_TOKEN_LIST_HOSTING.md @@ -7,7 +7,7 @@ ✅ **Token list validated and ready for hosting.** -Token list file exists: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` +Token list file exists: `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` ## Token List Contents @@ -64,7 +64,7 @@ Token list file exists: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` **Steps**: ```bash # Copy token list to docs folder -cp metamask-integration/docs/METAMASK_TOKEN_LIST.json docs/ +cp ~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json docs/ # Commit and push git add docs/METAMASK_TOKEN_LIST.json diff --git a/docs/deployment/TASK_COMPLETION_REPORT.md b/docs/deployment/TASK_COMPLETION_REPORT.md index 431e1e3..b286a0a 100644 --- a/docs/deployment/TASK_COMPLETION_REPORT.md +++ b/docs/deployment/TASK_COMPLETION_REPORT.md @@ -45,7 +45,7 @@ **Completed**: 2025-01-18 **Actions Taken**: -1. Validated token list format: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` +1. Validated token list format: `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` 2. Verified token entries include correct decimals (18 for WETH9/WETH10) 3. Created hosting guide in task documentation @@ -56,7 +56,7 @@ **Next Steps**: Host token list at public URL (GitHub Pages, IPFS, or CDN) and register with MetaMask. -**Documentation**: `metamask-integration/docs/METAMASK_TOKEN_LIST.json` +**Documentation**: `~/projects/metamask-integration/docs/METAMASK_TOKEN_LIST.json` --- diff --git a/scripts/deploy-ccip-receiver-direct.sh b/scripts/deploy-ccip-receiver-direct.sh index 32f9842..1508e89 100755 --- a/scripts/deploy-ccip-receiver-direct.sh +++ b/scripts/deploy-ccip-receiver-direct.sh @@ -10,7 +10,7 @@ cd "$PROJECT_ROOT" source "$PROJECT_ROOT/scripts/lib/forge-scope.sh" # Load environment variables -source "$PROJECT_ROOT/../explorer-monorepo/.env" 2>/dev/null || true +source "$HOME/projects/explorer-monorepo/.env" 2>/dev/null || true PRIVATE_KEY="${PRIVATE_KEY:-}" CCIP_ROUTER_ADDRESS="${CCIP_ROUTER_ADDRESS:-}" diff --git a/services/token-aggregation/DEPLOYMENT_COMPLETE.md b/services/token-aggregation/DEPLOYMENT_COMPLETE.md index 179da42..f8db691 100644 --- a/services/token-aggregation/DEPLOYMENT_COMPLETE.md +++ b/services/token-aggregation/DEPLOYMENT_COMPLETE.md @@ -41,8 +41,8 @@ The Token Aggregation Service has been extended with: ### Step 1: Database Migrations ```bash -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql ``` ### Step 2: Deploy to Proxmox diff --git a/services/token-aggregation/FINAL_STATUS.md b/services/token-aggregation/FINAL_STATUS.md index 3d0e61c..0a1aa30 100644 --- a/services/token-aggregation/FINAL_STATUS.md +++ b/services/token-aggregation/FINAL_STATUS.md @@ -44,8 +44,8 @@ All components of the Token Aggregation Service have been successfully implement - ✅ `scripts/setup.sh` - Setup script ### Database Files -- ✅ `explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql` -- ✅ `explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.down.sql` +- ✅ `~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql` +- ✅ `~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.down.sql` ### Documentation Files - ✅ `README.md` - Main documentation diff --git a/services/token-aggregation/IMPLEMENTATION_COMPLETE.md b/services/token-aggregation/IMPLEMENTATION_COMPLETE.md index f7b381d..e087574 100644 --- a/services/token-aggregation/IMPLEMENTATION_COMPLETE.md +++ b/services/token-aggregation/IMPLEMENTATION_COMPLETE.md @@ -10,7 +10,7 @@ The Token Aggregation Service has been fully implemented according to the plan. ## ✅ Completed Components ### 1. Database Schema -- ✅ Migration file: `explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql` +- ✅ Migration file: `~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql` - ✅ Down migration: `0011_token_aggregation_schema.down.sql` - ✅ Tables created: - `token_market_data` - Market metrics per token @@ -87,7 +87,7 @@ The Token Aggregation Service has been fully implemented according to the plan. Run the migration in the explorer database: ```bash # Navigate to explorer backend -cd explorer-monorepo/backend +cd ~/projects/explorer-monorepo/backend # Run migration (method depends on your migration tool) # The migration file is at: diff --git a/services/token-aggregation/IMPLEMENTATION_STATUS.md b/services/token-aggregation/IMPLEMENTATION_STATUS.md index e9d338e..73a7c16 100644 --- a/services/token-aggregation/IMPLEMENTATION_STATUS.md +++ b/services/token-aggregation/IMPLEMENTATION_STATUS.md @@ -82,8 +82,8 @@ Ensure all frontend files listed above are created. ### 2. Run Database Migrations ```bash -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql ``` ### 3. Deploy to Proxmox diff --git a/services/token-aggregation/PROXMOX_DEPLOYMENT.md b/services/token-aggregation/PROXMOX_DEPLOYMENT.md index 19d7eb5..1145191 100644 --- a/services/token-aggregation/PROXMOX_DEPLOYMENT.md +++ b/services/token-aggregation/PROXMOX_DEPLOYMENT.md @@ -90,8 +90,8 @@ Run the migration in your database: ```bash # From your database host -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql ``` ### Create Admin User diff --git a/services/token-aggregation/QUICK_START.md b/services/token-aggregation/QUICK_START.md index 0930042..b2daa80 100644 --- a/services/token-aggregation/QUICK_START.md +++ b/services/token-aggregation/QUICK_START.md @@ -32,7 +32,7 @@ Use `https://rpc-http-pub.d-bis.org` only for external/public-only deployments. ### 3. Run Database Migration ```bash # Navigate to explorer backend and run migration -cd ../../explorer-monorepo/backend +cd ~/projects/explorer-monorepo/backend # Run migration 0011_token_aggregation_schema.up.sql ``` diff --git a/services/token-aggregation/QUICK_START_COMPLETE.md b/services/token-aggregation/QUICK_START_COMPLETE.md index e974239..ee8988b 100644 --- a/services/token-aggregation/QUICK_START_COMPLETE.md +++ b/services/token-aggregation/QUICK_START_COMPLETE.md @@ -33,8 +33,8 @@ nano .env # Edit with your database URL and settings Or manually: ```bash -psql $DATABASE_URL -f ../../explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql -psql $DATABASE_URL -f ../../explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql ``` ### 3. Create Admin User diff --git a/services/token-aggregation/README.md b/services/token-aggregation/README.md index 33ea7ee..5e1c1c5 100644 --- a/services/token-aggregation/README.md +++ b/services/token-aggregation/README.md @@ -4,7 +4,7 @@ A comprehensive token aggregation service that indexes token info, volume, liqui **REST API reference:** [docs/REST_API_REFERENCE.md](docs/REST_API_REFERENCE.md) — tokens, pools, prices, volume, OHLCV for dApps and MetaMask Snap discovery. -**Chain 138 Snap:** The MetaMask Chain 138 Snap (companion site at e.g. https://explorer.d-bis.org/snap/) calls this service for market data, swap quotes, and bridge routes. If the Snap is built with `GATSBY_SNAP_API_BASE_URL=https://explorer.d-bis.org`, then explorer.d-bis.org must serve this API (e.g. proxy `/api/v1/*` to this service). Otherwise build the Snap site with `GATSBY_SNAP_API_BASE_URL` set to this service’s public URL. See [metamask-integration/chain138-snap/docs/CHAIN138_SNAP_TROUBLESHOOTING.md](../../../metamask-integration/chain138-snap/docs/CHAIN138_SNAP_TROUBLESHOOTING.md). **CORS:** The service uses `cors()` (all origins allowed by default) so MetaMask Snap and browser clients can fetch token list and networks. +**Chain 138 Snap:** The MetaMask Chain 138 Snap (companion site at e.g. https://explorer.d-bis.org/snap/) calls this service for market data, swap quotes, and bridge routes. If the Snap is built with `GATSBY_SNAP_API_BASE_URL=https://explorer.d-bis.org`, then explorer.d-bis.org must serve this API (e.g. proxy `/api/v1/*` to this service). Otherwise build the Snap site with `GATSBY_SNAP_API_BASE_URL` set to this service’s public URL. See [metamask-integration/chain138-snap/docs/CHAIN138_SNAP_TROUBLESHOOTING.md](~/projects/metamask-integration/chain138-snap/docs/CHAIN138_SNAP_TROUBLESHOOTING.md). **CORS:** The service uses `cors()` (all origins allowed by default) so MetaMask Snap and browser clients can fetch token list and networks. ## Features @@ -97,7 +97,7 @@ The MetaMask Snap bridge dialog always shows the Trustless (Lockbox) route when 5. Run database migrations: ```bash # Ensure the migration has been run in the explorer database -# Migration file: explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +# Migration file: ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql ``` 6. Build the project: diff --git a/services/token-aggregation/README_CONTROL_PANEL.md b/services/token-aggregation/README_CONTROL_PANEL.md index 35c22a9..2ca27cd 100644 --- a/services/token-aggregation/README_CONTROL_PANEL.md +++ b/services/token-aggregation/README_CONTROL_PANEL.md @@ -31,8 +31,8 @@ The Token Aggregation Service now includes a full-featured Control Panel and Pro ### 1. Database Setup ```bash # Run migrations -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql -psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +psql $DATABASE_URL -f ~/projects/explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql ``` ### 2. Deploy to Proxmox diff --git a/services/token-aggregation/docs/DEPLOYMENT.md b/services/token-aggregation/docs/DEPLOYMENT.md index 3116f25..7918e65 100644 --- a/services/token-aggregation/docs/DEPLOYMENT.md +++ b/services/token-aggregation/docs/DEPLOYMENT.md @@ -17,7 +17,7 @@ CREATE EXTENSION IF NOT EXISTS timescaledb; 2. Run the migration from the explorer database: ```bash # The migration file is located at: -# explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql +# ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql ``` 3. Verify tables were created: diff --git a/services/token-aggregation/scripts/complete-setup.sh b/services/token-aggregation/scripts/complete-setup.sh index 9998c7d..b405c34 100755 --- a/services/token-aggregation/scripts/complete-setup.sh +++ b/services/token-aggregation/scripts/complete-setup.sh @@ -7,7 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" SERVICE_DIR="$SCRIPT_DIR/.." -MIGRATIONS_DIR="$PROJECT_ROOT/explorer-monorepo/backend/database/migrations" +MIGRATIONS_DIR="$HOME/projects/explorer-monorepo/backend/database/migrations" echo "==========================================" echo "Token Aggregation Service - Complete Setup" diff --git a/services/token-aggregation/scripts/run-migrations.sh b/services/token-aggregation/scripts/run-migrations.sh index 734a24a..1c01dda 100755 --- a/services/token-aggregation/scripts/run-migrations.sh +++ b/services/token-aggregation/scripts/run-migrations.sh @@ -6,7 +6,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" SERVICE_DIR="$SCRIPT_DIR/.." -MIGRATIONS_DIR="$PROJECT_ROOT/explorer-monorepo/backend/database/migrations" +MIGRATIONS_DIR="$HOME/projects/explorer-monorepo/backend/database/migrations" # Load environment if [[ -f "$SERVICE_DIR/.env" ]]; then diff --git a/services/token-aggregation/scripts/setup.sh b/services/token-aggregation/scripts/setup.sh index 5a70c44..10e663c 100755 --- a/services/token-aggregation/scripts/setup.sh +++ b/services/token-aggregation/scripts/setup.sh @@ -43,7 +43,7 @@ fi # Verify database migration echo "📊 Verifying database migration..." echo "⚠️ Please ensure migration 0011_token_aggregation_schema.up.sql has been run" -echo " Location: explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql" +echo " Location: ~/projects/explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql" echo "" echo "✅ Setup complete!" diff --git a/services/token-aggregation/src/api/routes/config.ts b/services/token-aggregation/src/api/routes/config.ts index a39f736..34c16dd 100644 --- a/services/token-aggregation/src/api/routes/config.ts +++ b/services/token-aggregation/src/api/routes/config.ts @@ -1,5 +1,6 @@ import { Router, Request, Response } from 'express'; import fs from 'fs'; +import os from 'os'; import path from 'path'; import { getNetworks, getConfigByChain, API_VERSION, type NetworkEntry } from '../../config/networks'; import { getCanonicalTokensByChain, getLogoUriForSpec, getTokenRegistryFamily } from '../../config/canonical-tokens'; @@ -103,13 +104,8 @@ function resolveRuntimeNetworksPath(): string | null { const candidates = uniquePaths([ process.env.NETWORKS_JSON_PATH, process.env.CONFIG_NETWORKS_JSON_PATH, - path.resolve(process.cwd(), 'explorer-monorepo/backend/api/rest/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(process.cwd(), '../explorer-monorepo/backend/api/rest/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(process.cwd(), '../../explorer-monorepo/backend/api/rest/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(process.cwd(), 'explorer-monorepo/backend/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(process.cwd(), '../explorer-monorepo/backend/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(process.cwd(), '../../explorer-monorepo/backend/config/metamask/DUAL_CHAIN_NETWORKS.json'), - path.resolve(__dirname, '../../../../../../explorer-monorepo/backend/api/rest/config/metamask/DUAL_CHAIN_NETWORKS.json'), + path.join(os.homedir(), 'projects/explorer-monorepo/backend/api/rest/config/metamask/DUAL_CHAIN_NETWORKS.json'), + path.join(os.homedir(), 'projects/explorer-monorepo/backend/config/metamask/DUAL_CHAIN_NETWORKS.json') ]); for (const candidate of candidates) {