### Setup and Regenerate Code Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Commands to set up a virtual environment and install dependencies for code generation, followed by regenerating the protocol wrapper classes. These commands should be run when macro definition files or generation scripts are modified. ```bash cmake --build . --target setup_code_gen # create venv and install dependencies (once) ``` ```bash cmake --build . --target code_gen # regenerate code ``` -------------------------------- ### Install xrpld from Source using CMake Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Use this command to install xrpld and libxrpl from a source build using CMake's --install mode. The --prefix flag specifies the installation directory. ```bash cmake --install . --prefix /opt/local ``` -------------------------------- ### Start xrpld Service Manually Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md If the xrpld service does not start automatically, use this command to start it manually. ```bash sudo systemctl start xrpld.service ``` -------------------------------- ### Install and Use Pre-commit Hooks Source: https://github.com/xrplf/rippled/blob/develop/CONTRIBUTING.md Install pre-commit and its hooks to automatically format and lint code before each commit. This ensures code consistency. ```bash pip3 install pre-commit pre-commit install ``` -------------------------------- ### Install xrpld Package Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Install the xrpld software package using the APT package manager. ```bash sudo apt -y install xrpld ``` -------------------------------- ### Install APT Utilities Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Install necessary utilities for managing APT packages, including transport for HTTPS, certificate handling, and downloading files. ```bash sudo apt install -y apt-transport-https ca-certificates wget gnupg ``` -------------------------------- ### Install xrpld Package Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Install the xrpld package using YUM. ```bash sudo yum install -y xrpld ``` -------------------------------- ### Install Boost with Conan Source: https://github.com/xrplf/rippled/wiki/Fixing-rippled-build-errors Command to install a specific version of Boost using Conan after adjusting the profile settings. ```bash conan install boost/1.77.0@ --build ``` -------------------------------- ### Enable xrpld Service Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Configure the xrpld service to automatically start when the system boots. ```bash sudo systemctl enable xrpld.service ``` -------------------------------- ### Install and Configure Specific Xcode Version Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs a specific Xcode version and sets it as the default toolchain for the current session and persistently. ```bash # Extract the .xip file and rename for version management # Example: Xcode_16.2.app # Move to Applications directory sudo mv Xcode_16.2.app /Applications/ # Set as default toolchain (persistent) sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer # Set as environment variable (temporary) export DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer ``` -------------------------------- ### Install Conan profiles Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Installs the default Conan profiles from the specified directory. Ensure your Conan configuration directory is correctly set. ```bash conan config install conan/profiles/ -tf $(conan config home)/profiles/ ``` -------------------------------- ### Clean Build Directory Setup Source: https://github.com/xrplf/rippled/blob/develop/docs/build/sanitizers.md Prepare a clean build directory for the xrpld project before building with sanitizers. ```bash cd /path/to/rippled rm -rf .build mkdir .build cd .build ``` -------------------------------- ### Example Conan Profile Configuration Source: https://github.com/xrplf/rippled/wiki/Conan-troubleshooting A full example of a Conan profile, including settings, options, and build flags, suitable for specific project requirements like disabling concepts. ```ini [settings] os=Macos os_build=Macos arch=x86_64 arch_build=x86_64 compiler=apple-clang compiler.version=15 compiler.libcxx=libc++ build_type=Release compiler.cppstd=20 [options ] boost:extra_b2_flags="define=BOOST_ASIO_HAS_STD_INVOKE_RESULT" [conf] tools.build:cflags=['-DBOOST_ASIO_HAS_STD_INVOKE_RESULT'] tools.build:cxxflags=['-DBOOST_ASIO_HAS_STD_INVOKE_RESULT'] tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"] [build_requires] [env] CXXFLAGS=-DBOOST_ASIO_DISABLE_CONCEPTS CFLAGS=-DBOOST_ASIO_HAS_STD_INVOKE_RESULT CXXFLAGS=-DBOOST_ASIO_HAS_STD_INVOKE_RESULT ``` -------------------------------- ### Install CMake with Homebrew Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs CMake using the Homebrew package manager. ```bash brew install cmake ``` -------------------------------- ### Conan Install and CMake Build Configuration Source: https://github.com/xrplf/rippled/blob/develop/docs/build/depend.md This command sequence demonstrates how to install dependencies using Conan, generate CMake toolchain files, and then configure and build your project with CMake. ```bash mkdir .build cd .build mkdir -p build/generators conan install \ --install-folder build/generators \ --build missing \ --settings build_type=Release \ .. cmake \ -DCMAKE_TOOLCHAIN_FILE=build/generators/conan_toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release \ .. cmake --build . --parallel ``` -------------------------------- ### Install Python, Pyenv, and Conan via Homebrew Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs Homebrew, Python 3.11, and Conan using pyenv for Python version management. ```bash /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.11 pyenv global 3.11 eval "$(pyenv init -)" pip install 'conan' ``` -------------------------------- ### Start rippled with a specific ledger hash Source: https://github.com/xrplf/rippled/wiki/Starting-a-test---parallel-network-from-an-existing-ledger-state Use this command to start the rippled server, initializing it with the state of a specified ledger hash. This is crucial for cloning an existing ledger state. ```bash rippled --ledger ``` -------------------------------- ### Example Nix Development Shell Usage Source: https://github.com/xrplf/rippled/blob/develop/docs/build/nix.md Demonstrates how to enter the Nix development shell using specific compilers like GCC 14 or Clang 19, or the default compiler for the platform. ```bash # Use GCC 14 nix develop .#gcc14 # Use Clang 19 nix develop .#clang19 # Use default for your platform nix develop ``` -------------------------------- ### Link Executable with xrpl Library Source: https://github.com/xrplf/rippled/blob/develop/tests/conan/CMakeLists.txt Defines an executable target named 'example', links it to the 'xrpl::libxrpl' library, and specifies its source files. ```cmake find_package(xrpl CONFIG REQUIRED) add_executable(example) target_sources(example PRIVATE src/example.cpp) target_link_libraries(example PRIVATE xrpl::libxrpl) ``` -------------------------------- ### Create Build Directory Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Create a dedicated directory for build artifacts and navigate into it. This directory will be used by Conan as the installation folder. ```bash mkdir .build cd .build ``` -------------------------------- ### Conan Install with Sanitizers Source: https://github.com/xrplf/rippled/blob/develop/docs/build/sanitizers.md Install dependencies using Conan with sanitizer instrumentation enabled. Ensure the SANITIZERS environment variable is set before running this command. ```bash SANITIZERS=address,undefinedbehavior conan install .. --output-folder . --build missing --settings build_type=Debug --profile:all sanitizers ``` -------------------------------- ### Build xrpld with jemalloc Source: https://github.com/xrplf/rippled/blob/develop/docs/HeapProfiling.md Use the scons command with the profile-jemalloc argument to link xrpld with the jemalloc library. Specify the jemalloc installation directory. ```bash $ scons profile-jemalloc=/usr/local ``` ```bash $ scons clang profile-jemalloc=/opt/local ``` -------------------------------- ### Start rippled Docker Container for Devnet Source: https://github.com/xrplf/rippled/wiki/Running-rippled-with-Docker Starts a rippled Docker container in detached mode and connects it to the devnet. Use this to quickly set up a node for testing. ```bash # Start rippled connecting to the devnet docker run --rm --detach --name rippled_devnet rippleci/rippled:2.2.0 dev ``` -------------------------------- ### Example NuDB Configuration in rippled.cfg Source: https://github.com/xrplf/rippled/wiki/server_state-stuck-in-connected-or-syncing This configuration snippet shows how to set up NuDB as the node database in your `rippled.cfg` file. Ensure the specified path is writable by the rippled process and is empty. ```ini [node_db] type=nudb path=/var/lib/rippled/dbnudb/nudb advisory_delete=0 [database_path] /var/lib/rippled/dbnudb ``` -------------------------------- ### Example HTTP Upgrade Request Source: https://github.com/xrplf/rippled/blob/develop/src/xrpld/overlay/README.md This is an example of an HTTP request used to initiate an upgrade to the XRP Ledger protocol. It includes custom headers for protocol-specific information. ```http GET / HTTP/1.1 User-Agent: xrpld-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= ``` -------------------------------- ### Install Conan Packages with Missing Build Source: https://github.com/xrplf/rippled/wiki/Conan-troubleshooting Use this command to install Conan packages, ensuring missing dependencies are built. It specifies the output folder and build type. ```bash conan install .. --output-folder . --build missing --settings build_type=Debug ``` -------------------------------- ### Example HTTP Upgrade Response (Failure: no slots available) Source: https://github.com/xrplf/rippled/blob/develop/src/xrpld/overlay/README.md This is an example of an HTTP 503 Service Unavailable response, indicating that the server cannot accept new connections, likely due to resource limitations. It includes a list of peer IPs. ```http HTTP/1.1 503 Service Unavailable Server: xrpld-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"]} ``` -------------------------------- ### Example HTTP Upgrade Response (Success) Source: https://github.com/xrplf/rippled/blob/develop/src/xrpld/overlay/README.md This is an example of a successful HTTP 101 Switching Protocols response, indicating that the server has agreed to upgrade the connection to the XRP Ledger protocol. ```http HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: RTXP/1.2 Connect-As: Peer Server: xrpld-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= ``` -------------------------------- ### Install Dependencies with Conan Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Use Conan to install dependencies and generate CMake build files. Specify the build type (Release or Debug) for different configurations. The `--build missing` flag ensures all required dependencies are built. ```bash conan install .. --output-folder . --build missing --settings build_type=Release ``` ```bash conan install .. --output-folder . --build missing --settings build_type=Debug ``` -------------------------------- ### Install Ccache on Windows with Specific Version Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md When encountering std::bad_alloc errors during compilation on Windows, install a specific known-working version of ccache using Chocolatey. ```powershell choco install ccache --version 4.11.3 --allow-downgrade ``` -------------------------------- ### Check Database Size Source: https://github.com/xrplf/rippled/wiki/Reducing-disk-usage-with-online_delete Verify the disk space occupied by the rippled database. This example shows how to list the contents of the database directory and their sizes. ```bash /rippled2/rippled/db # ls -alh total 887G -rw-r--r-- 1 root root 882G Feb 9 22:07 transaction.db ... ``` -------------------------------- ### Conan Install for Subdirectory Project and CMake Build Source: https://github.com/xrplf/rippled/blob/develop/docs/build/depend.md This command sequence installs dependencies for a project using a Git submodule and configures the CMake build with the Conan toolchain. ```bash mkdir .build cd .build conan install \ --output-folder . \ --build missing \ --settings build_type=Release \ ../submodules/rippled cmake \ -DCMAKE_TOOLCHAIN_FILE=build/generators/conan_toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release \ .. cmake --build . --parallel ``` -------------------------------- ### Start rippled with amendments enabled and silent Source: https://github.com/xrplf/rippled/wiki/Starting-a-test-parallel-network-with-amendments-pre-enabled Use this command to start a rippled instance with amendments enabled from the genesis ledger, running silently and using a specified configuration file. ```bash rippled --start --net --silent --conf /etc/opt/ripple/rippled.cfg ``` -------------------------------- ### Configure and Build Coverage Report with CMake Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Use this command to configure the build with coverage enabled and then build the coverage target. Ensure you are in the build directory and have installed dependencies via conan. ```bash cd .build conan install .. --output-folder . --build missing --settings build_type=Debug cmake -DCMAKE_BUILD_TYPE=Debug -Dcoverage=ON -Dxrpld=ON -Dtests=ON -Dcoverage_test_parallelism=2 -Dcoverage_format=html-details -Dcoverage_extra_args="--json coverage.json" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake .. cmake --build . --target coverage ``` -------------------------------- ### Basic XRPL Consensus Simulation Setup Source: https://github.com/xrplf/rippled/blob/develop/src/test/csf/README.md Sets up a simulation with 5 validators and 1 central hub, configuring their trust relationships and network connections. It then simulates transaction submission and measures the simulation duration. ```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()); ``` -------------------------------- ### Build Package Script Help Source: https://github.com/xrplf/rippled/blob/develop/package/README.md Display help information for the `build_pkg.sh` script, showing available flags, their corresponding environment variables, default values, and purpose. ```bash ./package/build_pkg.sh --help ``` -------------------------------- ### Install LLVM via Homebrew on macOS Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs LLVM version 21 using Homebrew on macOS. ```bash brew install llvm@21 ``` -------------------------------- ### Create Directories and Copy Configuration Source: https://github.com/xrplf/rippled/wiki/Fixing-rippled-build-errors Ensures necessary directories exist and copies the rippled configuration file. Use this when the build process fails due to missing configuration files. ```bash sudo mkdir -p /etc/opt/ripple/ sudo cp /path/to/your/rippled.cfg /etc/opt/ripple/ ``` -------------------------------- ### Check xrpld Service Status Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md Check the status of the xrpld service to ensure it has started automatically. If not, you can start it manually. ```bash systemctl status xrpld.service ``` -------------------------------- ### RelationalDatabase.cpp File Contents Source: https://github.com/xrplf/rippled/blob/develop/src/xrpld/app/rdb/README.md Implements the static method `RelationalDatabase::init` for initializing a `RelationalDatabase` instance. ```plaintext RelationalDatabase.cpp | Implements the static method `RelationalDatabase::init` which is used to initialize an instance of `RelationalDatabase` ``` -------------------------------- ### Install LLVM and Clang-Tidy on Linux Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs LLVM version 21 and clang-tidy-21 on Debian 12 using the official LLVM apt repository. ```bash wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 21 sudo apt install --yes clang-tidy-21 ``` -------------------------------- ### Conan Install with Build Type Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md When installing dependencies with Conan, specify the build type using the --settings option. This ensures consistency with CMake. ```bash conan install --settings build_type=Debug ``` -------------------------------- ### Stop and restart rippled with systemd Source: https://github.com/xrplf/rippled/wiki/Starting-a-test-parallel-network-with-amendments-pre-enabled Instructions for stopping a rippled process running in the foreground and then starting it using systemd. Assumes amendments were enabled on initial start. ```bash # Stop rippled in foreground: make sure the rippled process is killed. Then start with systemd ``` -------------------------------- ### Enter Nix Development Shell Source: https://github.com/xrplf/rippled/blob/develop/docs/build/nix.md Use this command to enter the default Nix development shell for xrpld. It downloads and configures all necessary tools and compilers. The first run may take time. ```bash nix --experimental-features 'nix-command flakes' develop ``` -------------------------------- ### Initialize Sim and Peer Groups Source: https://github.com/xrplf/rippled/blob/develop/src/test/csf/README.md Initializes the simulation environment and creates distinct groups of peers. One peer in the 'center' group is configured not to 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; ``` -------------------------------- ### Configure NodeStore Backend Source: https://github.com/xrplf/rippled/blob/develop/include/xrpl/nodestore/README.md Specify the NodeStore backend and its parameters in the [node_db] section of the configuration file. The 'type' parameter selects the database engine, 'path' defines the storage location, and 'compression' enables or disables data compression. ```ini type=RocksDB path=rocksdb compression=1 ``` -------------------------------- ### Install GCC and Dependencies on Debian 12 Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Installs GCC version 12 and essential build tools like Python, Git, CMake, and Ninja on Debian 12. It also configures alternatives for C++ compilers. ```bash export GCC_RELEASE=12 sudo apt update sudo apt install --yes gcc-${GCC_RELEASE} g++-${GCC_RELEASE} python3-pip \ python-is-python3 python3-venv python3-dev curl wget ca-certificates \ git build-essential cmake ninja-build libc6-dev sudo pip install --break-system-packages conan sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${GCC_RELEASE} 999 sudo update-alternatives --install \ /usr/bin/gcc gcc /usr/bin/gcc-${GCC_RELEASE} 100 \ --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_RELEASE} \ --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-${GCC_RELEASE} \ --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-${GCC_RELEASE} \ --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-${GCC_RELEASE} \ --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_RELEASE} \ --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${GCC_RELEASE} \ --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${GCC_RELEASE} \ --slave /usr/bin/lto-dump lto-dump /usr/bin/lto-dump-${GCC_RELEASE} sudo update-alternatives --auto cc sudo update-alternatives --auto gcc ``` -------------------------------- ### Run NodeStore Timing Benchmarks Source: https://github.com/xrplf/rippled/blob/develop/include/xrpl/nodestore/README.md Execute the NodeStore.Timing test to compare the performance of different nodestore backends. Alternate DB configuration parameters can be passed using the --unittest-arg flag. ```bash $xrpld --unittest=NodeStoreTiming ``` -------------------------------- ### Create Test Helper Library Source: https://github.com/xrplf/rippled/blob/develop/src/tests/libxrpl/CMakeLists.txt Defines a static library 'xrpl.helpers.test' to hold common test utility sources. It specifies private sources, public include directories, and links against libxrpl and GTest. ```cmake add_library(xrpl.helpers.test STATIC) target_sources( xrpl.helpers.test PRIVATE helpers/Account.cpp helpers/TestSink.cpp helpers/TxTest.cpp ) target_include_directories(xrpl.helpers.test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(xrpl.helpers.test PUBLIC xrpl.libxrpl gtest::gtest) ``` -------------------------------- ### Wallet.h/.cpp File Contents Source: https://github.com/xrplf/rippled/blob/develop/src/xrpld/app/rdb/README.md Defines and implements methods for interacting with Wallet SQLite databases. ```plaintext Wallet.[h|cpp] | Defines/Implements methods for interacting with Wallet SQLite databases ``` -------------------------------- ### Build xrpld Packages via CMake Source: https://github.com/xrplf/rippled/blob/develop/package/README.md Build xrpld packages directly on the host using CMake targets. This method does not require a Docker container but relies on the host having 'rpmbuild' or 'dpkg-buildpackage' installed. The packaging script installs to FHS-standard paths. ```bash cmake \ -Dxrpld=ON \ -Dxrpld_version=2.4.0-local \ -Dtests=OFF \ .. cmake --build . --target package ``` -------------------------------- ### Fetch XRPL Repository Source: https://github.com/xrplf/rippled/blob/develop/docs/build/install.md After adding the repository, fetch the latest package information from the XRPL repository. ```bash sudo apt -y update ``` -------------------------------- ### Check Git Version on macOS Source: https://github.com/xrplf/rippled/blob/develop/docs/build/environment.md Verifies that Git is installed and accessible. ```bash git --version ``` -------------------------------- ### Check Conan Version Source: https://github.com/xrplf/rippled/wiki/Conan-troubleshooting Verifies the installed version of the Conan package manager. ```bash conan --version ``` -------------------------------- ### Checkout release branch Source: https://github.com/xrplf/rippled/blob/develop/BUILD.md Switch to the release branch to build the latest release candidate. ```bash git checkout release ``` -------------------------------- ### Build xrpld Packages Locally with Docker Source: https://github.com/xrplf/rippled/blob/develop/package/README.md This command builds xrpld packages locally using Docker, mirroring the CI process. It requires an xrpld binary to be present at 'build/xrpld'. The package format is inferred from the container's package manager. ```bash IMAGE=$(jq -r ' .os | map(select(.package == true))[0] | "ghcr.io/xrplf/ci/\(.distro_name)-\(.distro_version):\(.compiler_name)-\(.compiler_version)-sha-\(.image_sha)" ' .github/scripts/strategy-matrix/linux.json) VERSION=2.4.0-local PKG_RELEASE=1 docker run --rm \ -v "$(pwd):/src" \ -w /src \ "$IMAGE" \ ./package/build_pkg.sh --pkg-version "$VERSION" --pkg-release "$PKG_RELEASE" ``` -------------------------------- ### Check Clang Version Source: https://github.com/xrplf/rippled/wiki/Conan-troubleshooting Displays the version and target information for the installed Apple Clang compiler. ```bash clang --version ``` -------------------------------- ### Clean and Build rippled Source: https://github.com/xrplf/rippled/wiki/Fixing-rippled-build-errors Steps to clean previous build artifacts, set up Conan, configure CMake, and build the rippled project. ```bash git checkout 2.2.3 ``` ```bash rm -rf .build mkdir .build cd .build ``` ```bash START=$(date +%s) && \ conan install .. --output-folder . --build missing --settings build_type=Debug && \ END=$(date +%s) && \ echo "Setting up Conan took $((END-START)) seconds" ``` ```bash cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -Dxrpld=ON -Dtests=ON .. ``` ```bash START=$(date +%s) && \ cmake --build . -j $(nproc) && \ END=$(date +%s) && \ echo "Building rippled took $((END-START)) seconds" ``` ```bash START=$(date +%s) && \ ./rippled --unittest --unittest-jobs $(if [ $(uname) = 'Darwin' ]; then echo '1'; else echo "$(nproc)"; fi) && \ END=$(date +%s) && \ echo "Testing rippled took $((END-START)) seconds" ``` -------------------------------- ### Print Simulation Duration Source: https://github.com/xrplf/rippled/blob/develop/src/test/csf/README.md Prints the total duration of the simulation by subtracting the start time from the stop time of the SimDurationCollector. ```c++ std::cout << (simDur.stop - simDur.start).count() << std::endl; ``` -------------------------------- ### Prepare Release Branch and Update Version Source: https://github.com/xrplf/rippled/blob/develop/CONTRIBUTING.md Creates a new 'release-next' branch from 'upstream/develop' and updates the version string in the BuildInfo.cpp file. This is a prerequisite for making a new release. ```bash git fetch upstreams git checkout --no-track -B release-next upstream/develop v="A.B.C-bD" build=$( find -name BuildInfo.cpp ) sed 's/\(^.*versionString =\).*$/\1 "'${v}'"/' ${build} > version.cpp && mv -vi version.cpp ${build} git diff git add ${build} git commit -S -m "Set version to ${v}" # You could use your "origin" repo, but some CI tests work better on upstream. git push upstream-push git fetch upstreams git branch --set-upstream-to=upstream/release-next ``` -------------------------------- ### Exporting a Local libxrpl Recipe with Conan Source: https://github.com/xrplf/rippled/blob/develop/docs/build/depend.md If the desired libxrpl version is not available on ConanCenter, you can export the recipe directly from the xrpld project. ```bash conan export ```