Skip to content

feat: Add debug endpoints for wallet info and log level management#31

Merged
mcamou merged 1 commit intomainfrom
add-wallets-and-loglevel-endpoints
Dec 17, 2025
Merged

feat: Add debug endpoints for wallet info and log level management#31
mcamou merged 1 commit intomainfrom
add-wallets-and-loglevel-endpoints

Conversation

@mcamou
Copy link
Contributor

@mcamou mcamou commented Dec 15, 2025

Summary

This PR adds new debug endpoints for monitoring and managing the faucet service:

  • /debug/wallets - View all worker wallets with balances and funding status
  • /debug/loglevel - GET/PUT endpoints for runtime log level management

Changes

  • New /debug/wallets endpoint: Returns JSON array with wallet addresses, balances, denominations, and funding status for all workers
  • New /debug/loglevel endpoints:
    • GET returns current log level as JSON
    • PUT sets log level dynamically (supports debug, info, warn, error)
    • PUT without parameters resets to configured default
  • WorkerManager: Created new manager component to centralize worker lifecycle and provide wallet information
  • Refactored xlog.SetLevel(): Simplified API to take string parameter instead of slog.Level
  • Organized debug routes: All debug endpoints now grouped under /debug for better structure

API Examples

# Get all wallet info
curl http://localhost:8080/debug/wallets

# Get current log level
curl http://localhost:8080/debug/loglevel

# Set log level to debug
curl -X PUT http://localhost:8080/debug/loglevel?level=debug

# Reset log level to default
curl -X PUT http://localhost:8080/debug/loglevel

Test plan

  • All existing tests pass
  • New tests added for wallet and log level endpoints
  • Build succeeds without errors
  • API responses follow expected JSON schema

🤖 Generated with Claude Code

This commit introduces several monitoring and debugging improvements:

- Add `/debug/wallets` endpoint that returns all worker wallet addresses,
  balances, and funding status
- Add `/debug/loglevel` endpoints: GET to retrieve current log level,
  PUT to set log level dynamically
- Refactor xlog.SetLevel() to take string parameter for simpler API
- Create WorkerManager to centralize worker lifecycle management
- Implement WalletInfoProvider interface for wallet information access
- Organize all debug routes under a `/debug` group for better structure
- Update README with new endpoint documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mcamou mcamou merged commit 793caca into main Dec 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants