Build and Run rippled on Ubuntu
rippled is the reference implementation of an XRP Ledger peer-to-peer server. This server can connect to a network of peers, relay cryptographically signed transactions, and maintain a local copy of the complete shared global ledger. Use these instructions to build a rippled executable from source. These instructions were tested on Ubuntu 18.04 LTS.
For information about building for other platforms, see Builds in the rippled GitHub repository.
Prerequisites
Before you compile or install rippled, you must meet the System Requirements.
1. Build rippled
These instructions use Ubuntu's APT (Advanced Packaging Tool) to install rippled's build dependencies.
-
Update the list of packages that are available for
apt-getto install or upgrade.sudo apt-get update -
Upgrade currently installed packages.
sudo apt-get -y upgrade -
Install dependencies.
sudo apt-get -y install git pkg-config protobuf-compiler libprotobuf-dev libssl-dev wget build-essential doxygen -
Install CMake.
Version 1.9.0 of
rippledrequires CMake 3.16.3 or higher. To install CMake 3.16.3:wget https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3-Linux-x86_64.sh sudo sh cmake-3.16.3-Linux-x86_64.sh --prefix=/usr/local --exclude-subdirUse
cmake --versionto verify that the installation worked. -
Compile Boost.
Version 1.9.0 of
rippledrequires the Boost library and is compatible with Boost versions 1.71.0 to 1.77.0. The Ubuntu 18.04 (or 20.04) software repositories don't have a compatible Boost version, so you must compile it yourself. The following examples use Boost 1.75.0.If you have previously built Boost 1.75.0 for
rippledand configured theBOOST_ROOTenvironment variable, you can skip these steps.-
Download Boost 1.75.0.
wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz -
Extract
boost_1_75_0.tar.gz.tar xvzf boost_1_75_0.tar.gz -
Change to the new
boost_1_75_0directory.cd boost_1_75_0 -
Prepare the Boost.Build system for use.
./bootstrap.sh -
Build the separately-compiled Boost libraries. This may take about 10 minutes, depending on your hardware specs.
./b2 -j 4Tip: This example uses 4 processes to build in parallel. The best number of processes to use depends on how many CPU cores your hardware has available. You can use
cat /proc/cpuinfoto get information about your hardware's processor. -
Set the environment variable
BOOST_ROOTto point to the newboost_1_75_0directory. It's best to put this environment variable in your.profile, or equivalent, file for your shell so it's automatically set when you log in. Add the following line to the file (changemy_userto your username):export BOOST_ROOT=/home/my_user/boost_1_75_0 -
Source your updated
.profilefile. For example:source ~/.profile
-
-
From a working directory, get the
rippledsource code. Themasterbranch has the latest released version.git clone https://github.com/xrplf/rippled.git cd rippled git checkout master -
Check the commit log to be sure you're compiling the right code. The most recent commit should be signed by a well-known Ripple developer and should set the version number to the latest released version. The release announcements for
rippledgenerally show the exact commit to expect for that release.$ git log -1
-
If you previously built, or (more importantly) tried and failed to build the XRPL server, you should delete the
my_build/directory (or whatever you named it) to start clean before moving on to the next step. Otherwise, you may get unexpected behavior, like an executable that crashes due to a segmentation fault (segfault).If this is your first time building
rippled, you won't have amy_build/directory and can move on to the next step. -
Use CMake to build a
rippledbinary executable from source code. This creates arippledbinary executable in themy_builddirectory.-
Generate the build system. Builds should be performed in a directory that is separate from the source tree root. In this example, we'll use a
my_builddirectory that is a subdirectory ofrippled.mkdir my_build cd my_build cmake ..Tip: The default build includes debugging symbols, which can be useful for development but are inefficient in production. To build
rippledfor use on production servers, add the-DCMAKE_BUILD_TYPE=Releaseflag when running thecmakecommand. -
Build the
rippledexecutable. This may take about 30 minutes, depending on your hardware specs.cmake --build .
-
-
(Optional) Run
rippledunit tests. If there are no test failures, you can be fairly certain that yourrippledexecutable compiled correctly../rippled -u
2. Configure rippled
Complete the following configurations that are required for rippled to start up successfully. All other configuration is optional and can be tweaked after you have a working server.
-
Create a copy of the example config file (assumes you're in the
rippledfolder already). Saving the config file to this location enables you to runrippledas a non-root user (recommended).mkdir -p ~/.config/ripple cp cfg/rippled-example.cfg ~/.config/ripple/rippled.cfg -
Edit the config file to set necessary file paths. The user you plan to run
rippledas must have write permissions to all of the paths you specify here.-
Set the
[node_db]'s path to the location where you want to store the ledger database. -
Set the
[database_path]to the location where you want to store other database data. (This includes an SQLite database with configuration data, and is typically one level above the[node_db]path field.) -
Set the
[debug_logfile]to a path whererippledcan write logging information.
-
-
Copy the example
validators.txtfile to the same folder asrippled.cfg:cp cfg/validators-example.txt ~/.config/ripple/validators.txtWarning: The
validators.txtfile contains settings that determine how your server declares a ledger to be validated. If you are not careful, changes to this file could cause your server to diverge from the rest of the network and report out of date, incomplete, or inaccurate data. Acting on such data can cause you to lose money.
3. Run rippled
To run your rippled server from the executable you built:
./rippled
What to Expect
Once you've run rippled, here are excerpts of what you can expect to see in your terminal.
Loading: "/home/ubuntu/.config/ripple/rippled.cfg"
Watchdog: Launching child 1
2018-Jun-06 00:51:35.094331139 JobQueue:NFO Auto-tuning to 4 validation/transaction/proposal threads.
2018-Jun-06 00:51:35.100607625 Amendments:DBG Amendment 4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373 is supported.
2018-Jun-06 00:51:35.101226904 Amendments:DBG Amendment 6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC is supported.
2018-Jun-06 00:51:35.101354503 Amendments:DBG Amendment 42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE is supported.
2018-Jun-06 00:51:35.101503304 Amendments:DBG Amendment 08DE7D96082187F6E6578530258C77FAABABE4C20474BDB82F04B021F1A68647 is supported.
2018-Jun-06 00:51:35.101624717 Amendments:DBG Amendment 740352F2412A9909880C23A559FCECEDA3BE2126FED62FC7660D628A06927F11 is supported.
...
2018-Jun-06 00:51:35.106970906 OrderBookDB:DBG Advancing from 0 to 3
2018-Jun-06 00:51:35.107158071 OrderBookDB:DBG OrderBookDB::update>
2018-Jun-06 00:51:35.107380722 OrderBookDB:DBG OrderBookDB::update< 0 books found
2018-Jun-06 00:51:35.168875072 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHBARBMi2MC3LJYuvs9Rhp94WcfbxoQD5BGhwN3jaHBsPkbNpoZq;Seq: 1;
2018-Jun-06 00:51:35.172099325 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHB57Sey9QgaB8CubTPvMZLkLAzfJzNMWBCCiDRgazWJujRdnz13;Seq: 1;
2018-Jun-06 00:51:35.175302816 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHDsPCxoBHZS9KNNfsd7iVaQXBSitNtbqXfB6BS1iEmJwwEKLhhQ;Seq: 1;
2018-Jun-06 00:51:35.178486951 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHBQ3CT3EWYZ4uzbnL3k6TRf9bBPhWRFVcK1F5NjtwCBksMEt5yy;Seq: 2;
2018-Jun-06 00:51:35.181681868 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHU5egMCYs1g7YRVKrKjEqVYFL12mFWwkqVFTiz2Zi4Z8jppPgxU;Seq: 2;
2018-Jun-06 00:51:35.184864291 ManifestCache:NFO Manifest: AcceptedNew;Pk: nHBbiP5ua5dUqCTz5i5vd3ia9jg3KJthohDjgKxnc7LxtmnauW7Z;Seq: 2;
...
2018-Jun-06 00:51:35.317972033 LedgerConsensus:NFO Entering consensus process, watching, synced=no
2018-Jun-06 00:51:35.318155351 LedgerConsensus:NFO Consensus mode change before=observing, after=observing
2018-Jun-06 00:51:35.318360468 NetworkOPs:DBG Initiating consensus engine
2018-Jun-06 00:51:35.358673488 Server:NFO Opened 'port_rpc_admin_local' (ip=127.0.0.1:5005, admin IPs:127.0.0.1, http)
2018-Jun-06 00:51:35.359296222 Server:NFO Opened 'port_peer' (ip=0.0.0.0:51235, peer)
2018-Jun-06 00:51:35.359778994 Server:NFO Opened 'port_ws_admin_local' (ip=127.0.0.1:6006, admin IPs:127.0.0.1, ws)
2018-Jun-06 00:51:35.360240190 Application:FTL Startup RPC:
{
"command" : "log_level",
"severity" : "warning"
}
...
2018-Jun-06 00:52:32.385295633 NetworkOPs:WRN We are not running on the consensus ledger
2018-Jun-06 00:52:32.388552023 LedgerConsensus:WRN Need consensus ledger 84726E8C5B346E28C21ADE6AAD703E65F802322EDAA5B76446A4D0C5206AB2DB
2018-Jun-06 00:52:33.379448561 LedgerConsensus:WRN View of consensus changed during open status=open, mode=wrongLedger
2018-Jun-06 00:52:33.379541915 LedgerConsensus:WRN 84726E8C5B346E28C21ADE6AAD703E65F802322EDAA5B76446A4D0C5206AB2DB to 1720162AE3BA8CD953BFB40EB746D7B78D13E1C97905E8C553E0B573F1B6A517
2018-Jun-06 00:52:33.379747629 LedgerConsensus:WRN {"accepted":true,"account_hash":"CC1F1EC08E76BC9FE843BBF9C6068C5B73192E6957B9CC1174DCB2B94DD2025A","close_flags":0,"close_time":581561550,"close_time_human":"2018-Jun-06 00:52:30.000000000","close_time_resolution":30,"closed":true,"hash":"94354A7FECAB638C29BBC79B18CFDBDC05E4FF72647AD62F072DB4D23A5E0317","ledger_hash":"94354A7FECAB638C29BBC79B18CFDBDC05E4FF72647AD62F072DB4D23A5E0317","ledger_index":"3","parent_close_time":581561490,"parent_hash":"80BF92A69F65F5C543E962DF4B41715546FDD97FC6988028E5ACBB46654756CA","seqNum":"3","totalCoins":"100000000000000000","total_coins":"100000000000000000","transaction_hash":"0000000000000000000000000000000000000000000000000000000000000000"}
...
2018-Jun-06 00:53:50.568965045 LedgerConsensus:WRN {"accepted":true,"account_hash":"A79E6754544F9C8FC74870C95A39CED1D45CC1206DDA4C113E51F9DB6DDB0E76","close_flags":0,"close_time":581561630,"close_time_human":"2018-Jun-06 00:53:50.000000000","close_time_resolution":10,"closed":true,"hash":"6294118F39F5F2B8349E7CC6D4D5931011622E78DD4E34D91372651E9F453E2F","ledger_hash":"6294118F39F5F2B8349E7CC6D4D5931011622E78DD4E34D91372651E9F453E2F","ledger_index":"29","parent_close_time":581561623,"parent_hash":"5F57870CE5160D6B53271955F26E3BE63696D1127B91BC7943F9A199B313CB85","seqNum":"29","totalCoins":"100000000000000000","total_coins":"100000000000000000","transaction_hash":"0000000000000000000000000000000000000000000000000000000000000000"}
2018-Jun-06 00:53:50.569776678 LedgerConsensus:WRN Need consensus ledger 6A0DE66550B6BA9636E3F8FDB71C2E924D182A1835E4143B2170DAA1D33CAE8D
2018-Jun-06 00:53:51.576778862 NetworkOPs:WRN We are not running on the consensus ledger
2018-Jun-06 00:53:53.576524564 LedgerConsensus:WRN View of consensus changed during establish status=establish, mode=wrongLedger
2018-Jun-06 00:53:53.576783663 LedgerConsensus:WRN 6A0DE66550B6BA9636E3F8FDB71C2E924D182A1835E4143B2170DAA1D33CAE8D to 1CB9C9A1C27403CBAB9DFCFA61E1F915059DFE4FA93524537B885CC190DB5C6B
2018-Jun-06 00:53:53.577079124 LedgerConsensus:WRN {"accepted":true,"account_hash":"5CAB3E4F5F2AC1A764106D7CC0729E6E7D1F7F93C65B7D8CB04C8DE2FC2C1305","close_flags":0,"close_time":581561631,"close_time_human":"2018-Jun-06 00:53:51.000000000","close_time_resolution":10,"closed":true,"hash":"201E147BD195CE3C56B0C0B8DF58386FC7BFF450E1E5B286A29AB856926D5F79","ledger_hash":"201E147BD195CE3C56B0C0B8DF58386FC7BFF450E1E5B286A29AB856926D5F79","ledger_index":"30","parent_close_time":581561630,"parent_hash":"6294118F39F5F2B8349E7CC6D4D5931011622E78DD4E34D91372651E9F453E2F","seqNum":"30","totalCoins":"100000000000000000","total_coins":"100000000000000000","transaction_hash":"0000000000000000000000000000000000000000000000000000000000000000"}
Explore Next Steps
-
Now that you have a stock
rippledserver running, you may want to consider running it as a validating server. For information about validating servers and why you might want to run one, see the rippled Setup Tutorial. -
For information about communicating with your
rippledserver using therippledAPI, see therippledAPI reference. -
As a development best practice, you may want to build a
rippled.debpackage. You can use the CMake build's deb package target to build adebpackage directly from the source tree. The build machine must have Docker installed . This process may take more than an hour to complete. To build thedebpackage:mkdir -p build/pkg && cd build/pkg cmake -Dpackages_only=ON ../.. cmake --build . --target dpkg -
You may also want to install a
systemdunit. For more information, see systemd for Upstart Users . You can use the officialrippledsystem unit file or modify it to suit your needs.