### Start rippled Service with systemd Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This command starts the 'rippled.service' immediately using the systemd service manager. This is typically done after installation or configuration changes to bring the service online. ```bash sudo systemctl start rippled.service ``` -------------------------------- ### Enable rippled Service with systemd Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This command configures the 'rippled.service' to automatically start when the system boots up. It uses 'systemctl', the systemd service manager, to manage the service's startup behavior. ```bash sudo systemctl enable rippled.service ``` -------------------------------- ### Install rippled from Source using CMake Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md Installs the rippled and libxrpl software from a source build using CMake's `--install` mode. The `--prefix` argument specifies the installation directory. The default prefix varies by operating system. ```bash cmake --install . --prefix /opt/local ``` -------------------------------- ### Example rippled Configuration Snippet Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md An example configuration snippet from rippled, demonstrating the setup for the Online Delete feature. This is a conceptual representation and users should refer to the official documentation for exact details. ```cfg # Example configuration for Online Delete feature # Refer to doc/rippled-example.cfg for full details [node_db] "; } ] } ] } ``` ``` -------------------------------- ### Install Development Tools on Ubuntu 22.04 (Linux) Source: https://github.com/xahau/xahaud/blob/dev/docs/build/environment.md Installs essential development tools including curl, git, OpenSSL development headers, Python 3.10 development files, make, and g++-11 using apt. It also downloads, compiles, and installs CMake from source, and installs Conan using pip. ```shell apt update apt install --yes curl git libssl-dev python3.10-dev python3-pip make g++-11 curl --location --remote-name \ "https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz" tar -xzf cmake-3.25.1.tar.gz rm cmake-3.25.1.tar.gz cd cmake-3.25.1 ./bootstrap --parallel=$(nproc) make --jobs $(nproc) make install cd .. pip3 install 'conan<2' ``` -------------------------------- ### Starting rippled with Database Import Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This command starts the rippled server with the '--import' flag, initiating the process of importing an existing database to a new backend, typically RocksDB. ```bash rippled --import ``` -------------------------------- ### Install Homebrew, pyenv, Python, and Conan (macOS) Source: https://github.com/xahau/xahaud/blob/dev/docs/build/environment.md Installs Homebrew, a package manager for macOS, then uses Homebrew to install pyenv. pyenv is then used to install and set Python 3.10 development version, and Conan is installed using pip. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew update brew install xz brew install pyenv pyenv install 3.10-dev pyenv global 3.10-dev eval "$(pyenv init -)" pip install 'conan<2' ``` -------------------------------- ### Check Command Line Tools Installation (macOS) Source: https://github.com/xahau/xahaud/blob/dev/docs/build/environment.md Verifies the installation of the command line developer tools, which include Git, by checking their versions. This is a prerequisite for building the project. ```shell clang --version ``` ```shell git --version ``` -------------------------------- ### Install SQLITE Library and Headers (CMake) Source: https://github.com/xahau/xahaud/blob/dev/Builds/CMake/CMake_sqlite3.txt This CMake snippet details the installation of the built SQLITE library and its header files. It specifies the destinations for the library files (lib, bin) and header files (include) within the project's installation directory structure. ```cmake install ( TARGETS sqlite3 LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include) install ( FILES sqlite3.h sqlite3ext.h DESTINATION include) ``` -------------------------------- ### NodeStore Database Configuration Example Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/nodestore/README.md This example demonstrates how to configure the NodeStore backend database in the configuration file. It specifies the database type, storage path, and compression settings. Supported types include HyperLevelDB, LevelDB, RocksDB, and SQLite. ```ini type=RocksDB path=rocksdb compression=1 ``` -------------------------------- ### Install rippled using APT Package Manager Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md Installs rippled on Debian-based Linux distributions using the APT package manager. This process involves updating repositories, installing necessary utilities, securely adding Ripple's GPG key, configuring the APT sources list with the appropriate repository, and then installing the rippled package. It also includes steps to check and manage the rippled service. ```bash sudo apt update -y ``` ```bash sudo apt install -y apt-transport-https ca-certificates wget gnupg ``` ```bash sudo mkdir /usr/local/share/keyrings/wget -q -O - "https://repos.ripple.com/repos/api/gpg/key/public" | gpg --dearmor > ripple-key.gpg sudo mv ripple-key.gpg /usr/local/share/keyrings/ ``` ```bash gpg /usr/local/share/keyrings/ripple-key.gpg ``` ```bash echo "deb [signed-by=/usr/local/share/keyrings/ripple-key.gpg] https://repos.ripple.com/repos/rippled-deb focal stable" | \ sudo tee -a /etc/apt/sources.list.d/ripple.list ``` ```bash sudo apt -y update ``` ```bash sudo apt -y install rippled ``` ```bash systemctl status rippled.service ``` ```bash sudo systemctl start rippled.service ``` ```bash sudo setcap 'cap_net_bind_service=+ep' /opt/ripple/bin/rippled ``` -------------------------------- ### Example Validator Configuration Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This is an example of a validators.txt file configuration. It lists validator keys and their associated IDs. Note that these keys were updated in April 2014 due to an OpenSSL vulnerability. ```ini [validators] n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7 RL1 n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj RL2 n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C RL3 n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS RL4 n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA RL5 ``` -------------------------------- ### Install rippled Package with YUM Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This command installs the 'rippled' package using the YUM package manager. It fetches the package and its dependencies from the configured repositories and installs them on the system. ```bash sudo yum install -y rippled ``` -------------------------------- ### Basic Simulation Setup and Execution in C++ Source: https://github.com/xahau/xahaud/blob/dev/src/test/csf/README.md Demonstrates setting up a simulation with multiple peer groups, configuring trust and network connections, submitting transactions, and running the simulation for a specific duration. It collects simulation duration data and asserts synchronization. ```c++ Sim sim; PeerGroup validators = sim.createGroup(5); PeerGroup center = sim.createGroup(1); PeerGroup network = validators + center; center[0]->runAsValidator = false; validators.trust(validators); center.trust(validators); using namespace std::chrono; SimDuration delay = 200ms; validators.connect(center, delay); SimDurationCollector simDur; sim.collectors.add(simDur); // prep round to set initial state. sim.run(1); // everyone submits their own ID as a TX and relay it to peers for (Peer * p : validators) p->submit(Tx(static_cast(p->id))); sim.run(1); std::cout << (simDur.stop - simDur.start).count() << std::endl; assert(sim.synchronized()); ``` -------------------------------- ### Example Boost Version Check Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Shows a common method to check the installed Boost library version on a system. A minimum of v1.57.0 is required for rippled 0.28.2. ```bash dpkg -s libboost-dev | grep Version ``` -------------------------------- ### Build libsecp256k1 using Autotools Source: https://github.com/xahau/xahaud/blob/dev/src/secp256k1/README.md Standard build process for libsecp256k1 using autotools. This involves generating build scripts, configuring the build, compiling the library, running tests, and optionally installing it. ```bash ./autogen.sh ./configure make ./tests sudo make install # optional ``` -------------------------------- ### Stopping and Starting Xahaud Server Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Commands to stop and start the Xahaud server. These are essential for database maintenance operations like removal or import. ```bash rippled stop ``` ```bash rippled start ``` -------------------------------- ### Example GCC Version Check Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Illustrates how to check the installed GCC version on a Linux system. The minimum supported version for compiling rippled is v4.8. ```bash gcc --version ``` -------------------------------- ### Example rippled.cfg IP Stanza Configuration Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Demonstrates the correct format for specifying IP addresses and ports within the [ips] stanza of the rippled.cfg configuration file. A port must be specified for each IP address. ```ini [ips] r.ripple.com 51235 ``` -------------------------------- ### NodeStore DB Compression Configuration Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This example demonstrates how to enable compression for the NodeStore database in rippled, as referenced in the 'rippled-example.cfg' file. Compression can lead to increased speed and reduced disk space usage. ```config # Example configuration snippet for NodeStore compression # Refer to rippled-example.cfg for full details ... NodeStore { "type": "RocksDB", "path": "/var/lib/ripple/nodestore", "compression": true } ... ``` -------------------------------- ### Install CMake with Homebrew (macOS) Source: https://github.com/xahau/xahaud/blob/dev/docs/build/environment.md Installs CMake, a cross-platform build system generator, using the Homebrew package manager on macOS. ```shell brew install cmake ``` -------------------------------- ### Ensure Protocol Buffer Prerequisites Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This update improves build scripts to ensure protocol buffer prerequisites are present. Previously, building on certain Ubuntu versions would fail without manual installation of `libprotoc-dev`. ```git Ensure protocol buffer prerequisites are present: The build scripts and packages now properly handle Protobuf packages and various packages. Prior to this change, building on Ubuntu 21.10 Impish Indri would fail unless the `libprotoc-dev` package was installed. (e06465f) ``` -------------------------------- ### ShardArchiveHandler Interface - C++ Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/net/ShardDownloader.md This C++ interface defines methods for adding archives to be downloaded and imported, and for starting the download process. It ensures downloads are managed serially and returns false if called during an active download. ```C++ /** Add an archive to be downloaded and imported. @param shardIndex the index of the shard to be imported. @param url the location of the archive. @return `true` if successfully added. @note Returns false if called while downloading. */ bool add(std::uint32_t shardIndex, std::pair&& url); /** Starts downloading and importing archives. */ bool start(); ``` -------------------------------- ### Configure Ripple RPM Repository (Nightly) with YUM Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This snippet configures the YUM package manager to use the nightly Ripple RPM repository for experimental builds. It includes the repository name, enables it, and points to the base URL and GPG key for the latest development packages. ```bash cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo [ripple-nightly] name=XRP Ledger Packages enabled=1 gpgcheck=0 repo_gpgcheck=1 baseurl=https://repos.ripple.com/repos/rippled-rpm/nightly/ gpgkey=https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key REPOFILE ``` -------------------------------- ### Example Boost Toolchain Support for rippled Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Indicates the minimum required version of the Boost library for compiling rippled. It directs users to specific instructions for upgrading Boost if necessary. Failure to meet this requirement will prevent successful compilation. ```bash # Minimum supported Boost version: v1.55 # Instructions for upgrading Boost: https://wiki.ripple.com/Ubuntu_build_instructions#Install_Boost ``` -------------------------------- ### rippled Configuration for NodeStore Compression Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This snippet shows an example configuration option within `rippled-example.cfg` for enabling NodeStore database compression. Compression can lead to improved performance and reduced disk space usage. ```ini # Option to compress the NodeStore db. More speed, less space. # See `rippled-example.cfg` for details (e.g., line 691 in v0.25.1). ``` -------------------------------- ### Install rippled on Red Hat Enterprise Linux / CentOS Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Installs or updates the rippled package on RHEL/CentOS systems. This command will prompt the user to confirm the GPG key fingerprint before proceeding with the installation. ```bash sudo yum install rippled Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.web-ster.com * epel: mirrors.syringanetworks.net * extras: ftp.osuosl.org * updates: mirrors.vcea.wsu.edu ripple-nightly/signature | 650 B 00:00:00 Retrieving key from https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key Importing GPG key 0xCCAFD9A2: Userid : "TechOps Team at Ripple " Fingerprint: c001 0ec2 05b3 5a33 10dc 90de 395f 97ff ccaf d9a2 From : https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key Is this ok [y/N]: y ``` -------------------------------- ### Configure ed25519 Library Build with CMake Source: https://github.com/xahau/xahaud/blob/dev/src/ed25519-donna/CMakeLists.txt This CMake script sets up the build environment for the ed25519 library. It defines the project name, language, output directories, and dependencies on OpenSSL. It also handles the installation of targets and header files. ```cmake cmake_minimum_required(VERSION 3.11) project(ed25519 LANGUAGES C ) if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output/$/lib") endif() if(NOT TARGET OpenSSL::SSL) find_package(OpenSSL) endif() add_library(ed25519 STATIC ed25519.c ) add_library(ed25519::ed25519 ALIAS ed25519) target_link_libraries(ed25519 PUBLIC OpenSSL::SSL) include(GNUInstallDirs) # NOTE for macos: # https://github.com/floodyberry/ed25519-donna/issues/29 # our source for ed25519-donna-portable.h has been # patched to workaround this. target_include_directories(ed25519 PUBLIC $ $ ) install( TARGETS ed25519 EXPORT ${PROJECT_NAME}-exports ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) install( EXPORT ${PROJECT_NAME}-exports DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" FILE ${PROJECT_NAME}-targets.cmake NAMESPACE ${PROJECT_NAME}:: ) install( FILES ed25519.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) ``` -------------------------------- ### Configure Ripple RPM Repository (Stable) with YUM Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This snippet configures the YUM package manager to use the stable Ripple RPM repository. It defines the repository name, enables it, and specifies the base URL and GPG key for accessing stable release packages. ```bash cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo [ripple-stable] name=XRP Ledger Packages enabled=1 gpgcheck=0 repo_gpgcheck=1 baseurl=https://repos.ripple.com/repos/rippled-rpm/stable/ gpgkey=https://repos.ripple.com/repos/rippled-rpm/stable/repodata/repomd.xml.key REPOFILE ``` -------------------------------- ### HTTP Upgrade Request Example for XRPL Peer Connection Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/overlay/README.md Demonstrates the structure of an HTTP/1.1 Upgrade request used by rippled peers to establish a connection. It includes essential headers like Upgrade, Connection, and custom fields for protocol-specific information. ```http GET / HTTP/1.1 User-Agent: rippled-1.4.0-b1+DEBUG Upgrade: RTXP/1.2, XRPL/2.0 Connection: Upgrade Connect-As: Peer Crawl: public Network-ID: 1 Network-Time: 619234489 Public-Key: n94MvLTiHQJjByfGZzvQewTxQP2qjF6shQcuHwCjh5WoiozBrdpX Session-Signature: MEUCIQCOO8tHOh/tgCSRNe6WwOwmIF6urZ5uSB8l9aAf5q7iRAIgA4aONKBZhpP5RuOuhJP2dP+2UIRioEJcfU4/m4gZdYo= Remote-IP: 192.0.2.79 Closed-Ledger: llRZSKqvNieGpPqbFGnm358pmF1aW96SDIUQcnMh6HI= Previous-Ledger: q4aKbP7sd5wv+EXArwCmQiWZhq9AwBl2p/hCtpGJNsc= ``` -------------------------------- ### HTTP Upgrade Response Example (Failure) for XRPL Peer Connection Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/overlay/README.md Shows an example of an HTTP/1.1 503 Service Unavailable response, indicating that a rippled peer cannot accept new connections, possibly due to resource limitations. It includes a JSON payload with potential peer IP addresses. ```http HTTP/1.1 503 Service Unavailable Server: rippled-0.27.0 Remote-Address: 63.104.209.13 Content-Length: 253 Content-Type: application/json {"peer-ips":["54.68.219.39:51235","54.187.191.179:51235", "107.150.55.21:6561","54.186.230.77:51235","54.187.110.243:51235", "85.127.34.221:51235","50.43.33.236:51235","54.187.138.75:51235"]} ``` -------------------------------- ### Create Cassandra Keyspace Command Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/app/reporting/README.md This command illustrates how to create a new keyspace in Cassandra, a NoSQL database used by Xahaud's reporting mode. It specifies the replication strategy and factor, with a recommendation of 3 for production environments and 1 for local setups. ```shell cqlsh [host] [port] > CREATE KEYSPACE rippled WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 3 }; ``` -------------------------------- ### Update YUM Repositories Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This command updates the YUM package manager's repository cache to fetch the latest package information from configured repositories. It ensures that the system is aware of the newest available versions and dependencies. ```bash sudo yum -y update ``` -------------------------------- ### Example GCC Toolchain Support for rippled Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Specifies the minimum supported version of the GCC compiler required to build rippled. It also provides a link to instructions for upgrading GCC on older Ubuntu versions. Using an unsupported GCC version may lead to compilation errors. ```bash # Minimum supported GCC version: v4.8 # Instructions for older Ubuntu versions: https://wiki.ripple.com/Ubuntu_build_instructions#Ubuntu_versions_older_than_13.10_:_Install_gcc_4.8 ``` -------------------------------- ### Xahaud Shard Database Configuration Example Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/nodestore/README.md This configuration snippet demonstrates how to set up the shard database paths in Xahaud. It includes settings for the main shard database (`shard_db`) and historical shard storage paths (`historical_shard_paths`). The configuration allows specifying paths for current, previous, and older shards, optimizing storage based on access frequency. It also mentions the NuDB type and the `max_historical_shards` setting. ```dosini # This is the persistent datastore for shards. It is important for the health # of the network that server operators shard as much as practical. # NuDB requires SSD storage. Helpful information can be found on # https://xrpl.org/history-sharding.html [shard_db] type=NuDB # A single path for storing # the current and previous # shards: # ------------------------- path=/var/lib/rippled/db/shards/nudb # Path where shards are stored # while being downloaded: # ---------------------------- download_path=/var/lib/rippled/db/shards/ # The number of historical shards to store. # The default value is 0, which means that # the server won't store any historical # shards - only the current and previous # shards will be stored. # ------------------------------------ max_historical_shards=100 # List of paths for storing older shards. [historical_shard_paths] /mnt/disk1 /mnt/disk2 /mnt/disk3 ``` -------------------------------- ### Configure secp256k1 Library Build with CMake Source: https://github.com/xahau/xahaud/blob/dev/src/secp256k1/CMakeLists.txt This CMake script configures the build for the secp256k1 C library. It specifies the minimum required CMake version, project name, language, output directory, and includes necessary definitions and options for compilation. The script also defines installation targets for the library and header files. ```cmake cmake_minimum_required(VERSION 3.11) project(secp256k1 LANGUAGES C ) if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output/$/lib") endif() add_library(secp256k1 STATIC src/secp256k1.c ) add_library(secp256k1::secp256k1 ALIAS secp256k1) include(GNUInstallDirs) target_compile_definitions(secp256k1 PRIVATE USE_NUM_NONE USE_FIELD_10X26 USE_FIELD_INV_BUILTIN USE_SCALAR_8X32 USE_SCALAR_INV_BUILTIN ) target_include_directories(secp256k1 PUBLIC $ PRIVATE $ ) target_compile_options(secp256k1 PRIVATE $<$:-wd4319> $<$>: -Wno-deprecated-declarations -Wno-unused-function > $<$:-Wno-nonnull-compare> ) install( TARGETS secp256k1 EXPORT ${PROJECT_NAME}-exports ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) install( EXPORT ${PROJECT_NAME}-exports DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" FILE ${PROJECT_NAME}-targets.cmake NAMESPACE ${PROJECT_NAME}:: ) install( FILES include/secp256k1.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) ``` -------------------------------- ### Configure Ripple RPM Repository (Unstable) with YUM Source: https://github.com/xahau/xahaud/blob/dev/docs/build/install.md This snippet configures the YUM package manager to use the unstable Ripple RPM repository for pre-release builds. It sets up the repository details including the name, enablement status, and the specific base URL and GPG key for unstable packages. ```bash cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo [ripple-unstable] name=XRP Ledger Packages enabled=1 gpgcheck=0 repo_gpgcheck=1 baseurl=https://repos.ripple.com/repos/rippled-rpm/unstable/ gpgkey=https://repos.ripple.com/repos/rippled-rpm/unstable/repodata/repomd.xml.key REPOFILE ``` -------------------------------- ### Rippled Configuration for Cluster Nodes Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/overlay/README.md Shows the configuration format for cluster nodes in the `rippled.cfg` file. Each member is listed under the `[cluster_nodes]` section, starting with its public node key, optionally followed by a friendly name. This configuration enables server discovery and communication within the cluster. ```ini [cluster_nodes] npub1... npub2... MyServer npub3... AnotherNode ``` -------------------------------- ### Xahaud Ledger Cleaner RPC Commands Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/app/ledger/README.md The ledger cleaner is controlled and monitored using RPC commands. These commands allow for starting, stopping, and configuring the cleaner's behavior, as well as reporting its status. ```Shell # Report status ledger_cleaner # Stop the cleaner ledger_cleaner stop # Clean a specific ledger ledger_cleaner ledger= # Set ledger range ledger_cleaner min_ledger= max_ledger= # Perform all operations ledger_cleaner full # Fix transaction entries ledger_cleaner fix_txns=true # Check for missing nodes ledger_cleaner check_nodes=true ``` -------------------------------- ### Get CPU Count for SCons Build Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This command counts the number of available CPUs on a Linux system. This count can then be used to optimize the SCons build process by specifying the number of parallel jobs. ```bash grep '^processor' /proc/cpuinfo | wc -l ``` -------------------------------- ### Run npm/integration tests without launching rippled Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This command enables running npm and integration tests without starting a full rippled server. It uses a running instance of rippled, potentially in a debugger, for testing purposes. Works with 'npm test' and 'mocha'. ```bash Run npm/integration tests without launching rippled, using a running instance of rippled (possibly in a debugger) instead. ``` -------------------------------- ### Include Project-Specific CMake Modules Source: https://github.com/xahau/xahaud/blob/dev/CMakeLists.txt Includes several project-specific CMake modules like RippledCore, RippledInstall, RippledCov, RippledMultiConfig, RippledDocs, and RippledValidatorKeys. These modules likely contain custom build logic, installation rules, and configuration for various project aspects. ```cmake ### include(RippledCore) include(RippledInstall) include(RippledCov) include(RippledMultiConfig) include(RippledDocs) include(RippledValidatorKeys) ``` -------------------------------- ### Remove Old Database Files for NuDB Backend Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md These commands are used to remove old SQLite database files when switching to the NuDB backend. This ensures a clean start for the new database, preventing conflicts with previous data. ```bash rm [database_path]/transaction.* rm [database_path]/ledger.* ``` -------------------------------- ### Recompile Boost with -fPIC Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md This section addresses a common linker error encountered when Conan downloads pre-compiled Boost libraries for Linux systems using GCC. The error indicates that the library requires position-independent code, which is missing. The solution involves rebuilding the dependency locally by using the `--build boost` flag during `conan install` to ensure the library is compiled with the necessary -fPIC flag. ```shell conan install --build boost ``` -------------------------------- ### HTTP Upgrade Response Example (Success) for XRPL Peer Connection Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/overlay/README.md Illustrates a successful HTTP/1.1 101 Switching Protocols response from a rippled peer. This response indicates that the server is willing to switch to the requested protocol after a successful handshake. ```http HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: RTXP/1.2 Connect-As: Peer Server: rippled-1.3.1 Crawl: public Public-Key: n9K1ZXXXzzA3dtgKBuQUnZXkhygMRgZbSo3diFNPVHLMsUG5osJM Session-Signature: MEQCIHMlLGTcGyPvHji7WY2nRM2B0iSBnw9xeDUGW7bPq7IjAiAmy+ofEu+8nOq2eChRTr3wjoKi3EYRqLgzP+q+ORFcig== Network-Time: 619234797 Closed-Ledger: h7HL85W9ywkex+G7p42USVeV5kE04CWK+4DVI19Of8I= Previous-Ledger: EPvIpAD2iavGFyyZYi8REexAXyKGXsi1jMF7OIBY6/Y= ``` -------------------------------- ### Sign RPC Command Example Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md The 'sign' RPC command in rippled allows signing transactions with either an account's master or regular secret key. This is a fundamental operation for transaction submission and requires appropriate credentials. ```json { "method": "sign", "params": [ { "secret": "master secret key or regular secret key", "tx_json": { "TransactionType": "Payment", "Account": "sender account ID", "Amount": "1000000", "Destination": "destination account ID" } } ] } ``` -------------------------------- ### Create Build Directory with Conan Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md This snippet demonstrates how to create a build directory and navigate into it. This is a preliminary step before using Conan to manage build configurations. The directory name is flexible, but it's crucial to be in this directory when invoking Conan. ```bash mkdir .build cd .build ``` -------------------------------- ### Submit Transactions to Validators in C++ Source: https://github.com/xahau/xahaud/blob/dev/src/test/csf/README.md This code iterates through a collection of validator peers and submits each peer's ID as a transaction. This is a basic example for transaction submission; more advanced simulations might use a Submitter class for varied submission intervals and targets. ```c++ // everyone submits their own ID as a TX and relay it to peers for (Peer * p : validators) p->submit(Tx(static_cast(p->id))); ``` -------------------------------- ### Example Ed25519 Fuzzing Error Output Source: https://github.com/xahau/xahaud/blob/dev/src/ed25519-donna/fuzz/README.md This output demonstrates an error scenario during ed25519 fuzzing. It shows the random data (secret key 'sk' and message 'm') used, the output from the reference implementation ('ref10') including public key ('pk'), signature ('sig'), and validation status, and the output from the 'ed25519-donna' implementation with differences highlighted in public key ('pk diff') and signature ('sig diff'). ```text sk: 0x3b,0xb7,0x17,0x7a,0x66,0xdc,0xb7,0x9a,0x90,0x25,0x07,0x99,0x96,0xf3,0x92,0xef, 0x78,0xf8,0xad,0x6c,0x35,0x87,0x81,0x67,0x03,0xe6,0x95,0xba,0x06,0x18,0x7c,0x9c, m: 0x7c,0x8d,0x3d,0xe1,0x92,0xee,0x7a,0xb8,0x4d,0xc9,0xfb,0x02,0x34,0x1e,0x5a,0x91, 0xee,0x01,0xa6,0xb8,0xab,0x37,0x3f,0x3d,0x6d,0xa2,0x47,0xe3,0x27,0x93,0x7c,0xb7, 0x77,0x07,0xb6,0x88,0x41,0x22,0xf3,0x3f,0xce,0xcb,0x6b,0x3e,0x2b,0x23,0x68,0x7f, 0x5b,0xb9,0xda,0x04,0xbb,0xae,0x42,0x50,0xf5,0xe9,0xc5,0x11,0xbd,0x52,0x76,0x98, 0xf1,0x87,0x09,0xb9,0x89,0x0a,0x52,0x69,0x01,0xce,0xe0,0x4a,0xa6,0x46,0x5a,0xe1, 0x63,0x14,0xe0,0x81,0x52,0xec,0xcd,0xcf,0x70,0x54,0x7d,0xa3,0x49,0x8b,0xf0,0x89, 0x70,0x07,0x12,0x2a,0xd9,0xaa,0x16,0x01,0xb2,0x16,0x3a,0xbb,0xfc,0xfa,0x13,0x5b, 0x69,0x83,0x92,0x70,0x95,0x76,0xa0,0x8e,0x16,0x79,0xcc,0xaa,0xb5,0x7c,0xf8,0x7a, ref10: pk: 0x71,0xb0,0x5e,0x62,0x1b,0xe3,0xe7,0x36,0x91,0x8b,0xc0,0x13,0x36,0x0c,0xc9,0x04, 0x16,0xf5,0xff,0x48,0x0c,0x83,0x6b,0x88,0x53,0xa2,0xc6,0x0f,0xf7,0xac,0x42,0x04, sig: 0x3e,0x05,0xc5,0x37,0x16,0x0b,0x29,0x30,0x89,0xa3,0xe7,0x83,0x08,0x16,0xdd,0x96, 0x02,0xfa,0x0d,0x44,0x2c,0x43,0xaa,0x80,0x93,0x04,0x58,0x22,0x09,0xbf,0x11,0xa5, 0xcc,0xa5,0x3c,0x9f,0xa0,0xa4,0x64,0x5a,0x4a,0xdb,0x20,0xfb,0xc7,0x9b,0xfd,0x3f, 0x08,0xae,0xc4,0x3c,0x1e,0xd8,0xb6,0xb4,0xd2,0x6d,0x80,0x92,0xcb,0x71,0xf3,0x02, valid: yes ed25519-donna: pk diff: ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,____, ____,____,____,____,____,____,____,____,____,____,____,____,____,____,____,____, sig diff: 0x2c,0xb9,0x25,0x14,0xd0,0x94,0xeb,0xfe,0x46,0x02,0xc2,0xe8,0xa3,0xeb,0xbf,0xb5, 0x72,0x84,0xbf,0xc1,0x8a,0x32,0x30,0x99,0xf7,0x58,0xfe,0x06,0xa8,0xdc,0xdc,0xab, 0xb5,0x57,0x03,0x33,0x87,0xce,0x54,0x55,0x6a,0x69,0x8a,0xc4,0xb7,0x2a,0xed,0x97, 0xb4,0x68,0xe7,0x52,0x7a,0x07,0x55,0x3b,0xa2,0x94,0xd6,0x5e,0xa1,0x61,0x80,0x08, valid: no ``` -------------------------------- ### Sim and PeerGroup Initialization in C++ Source: https://github.com/xahau/xahaud/blob/dev/src/test/csf/README.md Illustrates the initialization of the main simulation object 'Sim' and the creation of 'PeerGroup' objects to manage collections of peers. It shows how to combine PeerGroups and configure individual peer behavior, such as setting a peer to not run as a validator. ```c++ Sim sim; PeerGroup validators = sim.createGroup(5); PeerGroup center = sim.createGroup(1); PeerGroup network = validators + center; center[0]->runAsValidator = false; ``` -------------------------------- ### NodeStore Benchmark with Custom Arguments Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/nodestore/README.md This command demonstrates how to execute the NodeStore benchmarks with custom configuration parameters using the --unittest-arg flag. This allows for more specific testing scenarios and performance analysis. ```bash $rippled --unittest=NodeStoreTiming --unittest-arg="config_param=value" ``` -------------------------------- ### Recommended RocksDB Configuration for rippled.cfg Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This configuration block provides recommended settings for the RocksDB backend in the 'rippled.cfg' file, optimizing performance and resource usage. ```ini [node_db] type=RocksDB path=db/hashnode open_files=1200 filter_bits=12 cache_mb=128 file_size_mb=8 file_size_mult=2 ``` -------------------------------- ### Export Conan Recipes Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md Commands to export Conan recipes for external dependencies like Snappy and SOCI. This makes these libraries available for Conan to manage during the build process. ```bash conan export external/snappy snappy/1.1.10@xahaud/stable ``` ```bash conan export external/soci soci/4.0.3@xahaud/stable ``` -------------------------------- ### Test Rippled (Multi-Config) Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md These commands run the 'rippled' unit tests for multi-configuration builds. The executable is located within the specific configuration's subdirectory (e.g., Release or Debug). ```bash ./Release/rippled --unittest ./Debug/rippled --unittest ``` -------------------------------- ### Configure Conan Default Profile Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md Commands to configure the default Conan profile. This includes detecting the build environment, setting the C++ standard to C++20, specifying the C++ standard library ABI, and setting the architecture to x86_64. ```bash conan profile new default --detect ``` ```bash conan profile update settings.compiler.cppstd=20 default ``` ```bash conan profile update settings.compiler.libcxx=libstdc++11 default ``` ```bash conan profile update settings.arch=x86_64 default ``` -------------------------------- ### Generate CMake Build Files with Conan Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md This command generates CMake build files for specified configurations using Conan. It supports both single-configuration (e.g., Makefiles, Ninja) and multi-configuration (e.g., Visual Studio) generators. The `--build missing` flag ensures all missing dependencies are built, and `--settings` allows specifying build types like Release and Debug. Running this multiple times with different `build_type` settings is necessary for multi-configuration generators. ```bash conan install .. --output-folder . --build missing --settings build_type=Release conan install .. --output-folder . --build missing --settings build_type=Debug ``` -------------------------------- ### Build and test with scons targets Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md This command allows building and testing the project using one or more scons targets. It is useful for development and testing workflows. ```bash scons -j\[number of CPUs - 1\] ``` -------------------------------- ### Windows Build Configuration for Ed25519 Fuzzing Source: https://github.com/xahau/xahaud/blob/dev/src/ed25519-donna/fuzz/README.md Instructions for setting up an Ed25519 fuzzing project on Windows. This involves adding specific C files to the project and defining preprocessor macros like ED25519_REFHASH and ED25519_SSE2 if using OpenSSL or SSE2 support respectively. These definitions are crucial for the build process. ```c #define ED25519_REFHASH #define ED25519_SSE2 ``` -------------------------------- ### Graceful Shutdown Initiation - C++ Source: https://github.com/xahau/xahaud/blob/dev/src/ripple/net/ShardDownloader.md This C++ code snippet shows how a graceful shutdown is initiated by calling the stop() method on ShardArchiveHandler. It manages the downloader instance, resets it, and signals the completion of the stop process. ```C++ void ShardArchiveHandler::stop() { std::lock_guard lock(m_); if (downloader_) { downloader_->stop(); downloader_.reset(); } stopped(); } ``` -------------------------------- ### Checkout Git Branches Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md Commands to checkout different branches of the Git repository. 'master' for stable releases, 'release' for release candidates, and 'develop' for the latest features. ```bash git checkout master ``` ```bash git checkout release ``` ```bash git checkout develop ``` -------------------------------- ### Update rippled on Ubuntu / Debian Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Updates the package list and installs the rippled package on Ubuntu/Debian systems. This process involves downloading and adding a new GPG public key to the system's trusted keys. ```bash wget -q -O - "https://repos.ripple.com/repos/api/gpg/key/public" | \ sudo apt-key add - sudo apt -y update sudo apt -y install rippled ``` -------------------------------- ### Test Rippled (Single-Config) Source: https://github.com/xahau/xahaud/blob/dev/BUILD.md This command runs the 'rippled' unit tests for single-configuration builds. The executable is expected to be in the current directory. ```bash ./rippled --unittest ``` -------------------------------- ### Improve Process Startup Logging Source: https://github.com/xahau/xahaud/blob/dev/RELEASENOTES.md Enhances logging during process startup to provide more detailed information. This aids in troubleshooting startup-related issues and monitoring the initialization process. ```text - Improve logging during process startup (7c24f7b1) ``` -------------------------------- ### Build and Run Ed25519 Sanity Tests Source: https://github.com/xahau/xahaud/blob/dev/src/ed25519-donna/README.md Builds and runs basic sanity tests and benchmarks for the Ed25519 library. This involves compiling ed25519.c with the `-DED25519_TEST` flag and linking it with test.c. ```bash Building `ed25519.c` with `-DED25519_TEST` and linking with `test.c` ``` -------------------------------- ### Test Network Validator Configuration Source: https://github.com/xahau/xahaud/blob/dev/cfg/validators-example.txt Configuration for using the test network, including validator list sites and keys. This setup allows a rippled instance to connect to and validate on the XRP test network. Ensure these configurations are only used for testing purposes. ```text # To use the test network (see https://xrpl.org/connect-your-rippled-to-the-xrp-test-net.html), # use the following configuration instead: # # [validator_list_sites] # https://vl.altnet.rippletest.net # # [validator_list_keys] # ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860 # # [import_vl_keys] # ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860 ```