Appendices

← Back to Building and Integrating Custom RPC Handlers

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

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.


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.


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.


Topic
Related Module Section

Handler function signatures

Error codes and mapping

Role-based permissions

Architecture overview

Testing framework


How to Use These Appendices

For Learning:

  1. Start with the main module content

  2. Use appendix examples to see real implementations

  3. Reference helper functions when implementing your handler

  4. Consult the debugging guide if you encounter issues

For Development:

  1. Keep handler-examples.md open while writing your handler

  2. Refer to helper-functions.md when you need to perform standard operations

  3. 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


Last updated