Core Dev Bootcamp
Docs

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

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

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

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.

TopicRelated Module Section
Handler function signaturesImplementing Custom Handlers
Error codes and mappingError Handling and Validation
Role-based permissionsAuthentication and Authorization
Architecture overviewRPC Handler Architecture
Testing frameworkTesting RPC Handlers

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:

In this section

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