Skip to content

DEBUGGING.md

CeloHT edited this page Jul 31, 2026 · 1 revision

Debugging

This guide describes the recommended debugging process for the CeloHT ecosystem.

Debugging helps developers identify, analyze, and resolve issues efficiently while maintaining the stability and security of the platform.


Philosophy

When investigating an issue, always:

  1. Reproduce the problem.
  2. Identify the root cause.
  3. Fix the root cause.
  4. Test the solution.
  5. Document the fix.

Avoid temporary fixes that do not address the underlying issue.


Common Issues

Installation Problems

Symptoms

  • Missing dependencies
  • Installation errors
  • Package conflicts

Solutions

rm -rf node_modules
rm package-lock.json
npm install

Development Server Does Not Start

Check:

  • Node.js version
  • Environment variables
  • Port availability
  • Dependency installation

Run:

npm run dev

Build Errors

Run:

npm run build

Review:

  • TypeScript errors
  • Missing imports
  • Environment variables
  • Package versions

Wallet Connection Issues

Verify:

  • Valora is installed
  • WalletConnect configuration
  • Internet connection
  • Correct Celo network
  • Wallet permissions

Smart Contract Errors

Compile contracts:

npx hardhat compile

Run tests:

npx hardhat test

Verify:

  • Contract addresses
  • Network configuration
  • ABI compatibility
  • Gas limits

API Errors

Check:

  • Endpoint URL
  • Authentication token
  • Request payload
  • Response status code
  • Server logs

Database Issues

Verify:

  • Database connection
  • Migration status
  • Environment variables
  • User permissions

Logging

Enable detailed logging during development.

Example

DEBUG=*

Application logs should include:

  • Timestamp
  • Log level
  • Component
  • Error message
  • Stack trace

Browser Developer Tools

Useful tools include:

  • Console
  • Network
  • Performance
  • Application Storage
  • Sources

Always inspect browser console errors before reporting a bug.


Hardhat Debugging

Useful commands

Compile

npx hardhat compile

Run tests

npx hardhat test

Run a script

npx hardhat run scripts/example.ts --network alfajores

Git Debugging

View commit history

git log

Inspect changes

git diff

Check repository status

git status

Performance Debugging

Monitor:

  • API latency
  • Database queries
  • Bundle size
  • Memory usage
  • CPU usage
  • Network requests

Recommended tools:

  • Chrome DevTools
  • Lighthouse
  • Node.js Inspector

Security Debugging

Review:

  • Authentication failures
  • Permission errors
  • Invalid signatures
  • Smart contract reverts
  • Dependency vulnerabilities

Never expose:

  • Private keys
  • Recovery phrases
  • API secrets
  • Database credentials

Reporting Bugs

Every bug report should include:

  • Environment
  • Browser
  • Operating System
  • Device
  • Steps to reproduce
  • Expected behavior
  • Actual behavior
  • Screenshots
  • Logs

Best Practices

  • Reproduce the issue before fixing it.
  • Fix the root cause.
  • Write tests for every fix.
  • Keep debugging notes.
  • Verify the solution in multiple environments.
  • Update documentation if necessary.

Future Improvements

Future debugging enhancements include:

  • Remote debugging
  • Error monitoring dashboards
  • AI-assisted log analysis
  • Real-time diagnostics
  • Automated crash reporting
  • Performance profiling

Conclusion

Effective debugging is essential to maintaining the reliability, security, and quality of the CeloHT ecosystem.

Every resolved issue strengthens the platform and improves the experience for users, contributors, and partners.

Welcome to the official CeloHT documentation. This knowledge base provides comprehensive documentation for users, developers, contributors, partners, researchers, and ecosystem participants. Explore architecture, APIs, smart contracts, developer guides, governance, security, educational resources, roadmap, transparency reports, and community initiatives. Built with openness, collaboration, and long-term sustainability in mind, the CeloHT documentation follows international open-source documentation standards to make learning, building, and contributing accessible to everyone.

Clone this wiki locally