05Core Dev Bootcamp
Building and Integrating Custom RPC Handlers Appendices
Overview
This appendices section provides supplementary reference material and practical guides for Building and Integrating Custom RPC Handlers. These documents complement the main module content with real-world examples, utility reference material, and troubleshooting guidance.
Appendix Files
1. Handler Examples
Real-world RPC handler implementations from rippled
This appendix provides detailed walkthroughs of three actual handlers used in production Rippled code:
- AccountInfo Handler - Query account data and state
- Submit Handler - Process and submit transactions
- ServerInfo Handler - Retrieve node and network information
Each example includes:
- Source code analysis
- Key implementation patterns
- Error handling approaches
- Performance considerations
- References to core module topics
Use this when: You want to see how established handlers are implemented and need patterns to follow in your own code.
2. Helper Functions
Common utility functions and patterns from rippled RPC module
A reference guide to frequently-used helper functions that simplify RPC handler development:
- RPC::accountFromString() - Parse account identifiers
- RPC::lookupLedger() - Retrieve specific ledger versions
- RPC::getLedgerRange() - Get valid ledger index bounds
- parseBase58<>() - Decode Base58Check encoded data
- amountFromJsonNoThrow() - Safe amount parsing
Each function includes:
- Full function signatures
- Parameter descriptions
- Return value semantics
- Common error conditions
- Code examples
Use this when: You need to perform common RPC operations and want to know what utilities are already available in the rippled codebase.
3. Debugging Guide
Troubleshooting techniques and strategies for RPC handler development
Comprehensive guide for diagnosing and fixing issues during handler implementation:
- Compilation Errors - Common C++ patterns that cause build failures
- Runtime Debugging - Using debuggers with rippled
- Log Configuration - Setting appropriate log levels for diagnosis
- Testing Strategies - How to test handlers effectively
- Performance Analysis - Identifying bottlenecks
Includes:
- Step-by-step debugging workflows
- GDB/LLDB configuration for rippled
- Log message interpretation
- Common pitfalls and their solutions
- Testing best practices
Use this when: Your handler isn't working as expected and you need to diagnose and fix the issue quickly.
Quick Reference Links
| Topic | Related Module Section |
|---|---|
| Handler function signatures | Implementing Custom Handlers |
| Error codes and mapping | Error Handling and Validation |
| Role-based permissions | Authentication and Authorization |
| Architecture overview | RPC Handler Architecture |
| Testing framework | Testing RPC Handlers |
How to Use These Appendices
For Learning:
- Start with the main module content
- Use appendix examples to see real implementations
- Reference helper functions when implementing your handler
- Consult the debugging guide if you encounter issues
For Development:
- Keep handler-examples.md open while writing your handler
- Refer to helper-functions.md when you need to perform standard operations
- Check debugging-guide.md if your code doesn't compile or run correctly
For Reference:
- Each appendix can be consulted independently
- Cross-references point back to relevant main module sections
- Code examples are self-contained and can be adapted to your use case
Source References
All code examples in these appendices are drawn from:
- Rippled Source: https://github.com/XRPLF/rippled
- XRPL RPC Specification: https://xrpl.org/public-api-methods.html
In this section
- 01Appendix: Handler ExamplesThis appendix walks through three actual RPC handlers from the rippled codebase. These handlers are battle-tested, production-ready implementations that demonstrate best practices and patterns you should follow in your own custom handlers.
- 02Appendix: Helper FunctionsThe rippled RPC module provides a rich set of helper functions that handle common operations in handlers. Rather than reimplementing these utilities, your handlers should leverage existing functions for consistency, reliability, and maintainability.
- 03Appendix: Debugging GuideEven with careful coding, issues will arise during RPC handler development. This guide provides systematic approaches to diagnosing and fixing problems, from compilation errors to runtime issues to performance bottlenecks.