Skip to content
Open
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
40 changes: 40 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,43 @@ Judge talking points (30-second version):
- [x] Usage + spend analytics
- [x] Env + setup docs
- [x] Frontend dashboard

## Troubleshooting

### Agent client fails with a network error

If the agent client throws a connection error such as `ECONNREFUSED` or `fetch failed`, the most common cause is that the API server is not running or `API_BASE_URL` is pointing to the wrong address.

**1. Confirm the API server is running**

Open a terminal and start the API:

```sh
npm run dev --workspace @query402/api
```

The server should log something like `Listening on http://localhost:3001`.

**2. Set `API_BASE_URL` for local development**

The agent client reads `API_BASE_URL` from the environment. For local development it should point to the API server:

```sh
export API_BASE_URL=http://localhost:3001
```

Or add it to a `.env` file in `apps/agent-client/`:

```sh
API_BASE_URL=http://localhost:3001
```

**3. Run the agent demo**

Once the API is running and `API_BASE_URL` is set, start the agent demo:

```sh
npm run demo --workspace @query402/agent-client
```

**Note:** Never commit real private keys or funded wallet secrets to `.env` files. Use testnet keys only for local development.
3 changes: 3 additions & 0 deletions apps/api/src/routes/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ publicRouter.get("/health", (_req, res) => {
network: config.STELLAR_NETWORK,
sponsorshipEnabled: config.sponsorshipEnabled,
timestamp: new Date().toISOString(),


uptimeSeconds: process.uptime(),
diagnostics: getConfigSnapshot()

});
});

Expand Down
Loading