mirror of
https://github.com/Xahau/xahau-web.git
synced 2026-08-19 01:01:42 +00:00
Merge pull request #77 from jscottbranson/main
Update Linux Build Instructions for Conan2
This commit is contained in:
@@ -288,12 +288,12 @@ export default defineConfig({
|
||||
'docs/infrastructure/interacting',
|
||||
'docs/infrastructure/advanced-configuration',
|
||||
{
|
||||
label: 'Building Xahau (Dev)',
|
||||
label: 'Build xahaud (Advanced)',
|
||||
collapsed: true,
|
||||
items: [
|
||||
'docs/infrastructure/building-xahau',
|
||||
'docs/infrastructure/building-xahau/ubuntu-22-04',
|
||||
'docs/infrastructure/building-xahau/mac-os-13-5-2',
|
||||
'docs/infrastructure/build-xahaud',
|
||||
'docs/infrastructure/build-xahaud/linux',
|
||||
'docs/infrastructure/build-xahaud/macos',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
46
src/content/docs/docs/infrastructure/build-xahaud/index.mdx
Normal file
46
src/content/docs/docs/infrastructure/build-xahaud/index.mdx
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Build xahaud
|
||||
description: Setting Up the xahaud Build Environment and Compiling xahaud
|
||||
---
|
||||
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
Building software, such as xahaud, from the openly available source code is a complex process that requires in-depth knowledge and experience. Thus, there are multiple approaches that developers might take, depending on the environment (e.g., Linux, MacOS, Windows). The instructions in the following documentation chapters are meant to simplify and expand on those in the [xahaud GitHub repository](https://github.com/Xahau/xahaud/blob/dev/BUILD.md). Developers might need to deviate from these instructions to accomplish specific tasks or to ensure compatibility with specific operating systems.
|
||||
|
||||
The following articles detail the process of setting up a build environment and building xahaud across various operating system environments.
|
||||
|
||||
<Aside type="danger">
|
||||
Building software from source code is a complex task requiring advanced technical knowledge and experience. It is possible to make changes at an operating system level that cannot be easily recovered from. Undertake the build process at your own risk. This documentation is designed to guide, rather than be definitively accurate.
|
||||
</Aside>
|
||||
|
||||
## Building Software from Source
|
||||
When developers write software, they do so in programming languages that are designed to be human readable. However, it is not efficient for computers to run this human readable code. Thus, there is a need for software to be "compiled" from human readable code into bytecode that can be quickly read and interpreted by a computer.
|
||||
|
||||
Adding complexity to this process, developers often rely on software that was written by other developers, called "dependencies" because one software package depends on (requires) the other. In order for these dependencies to be included in the final product, they must be "linked" to the code before the code is compiled. The linking process can be very intensive, as dependencies for the original software package might have their own dependencies (which in turn can have even more dependencies, adding layers). Developers rely on tools, such as Conan, to simplify the process of locating, configuring, and linking dependencies.
|
||||
|
||||
The entire process of ensuring dependencies are met, compiling software into a machine optimized format, and running tests against the final product is called "building".
|
||||
|
||||
Since xahaud is [published as open source software on GitHub](https://github.com/Xahau/xahaud), anyone may view, audit, modify, build, and run the code. Building from the source code enables certainty that the product being run is based off of the publicly viewable source code, which also has a full audit trail. Thus, validator operators who prioritize a maximum level of security should consider building from source.
|
||||
|
||||
## Dependencies
|
||||
|
||||
For compatibility, it is important to attend to specific versions of software used in the build process. xahaud is written in the C++20 language.
|
||||
|
||||
Current requirements for building xahaud include:
|
||||
|
||||
|
||||
| Dependency | Version |
|
||||
| :---------- | :-------- |
|
||||
| Python3 | >= 3.7 |
|
||||
| GCC / G++ | >= 14.x |
|
||||
| CMake | >= 3.16 |
|
||||
| Conan2 | 2.x |
|
||||
| openssl | 1.1.1 |
|
||||
| boost | 1.86.0 |
|
||||
| SQLite3 | 3.42.0 |
|
||||
| Snappy* | 1.1.10 |
|
||||
| SOCI* | 4.0.3 |
|
||||
| WasmEdge* | 0.11.2 |
|
||||
|
||||
\* Included in the Xahau/xahaud GitHub repository.
|
||||
|
||||
366
src/content/docs/docs/infrastructure/build-xahaud/linux.mdx
Normal file
366
src/content/docs/docs/infrastructure/build-xahaud/linux.mdx
Normal file
@@ -0,0 +1,366 @@
|
||||
---
|
||||
title: Linux Build Instructions
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
|
||||
These instructions are designed to work for Debian (i.e., Ubuntu 22.04 and 24.04) and Red Hat Enterprise Linux (9 or 10) based distributions. Many instructions overlap, though differences across operating systems are noted throughout. Efforts are made to test builds across operating systems, however, Ubuntu is the most tested and supported environment for building and running xahaud.
|
||||
|
||||
For additional instructions, refer to the [BUILD.md](https://github.com/Xahau/xahaud/blob/dev/BUILD.md) file in the Xahau/xahaud GitHub Repository.
|
||||
|
||||
<Aside type="caution">
|
||||
Creating an environment to build xahaud can cause permanent system damage. The [Build Environments](#build-environments-for-beginners) section of this page contains techniques for isolating your build environment from your underlying operating system. Undertake system changes at your own risk.
|
||||
</Aside>
|
||||
|
||||
## Install Dependencies
|
||||
|
||||
Debian/Ubuntu users can install required dependencies using these commands:
|
||||
```
|
||||
sudo apt install -y git curl wget python3-pip python3-venv python3-dev ca-certificates gcc g++ build-essential cmake ninja-build libc6-dev libssl-dev libsqlite3-dev
|
||||
```
|
||||
|
||||
Likewise, RHEL 9 or RHEL 10 users can install dependencies:
|
||||
```
|
||||
sudo dnf install epel-release && sudo dnf update -y
|
||||
sudo dnf config-manager --set-enabled crb -y
|
||||
sudo dnf groupinstall "Development Tools" -y
|
||||
sudo dnf install curl wget git ca-certificates cmake glibc-headers glibc-devel ninja-build perl-interpreter perl perl-FindBin sqlite-devel libstdc++ libstdc++-devel libstdc++-static gcc-c++ -y
|
||||
```
|
||||
|
||||
## Clone the Xahau/xahaud GitHub Repository
|
||||
Before building, acquire a local copy of the GitHub xahaud repository:
|
||||
|
||||
`git clone https://github.com/Xahau/xahaud.git`
|
||||
|
||||
It is possible to build from other forks of the repository, simply adjust the above URL as needed.
|
||||
|
||||
### Select the Repository Branch
|
||||
The primary branch used for xahaud development is `dev`. Users who prefer to build from an alternate branch can do so:
|
||||
|
||||
`git checkout [branch name]`
|
||||
|
||||
### Prepare the build directory
|
||||
Create a directory inside the xahaud repository to store the files generated during the build process:
|
||||
|
||||
`mkdir [/path/to/xahaud_github_repo]/.build`
|
||||
|
||||
## Install and Configure Conan2
|
||||
1. Ensure you are in the build directory: `cd [/path/to/xahaud_github_repo]/.build`
|
||||
|
||||
2. Create a Python3 virtual environment (venv) in the `env` directory: `python3 -m venv env`
|
||||
|
||||
3. Activate the virtual environment: `source ./env/bin/activate`
|
||||
|
||||
4. Update pip so the latest software versions are available: `pip install --upgrade pip`
|
||||
|
||||
5. Install Conan2: `pip install conan`
|
||||
|
||||
6. Create a new Conan2 profile (if you haven't already): `conan profile detect`
|
||||
|
||||
7. Install the Conan recipes for the Snappy, SOCI, and WasmEdge dependencies, included in the "xahaud" GitHub repository:
|
||||
```
|
||||
conan export external/snappy --version 1.1.10 --user xahaud --channel stable
|
||||
conan export external/soci --version 4.0.3 --user xahaud --channel stable
|
||||
conan export external/wasmedge --version 0.11.2 --user xahaud --channel stable
|
||||
```
|
||||
8. Review your Conan2 profile, located in: `/home/[username]/.conan2/profiles/default`. If needed, add:
|
||||
```
|
||||
[settings]
|
||||
compiler.cppstd=20
|
||||
compiler.libcxx=libstdc++11
|
||||
```
|
||||
9. It might be necessary to include the following lines at the end of your Conan2 profile:
|
||||
```
|
||||
[conf]
|
||||
tools.build:cxxflags=['-Wno-restrict']
|
||||
```
|
||||
|
||||
## Build xahaud
|
||||
1. Inside the `.build` directory, with the Python3 virtual environment active, adjust "build_type" to either "Release" or "Debug" and run the below command. It is possible to run the command twice to generate files for each "build_type".
|
||||
```
|
||||
conan install .. --output-folder . --build missing --settings build_type=["Release" or "Debug"] -c tools.build:verbosity=verbose -c tools.compilation:verbosity=verbose
|
||||
```
|
||||
|
||||
2. If needed, additional options can be passed to Conan2:
|
||||
```
|
||||
conan install .. --output-folder . --build missing --settings build_type=["Release" or "Debug"] -s compiler=gcc -s compiler.version=12 -s compiler.libcxx=libstdc++11 -s compiler.cppstd=20 -c tools.build:verbosity=verbose -c tools.compilation:verbosity=verbose -g VirtualBuildEnv -g VirtualRunEnv
|
||||
```
|
||||
|
||||
3. After Conan2 is complete, run cmake. Do not specify "DCMAKE_BUILD_TYPE" if building from multiple configurations (both "Release" and "Debug").
|
||||
|
||||
```
|
||||
cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
|
||||
-DCMAKE_BUILD_TYPE=["Release" or "Debug"] \
|
||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||
..
|
||||
```
|
||||
|
||||
4. Finally, use cmake to complete the build process: `cmake --build . [add '--config Release' or '--config Debug' if multiple build types were generated]`.
|
||||
|
||||
The output file is named `rippled` and is located in the `.build` directory. If multiple build types (both "Release" and "Debug") were specified, the final product will be located at: `.build/["Release" or "Debug"]/rippled` Rename the file to 'xahaud', and move it to it's final location (being careful not to overwrite the 'xahaud' GitHub repository). Mark the final file as executable, and download a configuration file and validators file as needed.
|
||||
|
||||
## Test the Build
|
||||
To run unit tests: `./xahaud --unittest`
|
||||
|
||||
|
||||
## Build Environments for Beginners
|
||||
|
||||
Maintaining different build environments (Python3 venvs, Conan2 profiles, etc.) is a complex task, even more so as underlying operating systems often rely on or expect specific versions of software. Thus, those new to the build process may benefit from using containers or writing bash scripts that are used on virtual machines that reset their state at reboot.
|
||||
|
||||
The following subsections address the basics of configuring amnesiac and container based build environments.
|
||||
|
||||
### Containers
|
||||
It is possible to use [Docker](https://docker.com) or other containerized environments (Podman, Kubernetes, etc.) to contain the build process, thereby keeping the underlying system clean. Using containers has the additional advantage of easily testing builds in multiple environments. For example, containers based on RHEL, Debian, and other distributions can be configured to use diverse compiler versions. Further, features like Multistage Dockerfiles enable users to build then deploy (run) xahaud using a single Dockerfile. Users can also take advantage of Docker's `buildx` plugin, which allows users to build for multiple platforms concurrently.
|
||||
|
||||
#### Install Docker
|
||||
```
|
||||
# Debian/Ubuntu:
|
||||
sudo apt update && sudo apt install docker.io docker-compose-v2 docker-buildx
|
||||
|
||||
# RHEL (requires adding the docker.com repository):
|
||||
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
|
||||
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
```
|
||||
|
||||
After installing, it is possible to add your local user account to Docker, so interacting with Docker does not require root/sudo access: `sudo usermod -aG docker $USER`. For changes to take effect, you must logout and back in to your user session.
|
||||
|
||||
#### Example Dockerfile
|
||||
For ease and consistency, it is possible to use Dockerfile scripts (e.g., buildx, multistage, docker-compose v2, etc.) to configure the build environment and to complete the build process.
|
||||
|
||||
For example, xahaud can be compiled inside an Ubuntu 24.04 Docker container using a Dockerfile to describe the container, download and install dependencies, and build the final product. Note that the following code follows the same steps outlined earlier on this page for the general Linux build process, the steps are simply applied inside an isolated container. It is possible to add additional variables or adjust the following code to customize the build process.
|
||||
|
||||
```
|
||||
# ~~~~ Arguments used to customize the container and build ~~~~
|
||||
ARG BASE_IMAGE=ubuntu:24.04 # Operating system for the build container
|
||||
ARG REPO_URL=https://github.com/Xahau/xahaud # URL for the repository with the code to be compiled
|
||||
ARG REPO_BRANCH=dev # Repository branch that will be used for the build
|
||||
ARG RELEASE_TYPE=Release # Set to "Release" or "Debug"
|
||||
ARG BASE_DIR=/build # Directory to build xahaud in
|
||||
|
||||
# ~~~~ Initiate a container ~~~~
|
||||
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder
|
||||
|
||||
ARG REPO_URL
|
||||
ARG REPO_BRANCH
|
||||
ARG RELEASE_TYPE
|
||||
ARG BASE_DIR
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
CONAN2_DIR=/root/.conan2
|
||||
|
||||
# ~~~~ Install build dependencies ~~~~
|
||||
RUN set -ex; \
|
||||
if [ -f /etc/os-release ]; then . /etc/os-release; fi; \
|
||||
case " $ID $ID_LIKE " in \
|
||||
*debian*|*ubuntu*) \
|
||||
apt-get update && apt-get install -y -qq \
|
||||
git curl wget python3-pip python3-venv python3-dev ca-certificates \
|
||||
gcc g++ build-essential cmake ninja-build \
|
||||
libc6-dev libssl-dev libsqlite3-dev \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
;; \
|
||||
*rhel*|*fedora*|*centos*|*rocky*|*alma*) \
|
||||
dnf install -y config-manager epel-release && dnf update -y && \
|
||||
dnf config-manager --set-enabled crb -y && \
|
||||
dnf groupinstall -y "Development Tools" && \
|
||||
dnf install -y curl wget git ca-certificates cmake glibc-headers glibc-devel \
|
||||
ninja-build perl-interpreter perl perl-FindBin sqlite-devel \
|
||||
libstdc++ libstdc++-devel libstdc++-static gcc-c++ python3-pip python3-devel \
|
||||
&& dnf clean all \
|
||||
;; \
|
||||
*) echo "Unsupported OS"; exit 1 ;; \
|
||||
esac
|
||||
|
||||
# ~~~~ Clone the xahaud GitHub repository and create a '.build' directory ~~~~
|
||||
WORKDIR ${BASE_DIR}
|
||||
RUN git clone ${REPO_URL} xahaud && \
|
||||
cd xahaud && \
|
||||
git checkout ${REPO_BRANCH} && \
|
||||
mkdir -p .build
|
||||
|
||||
# ~~~~ Create a Python3 virtual environment and install Conan2 ~~~~
|
||||
RUN python3 -m venv ${BASE_DIR}/env && \
|
||||
. ${BASE_DIR}/env/bin/activate && \
|
||||
pip install --upgrade pip && \
|
||||
pip install conan
|
||||
|
||||
# ~~~~ Configure Conan2 profile (the following assumes the user wishes to use cppstd version 20) ~~~~
|
||||
RUN . ${BASE_DIR}/env/bin/activate && \
|
||||
conan profile detect && \
|
||||
CONAN2_PROFILE="${CONAN2_DIR}/profiles/default" && \
|
||||
if grep -q '^compiler\.cppstd=' "$CONAN2_PROFILE"; then \
|
||||
sed -i 's/^compiler\.cppstd=.*/compiler.cppstd=20/' "$CONAN2_PROFILE"; \
|
||||
else \
|
||||
echo 'compiler.cppstd=20' >> "$CONAN2_PROFILE"; \
|
||||
fi && \
|
||||
if ! grep -Fqx "[conf]" "$CONAN2_PROFILE"; then \
|
||||
printf "[conf]\ntools.build:cxxflags=['-Wno-restrict']\n" >> "$CONAN2_PROFILE"; \
|
||||
fi
|
||||
|
||||
# ~~~~ Export Conan recipies for snappy, soci, and wasmedge ~~~~
|
||||
RUN . ${BASE_DIR}/env/bin/activate && \
|
||||
cd ${BASE_DIR}/xahaud && \
|
||||
conan export external/snappy --version 1.1.10 --user xahaud --channel stable && \
|
||||
conan export external/soci --version 4.0.3 --user xahaud --channel stable && \
|
||||
conan export external/wasmedge --version 0.11.2 --user xahaud --channel stable
|
||||
|
||||
# ~~~~ Build xahaud ~~~~
|
||||
RUN . ${BASE_DIR}/env/bin/activate && \
|
||||
cd ${BASE_DIR}/xahaud/.build && \
|
||||
conan install .. --output-folder . \
|
||||
--settings build_type=${RELEASE_TYPE} \
|
||||
--options *:shared=False \
|
||||
--build missing \
|
||||
-c tools.build:verbosity=verbose \
|
||||
-c tools.compilation:verbosity=verbose \
|
||||
-g VirtualBuildEnv \
|
||||
-g VirtualRunEnv && \
|
||||
cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
|
||||
-DCMAKE_BUILD_TYPE=${RELEASE_TYPE} \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
|
||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||
.. && \
|
||||
cmake --build . --parallel $(nproc)
|
||||
|
||||
# ~~~~ Copy the config files to the BASE_DIR ~~~~
|
||||
RUN cp ${BASE_DIR}/xahaud/cfg/xahaud-example.cfg ${BASE_DIR}/xahaud.cfg && \
|
||||
cp ${BASE_DIR}/xahaud/cfg/validators-example.txt ${BASE_DIR}/validators-xahau.txt && \
|
||||
cp ${BASE_DIR}/xahaud/.build/rippled ${BASE_DIR}/rippled
|
||||
|
||||
|
||||
|
||||
# ~~~~ Copy the xahaud.cfg and validators-xahau.txt files into the host OS ~~~~
|
||||
FROM scratch AS export
|
||||
ARG BASE_DIR
|
||||
|
||||
COPY --from=builder ${BASE_DIR}/rippled /xahaud
|
||||
COPY --from=builder ${BASE_DIR}/xahaud.cfg /xahaud.cfg
|
||||
COPY --from=builder ${BASE_DIR}/validators-xahau.txt /validators-xahau.txt
|
||||
|
||||
|
||||
|
||||
# ~~~~ Create a Docker image with xahaud and configuration files ~~~~
|
||||
FROM ${BASE_IMAGE} AS runtime
|
||||
ARG BASE_DIR
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# ~~~~ Install runtime dependencies ~~~~
|
||||
RUN set -ex; \
|
||||
if [ -f /etc/os-release ]; then . /etc/os-release; fi; \
|
||||
case " $ID $ID_LIKE " in \
|
||||
*debian*|*ubuntu*) \
|
||||
apt-get update && apt-get install -y -qq \
|
||||
libssl3 libsqlite3-0 ca-certificates \
|
||||
&& update-ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
;; \
|
||||
*rhel*|*fedora*|*centos*|*rocky*|*alma*) \
|
||||
dnf install -y openssl-libs sqlite-libs ca-certificates \
|
||||
&& dnf clean all && update-ca-trust \
|
||||
;; \
|
||||
esac
|
||||
|
||||
# ~~~~ Copy built binary and configs from builder ~~~~
|
||||
RUN mkdir -p /opt/xahaud/etc /opt/xahaud/bin /opt/xahaud/db /var/log/xahaud
|
||||
COPY --from=builder ${BASE_DIR}/rippled /opt/xahaud/bin/xahaud
|
||||
COPY --from=builder ${BASE_DIR}/xahaud.cfg /opt/xahaud/etc/xahaud.cfg
|
||||
COPY --from=builder ${BASE_DIR}/validators-xahau.txt /opt/xahaud/etc/validators-xahau.txt
|
||||
|
||||
# ~~~~ Create dicrectories and copy required shared libraries from builder ~~~~
|
||||
RUN --mount=type=bind,from=builder,source=/root/.conan2,target=/tmp/conan \
|
||||
find /tmp/conan -name "*.so*" -type f -exec cp {} /usr/local/lib/ \; && \
|
||||
ldconfig
|
||||
|
||||
# ~~~~ Set permissions ~~~~
|
||||
RUN chmod -R 755 /opt/xahaud /var/log/xahaud
|
||||
|
||||
WORKDIR /opt/xahaud
|
||||
|
||||
# ~~~~ Expose ports ~~~~
|
||||
EXPOSE 5009 6009 50051 21337 21338
|
||||
|
||||
# ~~~~ Run xahaud ~~~~
|
||||
ENTRYPOINT ["/opt/xahaud/bin/xahaud"]
|
||||
CMD ["--conf", "/opt/xahaud/etc/xahaud.cfg"]
|
||||
```
|
||||
|
||||
The above "multistage" Dockerfile can be used to build xahaud by running:
|
||||
|
||||
`docker buildx build -t xahaud-builder --target builder --load .`
|
||||
|
||||
This creates a Docker image named "xahaud-builder" from the Dockerfile. The `--target builder` flag stops the script at the build process and the `--load` flag imports the resultant image into Docker.
|
||||
|
||||
The built image can also be exported to the host operating system (along with configuration files):
|
||||
|
||||
`docker buildx build --target export --output type=local,dest=$HOME .`
|
||||
|
||||
To run the multistage build file and create a new Docker image with xahaud and the required configuration files:
|
||||
|
||||
`docker buildx build --target runtime --load -t xahaud:latest .`
|
||||
|
||||
The resultant image can be viewed with: `docker images` and run with:
|
||||
|
||||
`docker run --rm -d --name xahaud -p 5009:5009 -p 6009:6009 -p 21337:21337 -v /home/$USER/xahaud/opt:/opt/xahaud -v /home/$USER/xahaud/log:/var/log/xahaud xahaud:latest`
|
||||
|
||||
In the above command, you can adjust the `-d` flag to toggle running in detached mode, the `-p xxxx:xxxx` flags which define the port mappings, the `--name xahaud` flag to change the container's name, and the `-v /path/on/host:/path/in/container` flag to change where persistent data is stored on the underlying operating system. If running in detached mode, logs can be viewed with `docker logs -f xahaud`.
|
||||
|
||||
### Amnesiac Operating Systems
|
||||
|
||||
Configuring a Linux system to completely forget all the software that was installed or modified during runtime provides an easy path to recover from build errors. Typically, an amnesiac operating system is run as a virtual machine with a very large amount of memory available, as all changes are written to memory instead of disk. Building xahaud can take over 20 GB of memory, if all software dependencies/requirements are installed in a memory based overlay file system. It is typically possible to install most of the software dependencies (using `apt` or `dnf`) prior to making the system amnesiac, thereby reducing required memory.
|
||||
|
||||
#### Configure an amnesic operating system using a Debian based virtual machine
|
||||
```
|
||||
# Install the 'overlayroot' software package
|
||||
apt update && apt install overlayroot
|
||||
|
||||
# Update the configuration file (/etc/overlayroot.conf) to enable an in-memory overlay file system.
|
||||
sudo sed -i 's/^overlayroot=.*/overlayroot="tmpfs:swap=1,recurse=0"/' /etc/overlayroot.conf
|
||||
|
||||
# Rebuild initramfs
|
||||
update-initramfs -u
|
||||
|
||||
# Reboot into the overlay
|
||||
reboot
|
||||
|
||||
# After rebooting, it is possible to remount the overlay filesystem with more memory, as only 50% of available memory is dedicated to the overlayfs by default.
|
||||
# When resizing memory, ensure some memory remains available for system use. The following will remount with the overlayfs set to use 30G of memory, adjust as needed.
|
||||
# It is also possible to use a systemd file to enable persistent changes to the overlayfs size.
|
||||
sudo mount -o remount,size=30G /media/root-rw
|
||||
```
|
||||
|
||||
#### Configure an amnesic operating system using a RHEL based virtual machine
|
||||
```
|
||||
# Ensure dracut is installed
|
||||
dnf install dracut -y
|
||||
|
||||
# Configure dracut to support the overlay
|
||||
printf 'add_drivers+=" overlay "\n' > /etc/dracut.conf.d/overlay.conf # Use this line for RHEL 9
|
||||
printf 'add_drivers+=" overlay "\nadd_dracutmodules+=" overlayfs "\n' > /etc/dracut.conf.d/overlay.conf # Use this line for RHEL 10
|
||||
|
||||
# Rebuild
|
||||
dracut -f
|
||||
|
||||
# Update the boot image to use a systemd volatile overlay
|
||||
grubby --update-kernel=ALL --args="systemd.volatile=overlay"
|
||||
```
|
||||
|
||||
#### Building xahaud
|
||||
Once an amnesiac virtual machine with sufficient memory has been created, it is possible to build xahaud following the instructions [above on this page](#_top).
|
||||
|
||||
#### Disabling amnesia
|
||||
Installing software updates or performing other tasks that should persist will require users to disable amnesia. This can be done temporarily or permanently. Some software updates require additional configuration after a reboot, so it recommended to disable amnesia a second time when rebooting following a software update.
|
||||
|
||||
To disable amnesia on Debian based systems:
|
||||
1. Press `e` to edit the Ubuntu boot entry.
|
||||
2. On the line starting with "linux..." edit or add `overlayroot=` option to read `overlayroot=disabled`. This will allow a one-time boot into a system with persistent storage.
|
||||
3. To permanently disable amnesia, run `sudo sed -i '/^overlayroot=/c\overlayroot="disabled"' /etc/overlayroot.conf` to change `overlayroot="disabled"` in the /etc/overlayroot.conf file. Then update initramfs `sudo update-initramfs -u`.
|
||||
|
||||
To disable amnesia on RHEL 9/10 based systems:
|
||||
1. Press `e` at the boot menu to edit the options.
|
||||
2. Remove the "systemd.volatile=overlay" option.
|
||||
3. Press `F10` to boot.
|
||||
4. To permanently disable amnesia, run `grubby --update-kernel=ALL --remove-args="systemd.volatile=overlay"`
|
||||
|
||||
10
src/content/docs/docs/infrastructure/build-xahaud/macos.mdx
Normal file
10
src/content/docs/docs/infrastructure/build-xahaud/macos.mdx
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: macOS
|
||||
---
|
||||
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
<Aside type="note" >
|
||||
While this page is being updated, please refer to the [BUILD.md](https://github.com/Xahau/xahaud/blob/dev/BUILD.md) file in the Xahau/xahaud GitHub Repository.
|
||||
</Aside>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: Building Xahau
|
||||
description: A Guide to Setting Up the Development Environment.
|
||||
---
|
||||
This section provides detailed instructions for setting up the build environment on both Ubuntu 22.04 and macOS 13.5.2.
|
||||
|
||||
The building Xahau chapter will guide you through the process of establishing environmental variables, installing core and **Xahaud** dependencies, and compiling the software, including the acquisition and setup of essential components like LLVM, Boost, WasmEdge, and Protobuf.
|
||||
|
||||
The steps explain why certain versions and configurations are needed to ensure compatibility and optimal performance. Ending with cloning the Xahau repository and creating the **Xahaud** target, which sets developers on the path to adding to or deploying the Xahau network.
|
||||
@@ -1,189 +0,0 @@
|
||||
---
|
||||
title: Mac OS - 15.3.2 (24D81)
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
<Aside type="caution">
|
||||
Xahaud now supports building using Conan. We recommend using Conan to build the repository. The build instructions for Conan can be found in the [BUILD.md](https://github.com/Xahau/xahaud/blob/dev/BUILD.md) file in the source code.
|
||||
</Aside>
|
||||
|
||||
## CMake Legacy Building
|
||||
|
||||
| Dependency | Working Versions |
|
||||
| ----------- | ---------------- |
|
||||
| Apple Clang | 14.3.1, 16.0.0 |
|
||||
| LLVM | 14, 16 |
|
||||
| LLD | 14, 16 |
|
||||
| Boost | 1.86.0 |
|
||||
| CMake | 3.23.1 |
|
||||
| Protobuf | 3.20.0 |
|
||||
| WasmEdge | 0.11.2 |
|
||||
|
||||
### Using Apple Clang 14.3.1
|
||||
|
||||
1. Download an older version of Xcode
|
||||
1. Go to the [https://developer.apple.com/download/more/](https://developer.apple.com/download/more/) page. You will need to sign in with your Apple Developer account.
|
||||
2. Search for the version of Xcode that includes Apple Clang 14. This is typically specified in the release notes for each Xcode version.
|
||||
3. Download the Xcode \`.xip\` file for the version you need.
|
||||
2. Install the older version of Xcode:
|
||||
1. Once the download is complete, extract the \`.xip\` file, which will give you an Xcode application.
|
||||
2. Rename this Xcode application if you want to keep multiple versions of Xcode on your system (e.g., \`Xcode_14.3.1.app\`).
|
||||
3. Drag the Xcode application to your \`/Applications\` directory.
|
||||
3. Switch to the desired version of the toolchain
|
||||
1. If you want to use the newly installed version of Xcode and its toolchain by default, you can switch to it using the \`xcode-select\` command:
|
||||
|
||||
```
|
||||
sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer
|
||||
```
|
||||
2. Replace \`Xcode_14.3.1.app\` with the actual name of the Xcode version you installed.
|
||||
3. Open Terminal and run the following command to check the version of Clang:
|
||||
|
||||
`clang --version`
|
||||
|
||||
<Aside type="tip">
|
||||
If you want to use a specific version of Apple Clang for command line builds you can use the following;
|
||||
</Aside>
|
||||
|
||||
```
|
||||
export DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer
|
||||
clang --version
|
||||
```
|
||||
|
||||
### Set Build Env Variables
|
||||
|
||||
First make a dependency directory. I like to use `~/dependencies`
|
||||
|
||||
```
|
||||
mkdir ~/dependencies
|
||||
```
|
||||
|
||||
Next we need to set the environment variables.
|
||||
|
||||
### Set Version Env Variables
|
||||
|
||||
```
|
||||
export LLVM_VERSION=14
|
||||
export BOOST_VERSION=1.86.0
|
||||
export WASMEDGE_VERSION=0.11.2
|
||||
export PROTOBUF_VERSION=3.20.0
|
||||
```
|
||||
|
||||
### Set Build Env Variables
|
||||
|
||||
```
|
||||
export DEP_DIR=~/dependencies
|
||||
export BOOST_FOLDER_NAME="boost_$(echo "$BOOST_VERSION" | sed 's/\./_/g')"
|
||||
export BOOST_ROOT="$DEP_DIR/$BOOST_FOLDER_NAME"
|
||||
export BOOST_LIBRARY_DIRS="$BOOST_ROOT/libs"
|
||||
export BOOST_INCLUDE_DIR="$BOOST_ROOT/boost"
|
||||
export BOOST_CXXFLAGS="${BOOST_CXXFLAGS:-} -DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
export LLVM_PREFIX=`brew --prefix llvm@$LLVM_VERSION`
|
||||
export LLVM_DIR="$LLVM_PREFIX/lib/cmake/llvm"
|
||||
export LLVM_LIBRARY_DIR="$LLVM_PREFIX/lib"
|
||||
export LLD_DIR="$LLVM_PREFIX/lib/cmake/lld"
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
export LDFLAGS="${LDFLAGS:-} -L$BOOST_LIBRARY_DIRS -L$LLVM_PREFIX/lib"
|
||||
export CPPFLAGS="${CPPFLAGS:-} -I$BOOST_ROOT/include -I$LLVM_PREFIX/include"
|
||||
export CFLAGS="${CFLAGS:-} -DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
export CXXFLAGS="${CXXFLAGS:-} -DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
```
|
||||
|
||||
### Install Core Dependencies
|
||||
|
||||
```
|
||||
brew update
|
||||
brew install automake \
|
||||
wget \
|
||||
curl \
|
||||
git \
|
||||
pkg-config \
|
||||
openssl \
|
||||
autoconf \
|
||||
libtool \
|
||||
unzip \
|
||||
cmake \
|
||||
"llvm@$LLVM_VERSION"
|
||||
```
|
||||
|
||||
### Install Rippled Dependencies
|
||||
|
||||
Install Protobuf
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget -nc https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-all-$PROTOBUF_VERSION.tar.gz && \
|
||||
tar -xzf protobuf-all-$PROTOBUF_VERSION.tar.gz && \
|
||||
cd protobuf-$PROTOBUF_VERSION/ && \
|
||||
./autogen.sh && \
|
||||
./configure --disable-shared link=static && \
|
||||
make -j$(sysctl -n hw.logicalcpu) && \
|
||||
sudo make install
|
||||
```
|
||||
|
||||
<Aside type="tip">
|
||||
Note that it's currently necessary to remove any homebrew installations of protobuf otherwise cmake will mix up both installations. There would of course be better workarounds for this, but simply removing the homebrew installations is a quick fix.
|
||||
</Aside>
|
||||
|
||||
Install Boost
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget https://archives.boost.io/release/$BOOST_VERSION/source/$BOOST_FOLDER_NAME.tar.gz && \
|
||||
tar -xvzf $BOOST_FOLDER_NAME.tar.gz && \
|
||||
cd $BOOST_FOLDER_NAME && \
|
||||
./bootstrap.sh && \
|
||||
./b2 -j$(sysctl -n hw.logicalcpu)
|
||||
```
|
||||
|
||||
Install WasmEdge
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget -nc -q https://github.com/WasmEdge/WasmEdge/archive/refs/tags/$WASMEDGE_VERSION.zip && \
|
||||
unzip -o $WASMEDGE_VERSION.zip && \
|
||||
cd WasmEdge-$WASMEDGE_VERSION && \
|
||||
sed -i '' \
|
||||
's|https://boostorg\.jfrog\.io/artifactory/main/release/|https://archives.boost.io/release/|g' CMakeLists.txt && \
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DWASMEDGE_BUILD_SHARED_LIB=OFF \
|
||||
-DWASMEDGE_BUILD_STATIC_LIB=ON \
|
||||
-DWASMEDGE_BUILD_AOT_RUNTIME=ON \
|
||||
-DWASMEDGE_FORCE_DISABLE_LTO=ON \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DWASMEDGE_LINK_LLVM_STATIC=ON \
|
||||
-DWASMEDGE_BUILD_PLUGINS=OFF \
|
||||
-DWASMEDGE_LINK_TOOLS_STATIC=ON \
|
||||
.. && \
|
||||
make -j$(sysctl -n hw.logicalcpu) && \
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### Clone the repository
|
||||
|
||||
```
|
||||
mkdir ~/projects && \
|
||||
cd ~/projects && \
|
||||
git clone https://github.com/Xahau/xahaud.git && \
|
||||
cd xahaud && \
|
||||
git checkout dev
|
||||
```
|
||||
|
||||
### Build Xahaud
|
||||
|
||||
From the root `xahaud` directory:
|
||||
|
||||
```shellscript
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_DIR=$LLVM_DIR -DLLVM_LIBRARY_DIR=$LLVM_LIBRARY_DIR .. && \
|
||||
cmake --build . --target rippled --parallel -j$(sysctl -n hw.logicalcpu)
|
||||
```
|
||||
|
||||
Start the built node
|
||||
|
||||
```
|
||||
./rippled
|
||||
```
|
||||
@@ -1,166 +0,0 @@
|
||||
---
|
||||
title: Ubuntu - 22.04
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
<Aside type="caution">
|
||||
Xahaud now supports building using Conan. We recommend using Conan to build the repository. The build instructions for Conan can be found in the [BUILD.md](https://github.com/Xahau/xahaud/blob/dev/BUILD.md) file in the source code.
|
||||
</Aside>
|
||||
|
||||
## CMake Legacy Building
|
||||
|
||||
| Dependency | Working Version |
|
||||
| ---------- | --------------- |
|
||||
| GCC / G++ | 14.0.3 |
|
||||
| LLVM | 14.0.3 |
|
||||
| LLD | 14.0.3 |
|
||||
| Boost | 1.86.0 |
|
||||
| CMake | 3.23.1 |
|
||||
| Protobuf | 3.20.0 |
|
||||
| WasmEdge | 0.11.2 |
|
||||
|
||||
### Set Build Env Variables
|
||||
|
||||
First make a dependency directory. I like to use `~/dependencies`
|
||||
|
||||
```
|
||||
mkdir ~/dependencies
|
||||
```
|
||||
|
||||
Next we need to set the environment variables.
|
||||
|
||||
### Set Versions Env Variables
|
||||
|
||||
<Aside type="caution">
|
||||
If you are using Ubuntu 20.04 change the \`UBUNTU_VERSION=focal\`
|
||||
</Aside>
|
||||
|
||||
```
|
||||
export UBUNTU_VERSION=jammy
|
||||
export LLVM_VERSION=14
|
||||
export CMAKE_VERSION=3.23.1
|
||||
export BOOST_VERSION=1.86.0
|
||||
export WASMEDGE_VERSION=0.11.2
|
||||
export PROTOBUF_VERSION=3.20.0
|
||||
```
|
||||
|
||||
### Set Build Env Variables
|
||||
|
||||
```
|
||||
export DEP_DIR=~/dependencies
|
||||
export BOOST_FOLDER_NAME="boost_$(echo "$BOOST_VERSION" | sed 's/\./_/g')"
|
||||
export BOOST_ROOT=$DEP_DIR/$BOOST_FOLDER_NAME
|
||||
export Boost_LIBRARY_DIRS=$BOOST_ROOT/libs
|
||||
export BOOST_INCLUDEDIR=$BOOST_ROOT/boost
|
||||
export Boost_INCLUDE_DIRS=$BOOST_ROOT/boost
|
||||
export LLVM_DIR=/usr/lib/llvm-$LLVM_VERSION/lib/cmake/llvm
|
||||
export LLVM_LIBRARY_DIR=/usr/lib/llvm-$LLVM_VERSION/lib
|
||||
export LLD_DIR=/usr/lib/llvm-$LLVM_VERSION/lib/cmake/lld
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
export CFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
export CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
export BOOST_CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"
|
||||
export LDFLAGS="-L$BOOST_ROOT/lib"
|
||||
export CPPFLAGS="-I$BOOST_ROOT/include"
|
||||
export LDFLAGS="-L/usr/lib/llvm-$LLVM_VERSION/lib"
|
||||
export CPPFLAGS="-I/usr/lib/llvm-$LLVM_VERSION/include"
|
||||
```
|
||||
|
||||
### Install Core Dependencies
|
||||
|
||||
```
|
||||
apt update && \
|
||||
apt install -y build-essential software-properties-common wget curl git pkg-config zlib1g-dev libssl-dev autoconf libtool unzip gcc g++ ninja-build && \
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
|
||||
add-apt-repository "deb http://apt.llvm.org/$UBUNTU_VERSION/ llvm-toolchain-$UBUNTU_VERSION-$LLVM_VERSION main" && \
|
||||
add-apt-repository ppa:deadsnakes/ppa && \
|
||||
apt-cache policy python3.9 && \
|
||||
apt install -y python3.9 python3-pip llvm-$LLVM_VERSION-dev liblld-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev
|
||||
```
|
||||
|
||||
<Aside type="caution">
|
||||
To Resolve the \``E: The repository 'http://apt.llvm.org/ llvm-toolchain-- Release` error:
|
||||
</Aside>
|
||||
|
||||
```
|
||||
sudo nano /etc/apt/sources.list
|
||||
# Scroll down and remove
|
||||
deb http://apt.llvm.org/ llvm-toolchain-- main
|
||||
# Add the apt-repo directly with add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main"
|
||||
```
|
||||
|
||||
### Install Xahaud Dependencies
|
||||
|
||||
Install CMake
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.sh && \
|
||||
sudo sh cmake-$CMAKE_VERSION-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
|
||||
```
|
||||
|
||||
Install Protobuf
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget -nc https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-all-$PROTOBUF_VERSION.tar.gz && \
|
||||
tar -xzf protobuf-all-$PROTOBUF_VERSION.tar.gz && \
|
||||
cd protobuf-$PROTOBUF_VERSION/ && \
|
||||
./autogen.sh && \
|
||||
./configure --prefix=/usr --disable-shared link=static && \
|
||||
make -j$(nproc) && \
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Install Boost
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/$BOOST_FOLDER_NAME.tar.gz && \
|
||||
tar -xvzf $BOOST_FOLDER_NAME.tar.gz && \
|
||||
cd $BOOST_FOLDER_NAME && \
|
||||
./bootstrap.sh && \
|
||||
./b2 -j$(nproc)
|
||||
```
|
||||
|
||||
Install WasmEdge
|
||||
|
||||
```
|
||||
cd $DEP_DIR && \
|
||||
wget -nc -q https://github.com/WasmEdge/WasmEdge/archive/refs/tags/$WASMEDGE_VERSION.zip && \
|
||||
unzip -o $WASMEDGE_VERSION.zip && \
|
||||
cd WasmEdge-$WASMEDGE_VERSION && \
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_SHARED_LIB=OFF -DWASMEDGE_BUILD_STATIC_LIB=ON -DWASMEDGE_BUILD_AOT_RUNTIME=ON -DWASMEDGE_FORCE_DISABLE_LTO=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DWASMEDGE_LINK_LLVM_STATIC=ON -DWASMEDGE_BUILD_PLUGINS=OFF -DWASMEDGE_LINK_TOOLS_STATIC=ON .. && \
|
||||
make -j$(nproc) && \
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### Clone the repository
|
||||
|
||||
```
|
||||
mkdir ~/projects && \
|
||||
cd ~/projects && \
|
||||
git clone https://github.com/Xahau/xahaud.git && \
|
||||
cd xahaud && \
|
||||
git checkout dev
|
||||
```
|
||||
|
||||
### Build Xahaud
|
||||
|
||||
From the root `xahaud` directory:
|
||||
|
||||
```shellscript
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_DIR=$LLVM_DIR -DLLVM_LIBRARY_DIR=$LLVM_LIBRARY_DIR .. && \
|
||||
cmake --build . --target rippled --parallel -j$(nproc)
|
||||
```
|
||||
|
||||
Start the built node
|
||||
|
||||
```
|
||||
./rippled
|
||||
```
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
title: Enabling Validation in xahaud
|
||||
title: Enable Validation in xahaud
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
|
||||
Validators are xahaud nodes that are configured with an additional public/private keypair, which is used to sign each proposed ledger. Thus, validators are the primary mechanism used to achieve consensus regarding the order in which transactions are applied on the Xahau Network.
|
||||
|
||||
## Background Considerations
|
||||
@@ -30,7 +33,7 @@ The Xahau Network utilizes the [Governance Game](/docs/features/governance-game)
|
||||
Switching a stock xahaud server into a validator is a straight forward process. Essentially, users will generate a public/private keypair, which is then used to generate a token using an ephemeral key derived from the master pair. That token is installed into the `xahaud.cfg` file, thereby instructing xahaud to propose validations to the Network.
|
||||
|
||||
### Building the Validation Keys Tool
|
||||
At this time, there is not an official release of the software used for generating validation keys. Thus, users can either build the tool from scratch or rely on a packaged version provided with rippled (this tool is not packaged with the xahaud binary). The instructions for building the tool are the same as the instructions for building rippled, and they are provided on the [ripple/validator-keys-tool](https://github.com/ripple/validator-keys-tool) repository page. There are also some [packaged binaries](https://github.com/jscottbranson/xahau-examples/) available in unofficial repositories. Users seeking to generate keys for production validators should build the tool from scratch on a secure, air-gapped machine.
|
||||
At this time, there is not an official binary release of the software used for generating validation keys. Thus, users can either build the tool from scratch or rely on unofficial builds. The instructions for building the tool are the same as the instructions for [building xahaud](../build-xahaud), and they are provided on the [Xahau/validator-keys-tool](https://github.com/Xahau/validator-keys-tool) repository page. There are also some [packaged binaries](https://github.com/jscottbranson/xahau-examples/) available in unofficial repositories. Users seeking to generate keys for production validators should build the tool from scratch on a secure, air-gapped machine.
|
||||
|
||||
While xahaud provides the `validation_create` [Admin API method](/docs/features/http-websocket-apis/admin-api-methods), this method is NOT capable of generating the necessary validation token or allowing for domain verification. Thus, despite the name, the `validation_create` method is used to create public/private keys to identify a server broadly, for example when [clustering multiple servers](/docs/infrastructure/advanced-configuration).
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Serving a TOML File for Identity Verification
|
||||
title: Serve a TOML File for Identity Verification
|
||||
---
|
||||
***Identity verification requires two parts. NEVER TRUST TOML FILES OR ON NETWORK VALIDATOR/ACCOUNT ATTESTATIONS ALONE TO CONFIRM IDENTITY, AS ANYONE CAN SET THEM. A website (URL) must claim ownership of the validator/account, and the on-network data must match.***
|
||||
|
||||
|
||||
@@ -1,12 +1,174 @@
|
||||
---
|
||||
title: Installing xahaud
|
||||
title: Install xahaud
|
||||
description: >-
|
||||
The software behind Xahau is open source, and anyone can run a node locally. Users can run a Docker container, a local instance, or a binary file.
|
||||
---
|
||||
import { Aside } from '@astrojs/starlight/components';
|
||||
|
||||
When running a node, users will have to configure settings based on whether the node will run on the test network or the main network. When transitioning a single node from one network to the other, database files must be wiped, except wallet.db, which contains the server's identity credentials.
|
||||
|
||||
In addition to [building from scratch](/docs/infrastructure/building-xahau), there are three ways to install xahaud: Docker, locally, and using a portable binary. The below install methods all rely on the xahaud builds published at: [https://build.xahau.tech](https://build.xahau.tech), though the end result is different.
|
||||
## Docker Container
|
||||
The most common techniques for installing xahaud are either locally using systemd or inside a container, such as Docker.
|
||||
|
||||
<Aside type="tip">
|
||||
The install documentation on this page expands on the install documentation in the [xahaud GitHub repository](https://github.com/xahau/xahaud/blob/dev/docs/build/install.md).
|
||||
</Aside>
|
||||
|
||||
## Linux Install Process
|
||||
Regardless of how xahaud is installed (Docker or system-wide), the overall process is similar across Linux systems.
|
||||
The following sections, [Docker Container](#docker-container-install-script) and [Local Install](#local-install-script), take advantage of bash scripts, which automate the following steps:
|
||||
|
||||
1. Obtain the xahaud binary:
|
||||
- Downoad a compiled binary image from [https://build.xahau.tech](https://build.xahau.tech)
|
||||
- [Build from source](/docs/infrastructure/build-xahaud/)
|
||||
2. Obtain the configuration files:
|
||||
- [xahaud.cfg](https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/cfg/xahaud-example.cfg)
|
||||
- [validators-xahau.txt](https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/cfg/validators-example.txt)
|
||||
3. If desired, create a xahaud user and group, which can own the binary and other relevant files:
|
||||
- `sudo groupadd --system xahaud`
|
||||
- `sudo useradd --system --gid xahaud --no-create-home xahaud`
|
||||
4. Decide on (and create) a directory structure to store:
|
||||
- The xahaud binary. The default is typically: `/opt/xahaud/bin/xahaud`
|
||||
- Two xahaud configuration files, `xahaud.cfg` and `validators-xahau.txt`. The default is: `/etc/xahaud/`, though `/opt/xahaud/etc/` is often used. These two locations can be symbolically linked.
|
||||
- The xahaud databases. The default is often: `/opt/xahaud/db/`
|
||||
- A logfile location, such as: `/var/log/xahaud/default.log`
|
||||
5. Move the xahaud binary and configuration files into their places in the directory structure.
|
||||
6. Edit `xahaud.cfg` so paths in the configuration match the paths in the directory structure.
|
||||
7. If needed, change ownership permissions. If running xahaud as a validator, it is important to restrict the `xahaud.cfg` file, as that contains the validation token.
|
||||
- `chown -R xahaud:xahaud /opt/xahaud /var/log/xahaud`
|
||||
- `chmod -R 750 /opt/xahaud /var/log/xahaud`
|
||||
8. Create a systemd service file (such as the example [below](#example-systemd-service-file) to run xahaud as a daemon.
|
||||
- The file is located at: `/etc/systemd/system/xahaud.service`
|
||||
- After creating or editing the file, run: `systemctl daemon-reload`
|
||||
- To run xahaud automatically at system startup: `systemctl enable --now xahaud`
|
||||
- If preferred, xahaud can be run without systemd: `/path/to/xahaud --conf=/path/to/xahaud.cfg`
|
||||
9. Create a wrapper to run xahaud commands without having to specify the full path.
|
||||
- Typically stored at `/usr/local/bin/xahaud`
|
||||
- Contents might be: `exec ${XAHAUD_DIR}xahaud --conf=${CONF_DIR}xahaud.cfg "$@"`
|
||||
|
||||
### Example systemd Service File
|
||||
The following service file should be modified based on the user's selected directory structure and ownership permissions.
|
||||
```
|
||||
[Unit]
|
||||
Description=Xahaud Daemon
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/path/to/xahaud --silent --conf=/path/to/xahaud.cfg
|
||||
Restart=on-failure
|
||||
User=xahaud
|
||||
Group=xahaud
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
### Example Linux Install Script
|
||||
A basic bash script used to install xahaud. This script follows the instructions provided earlier this this section.
|
||||
```
|
||||
### VARIABLES ###
|
||||
|
||||
#### Directory structure ####
|
||||
XAHAUD_DIR="/opt/xahaud/bin/" # Path where xahaud binary will be stored
|
||||
CONF_DIR="/opt/xahaud/etc/" # Path where the xahaud.cfg and validators-xahau.txt will be stored
|
||||
DB_DIR="/opt/xahaud/db/" # Path where xahaud will store databases
|
||||
LOG_DIR="/var/log/xahaud/" # Path where logfile(s) will be stored.
|
||||
|
||||
#### Ownership ####
|
||||
XAHAUD_USER="xahaud" # User that owns the xahaud process.
|
||||
|
||||
#### Download links ####
|
||||
BINARY_URL="https://build.xahau.tech/2025.9.8-HEAD%2B2194" # URL to the xahaud binary that will be downloaded.
|
||||
CFG_URL="https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/cfg/xahaud-example.cfg" # This will be renamed to 'xahaud.cfg'
|
||||
VAL_URL="https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/cfg/validators-example.txt" # This will be renamed to 'validators-xahau.txt'
|
||||
|
||||
|
||||
|
||||
########## SCRIPT BEGINS HERE. DO NOT ADJUST VARIABLES BELOW THIS LINE ##########
|
||||
|
||||
### CREATE DIRECTORIES ####
|
||||
echo "Checking directory structure."
|
||||
sudo mkdir -p ${XAHAUD_DIR} ${CONF_DIR} ${DB_DIR} ${LOG_DIR}
|
||||
|
||||
### CREATE xahaud GROUP AND USER ###
|
||||
echo "Checking for user and group."
|
||||
if ! getent group ${XAHAUD_USER} > /dev/null; then
|
||||
sudo groupadd --system ${XAHAUD_USER}
|
||||
fi
|
||||
|
||||
if ! getent passwd ${XAHAUD_USER} > /dev/null; then
|
||||
sudo useradd --system --gid ${XAHAUD_USER} --no-create-home ${XAHAUD_USER}
|
||||
fi
|
||||
|
||||
### DOWNLOAD CONFIGURATION FILES ###
|
||||
echo "Downloading files."
|
||||
if [[ ! -f "${CONF_DIR}xahaud.cfg" ]]; then
|
||||
curl -fsSL ${CFG_URL} -o ${CONF_DIR}xahaud.cfg
|
||||
fi
|
||||
if [[ ! -f "${CONF_DIR}validators-xahau.txt" ]]; then
|
||||
curl -fsSL ${VAL_URL} -o ${CONF_DIR}validators-xahau.txt
|
||||
fi
|
||||
|
||||
### DOWNLOAD xahaud ###
|
||||
if [[ ! -f "${XAHAUD_DIR}xahaud" ]]; then
|
||||
curl -fsSL ${BINARY_URL} -o ${XAHAUD_DIR}xahaud
|
||||
elif [[ -f "${XAHAUD_DIR}xahaud" ]]; then
|
||||
echo "Existing xahaud binary found. It will be renamed to 'xahaud.old'."
|
||||
mv ${XAHAUD_DIR}xahaud ${XAHAUD_DIR}xahaud.old
|
||||
curl -fsSL ${BINARY_URL} -o ${XAHAUD_DIR}xahaud
|
||||
fi
|
||||
|
||||
### CHANGE OWNERSHIP AND PERMISSIONS ###
|
||||
echo "Checking ownership and permissions."
|
||||
sudo chown -R ${XAHAUD_USER}:${XAHAUD_USER} ${XAHAUD_DIR} ${CONF_DIR} ${DB_DIR} ${LOG_DIR}
|
||||
sudo chmod -R 0750 ${XAHAUD_DIR} ${CONF_DIR} ${DB_DIR} ${LOG_DIR}
|
||||
|
||||
### Install systemd SERVICE FILE ###
|
||||
if [[ ! -f "/etc/systemd/system/xahaud.service" ]]; then
|
||||
echo "Installing system service file."
|
||||
sudo cat > /etc/systemd/system/xahaud.service <<EOF
|
||||
[Unit]
|
||||
Description=Xahaud Daemon
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=${XAHAUD_DIR}xahaud --silent --conf=${CONF_DIR}xahaud.cfg
|
||||
Restart=on-failure
|
||||
User=${XAHAUD_USER}
|
||||
Group=${XAHAUD_USER}
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
fi
|
||||
|
||||
### RUN COMMANDS AS 'xahaud' WITHOUT SPECIFYING FULL PATHS ###
|
||||
if [[ ! -f "/usr/local/bin/xahaud" ]]; then
|
||||
echo "Creating xahaud wrapper."
|
||||
sudo cat > /usr/local/bin/xahaud <<EOF
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
exec ${XAHAUD_DIR}xahaud --conf=${CONF_DIR}xahaud.cfg "\$@"
|
||||
EOF
|
||||
fi
|
||||
|
||||
sudo chmod 0755 /usr/local/bin/xahaud
|
||||
|
||||
### ENABLE AND START xahaud ###
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl stop xahaud
|
||||
sudo systemctl enable --now xahaud
|
||||
sudo systemctl status xahaud
|
||||
echo "The install script completed successfully."
|
||||
```
|
||||
|
||||
## Docker Container Install Script
|
||||
|
||||
To run xahaud in a Docker Container:
|
||||
|
||||
@@ -16,8 +178,8 @@ To run xahaud in a Docker Container:
|
||||
4. Run: <code>./up</code>
|
||||
5. Commands and additional information are located in the README.md file in the Docker repository. Configuration files and databases are located in the `store` directory inside the Docker directory.
|
||||
|
||||
## Local Install
|
||||
The Xahau Docker repositories (Mainnet and Testnet) each contains a script to automate the local install process, so that xahaud can be run outside of Docker. These scripts will create systemd files, a 'xahaud' user, and default configuration files. The URLs for these scripts are in the table at the bottom of this page. To install locally:
|
||||
## Local Install Script
|
||||
The Xahau Docker repositories (Mainnet and Testnet) each contains a script to automate the local install process, so that xahaud can be run outside of Docker. These scripts are similar to the [Linux Install Summary](#linux-install-process), as they will create systemd files, a 'xahaud' user, and default configuration files. The URLs for these scripts are in the table at the bottom of this page. To install locally:
|
||||
|
||||
1. Download and run the install script: <code>curl -sL [https://link-to-script] | bash</code>
|
||||
2. Edit the configuration file: <code>/opt/xahahud/etc/xahaud.cfg</code>
|
||||
@@ -25,15 +187,6 @@ The Xahau Docker repositories (Mainnet and Testnet) each contains a script to au
|
||||
4. Start and enable xahaud to run automatically: <code>systemctl enable --now xahaud</code>
|
||||
5. Verify xahaud is running: <code>/opt/xahaud/bin/xahaud server_info</code>
|
||||
|
||||
## Binary Files
|
||||
Users seeking to install xahaud in non-traditional environments (e.g., outside Ubuntu) may benefit from the binary release packages, which are built with necessary dependencies. This install process is essentially the same as the "Local Install", however, xahaud is not configured as a systemd service and config files are not installed in default directories.
|
||||
1. Download the latest release from [https://build.xahau.tech](https://build.xahau.tech)
|
||||
2. Download and edit the relevant configuration and trusted validators files (see the table below for links to Mainnet and Testnet configurations). Ensure the paths to the validators-xahau.txt file, the database directory, and the logfile are accessible.
|
||||
3. Change permissions on the downloaded binary, so it is executable: <code>chmod 500 [/path/to/xahaud]</code>
|
||||
4. Consider restricting access to xahaud.cfg and validators-xahau.txt: <code>chmod 400 xahaud.cfg validators-xahau.txt</code>
|
||||
5. Run the binary: <code>./[path/to/xahaud] --net --conf [path to xahaud.cfg]</code>
|
||||
6. Verify xahaud is running: <code>./[path/to/xahaud] server_info</code>
|
||||
|
||||
## Resources, Peering, and Configurations
|
||||
This peering is relevant for both Docker containers and local installations.
|
||||
|
||||
@@ -53,8 +206,8 @@ This peering is relevant for both Docker containers and local installations.
|
||||
<tr><td>Docker Container</td><td><a href="https://github.com/Xahau/mainnet-docker">https://github.com/Xahau/mainnet-docker</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker">https://github.com/Xahau/Xahau-Testnet-Docker</a></td></tr>
|
||||
<tr><td>Local Install Scripts</td><td><a href="https://raw.githubusercontent.com/Xahau/mainnet-docker/refs/heads/main/xahaud-install-update.sh">https://raw.githubusercontent.com/Xahau/mainnet-docker/refs/heads/main/xahaud-install-update.sh</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/xahaud-install-update.sh">https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/xahaud-install-update.sh</a></td></tr>
|
||||
<tr><td>Binary Releases</td><td><a href="https://build.xahau.tech">https://build.xahau.tech</a></td><td>Same as Mainnet</td></tr>
|
||||
<tr><td>Sample Configuration File</td><td><a href="https://github.com/Xahau/mainnet-docker/blob/main/store/etc/xahaud.sample.cfg">https://github.com/Xahau/mainnet-docker/blob/main/store/etc/xahaud.sample.cfg</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/xahaud.cfg">https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/xahaud.cfg</a></td></tr>
|
||||
<tr><td>Sample Trusted Validators (UNL) File</td><td><a href="https://github.com/Xahau/mainnet-docker/blob/main/store/etc/validators-xahau.sample.txt">https://github.com/Xahau/mainnet-docker/blob/main/store/etc/validators-xahau.sample.txt</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/validators-xahau.txt">https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/validators-xahau.txt</a></td></tr>
|
||||
<tr><td>Sample Configuration File</td><td><a href="https://github.com/Xahau/xahaud/blob/dev/cfg/xahaud-example.cfg">https://github.com/Xahau/xahaud/blob/dev/cfg/xahaud-example.cfg</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/xahaud.cfg">https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/xahaud.cfg</a></td></tr>
|
||||
<tr><td>Sample Trusted Validators (UNL) File</td><td><a href="https://github.com/Xahau/xahaud/blob/dev/cfg/validators-example.txt">https://github.com/Xahau/xahaud/blob/dev/cfg/validators-example.txt</a></td><td><a href="https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/validators-xahau.txt">https://github.com/Xahau/Xahau-Testnet-Docker/blob/main/store/etc/validators-xahau.txt</a></td></tr>
|
||||
<tr><td>Documented Configuration Files</td><td><a href="https://github.com/Xahau/xahaud/tree/dev/cfg">https://github.com/Xahau/xahaud/tree/dev/cfg</a></td><td>Same as Mainnet</td></tr>
|
||||
<tr><td>Github Build Actions (release numbers)</td><td style="word-break: break-all;"><a href="https://github.com/Xahau/xahaud/actions?query=branch%3Arelease+is%3Asuccess+build+using+docker">https://github.com/Xahau/xahaud/actions?query=branch%3Arelease+is%3Asuccess+build+using+docker</a></td><td>Same as Mainnet</td></tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Interacting With xahaud Using Websocket and RPC
|
||||
title: Interact With xahaud Using Websocket and RPC
|
||||
---
|
||||
The xahaud software provides both websocket and RPC interfaces that can be configured for a variety of use cases, such as submitting transactions or querying ledger history. Some users may choose to place proxy software in front of xahaud to provide encryption, load balancing, or other benefits. It is possible to install TLS certificates in the xahaud.cfg file using parameters such as `ssl_key = [/path/to/key]`.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ It is possible to run xahaud in diverse configurations, based on a users needs.
|
||||
* Machines storing full history must use XFS or similar to avoid limitations with single file size in EXT4 (max. file size of 16TB). If storing less history, EXT4 is sufficient.
|
||||
* It may be possible to run xahaud on machines that do not meet the below "Minimum" specifications for production servers. However, doing so risks instability.
|
||||
* These system requirements may grow over time. For example, disk space for full history servers is consistently increasing.
|
||||
* As of August 6, 2025 <strong>the full history for the Xahau Network is approximately 8TB</strong>.
|
||||
* As of November 1, 2025 <strong>the full history for the Xahau Network is 10TB</strong>.
|
||||
|
||||
## Recommended Specs for Production xahaud Servers
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Updating xahaud
|
||||
title: Update xahaud
|
||||
---
|
||||
The process for updating xahaud varies depending on the install method used, however, all three methods rely on the releases published at [https://build.xahau.tech](https://build.xahau.tech). When updating a validator, hub, or other 'critical' infrastructure, please check the network health prior to restarting a server to install an update. It is possible to automate the update process using a crontab entry and an update script, however, administrators are discouraged from doing so, as automatic updates may result in restarts at times when the network is unstable. Similarly, human presence allows operators to ensure updates are successful, thereby minimizing downtime.
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Xahau and XRPL operate from different repositories, signifying that they are sep
|
||||
|
||||
Xahau's build process incorporates WebAssembly (WASM) and the Low-Level Virtual Machine (LLVM), which is not described in the XRPL build process. Xahau is utilizing these technologies for enhanced smart contract capabilities and to improve the performance and cross-platform compatibility of its codebase.
|
||||
|
||||
<LinkCard title="Building Xahau" href="/docs/infrastructure/building-xahau/" />
|
||||
<LinkCard title="Build Xahau" href="/docs/infrastructure/build-xahaud" />
|
||||
|
||||
#### Different Amendment Time (5 days)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user