Skip to content

Standalone RCL-compatible transaction signing and serialization library

License

Notifications You must be signed in to change notification settings

scottschurr/ripple-libpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ripple-libpp

Build Status Build status codecov

Rippled-compatible signing and serialization library

Introduction

C++ library to create, sign, and serialize Ripple transactions before submission to the Ripple Consensus Ledger (rippled). Duplicates much of the functionality of the sign RPC function without the overhead of a JSON library, network delays, needing to trust a 3rd party's rippled, nor needing to run your own rippled.

Table of contents

Dependencies

Rippled submodule

ripple-libpp includes a git submodule to include the rippled source code, which is not cloned by default. To get the rippled source, either clone this repository using

$ git clone --recursive <location>

or after cloning, run the following commands

$ git submodule init
$ git submodule update

Note: even though the entire rippled source tree is included in the submodule, only a subset of it is used by the library.

Other dependencies

Installation

CMake project installation example:

  1. Copy, clone, or submodule the library into your project, eg:

    / My Project
    	/ extras
    		/ ripple-libpp
    			**library tree**
    	/ src
    		**program tree**
    	CMakeLists.txt
    
  2. Edit your CMakeLists.txt file to include the necessary unity source files, external libraries, and include directories:

    ...
    # Rippled cmake function library
    include(extras/ripple-libpp/extras/rippled/CMakeFuncs.cmake)
    
    # Include paths
    include_directories(
    	${YOUR_OTHER_INCLUDES}
    	extras/ripple-libpp/extras/rippled/src
    	extras/ripple-libpp/extras/rippled/src/srcp256k1
    	extras/ripple-libpp/extras/rippled/src/ed25519-donna
    	extras/ripple-libpp/extras/rippled/src/beast/include
    	extras/ripple-libpp/extras/rippled/src/beast/extras
    )
    
    # Source files
    add_executable(${YOUR_APP_NAME}
    	${YOUR_SOURCE_FILES}
    	extras/ripple-libpp/src/unity/ripple-libpp.cpp
    	extras/ripple-libpp/extras/rippled/src/ripple/unity/ed25519.c
    )
    
    # Boost library (if not already included)
    find_boost(
        regex
        system
        thread)
    
    target_link_libraries(${YOUR_APP_NAME} ${Boost_LIBRARIES})
    
    # OpenSSL library (if not already included)
    set(openssl_min 1.0.2)
    find_openssl(${openssl_min})
    
    target_link_libraries(${YOUR_APP_NAME} ${OPENSSL_LIBRARIES})
    ...
    

Demo

Some code examples are provided in src/test/ripple-libpp_demo.cpp to demonstrate how to create, sign, and verify the signature of a transaction. Building and running this demo is an optional step to verify that dependencies are installed and available as expected.

Note that the demo is not a comprehensive suite of tests of the relevent rippled functionality; that is covered by rippled's unit tests.

Additional dependencies

In addition to the Usage dependencies, building the demo requires

Build and run

For linux and other unix-like OSes, run the following commands:

$ cd ${YOUR_RIPPLE_LIBPP_DIRECTORY}
$ mkdir -p build/gcc.debug
$ cd build/gcc.debug
$ cmake ../..
$ cmake --build .
$ ./ripplelibppdemo

For 64-bit Windows, open a MSBuild Command Prompt for Visual Studio and run the following commands:

> cd %YOUR_RIPPLE_LIBPP_DIRECTORY%
> mkdir build
> cd build
> cmake -G"Visual Studio 14 2015 Win64" ..
> cmake --build .
> .\Debug\ripplelibppdemo.exe

32-bit Windows builds are not officially supported.

About

Standalone RCL-compatible transaction signing and serialization library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 71.6%
  • CMake 28.4%