> For the complete documentation index, see [llms.txt](https://docs.x1.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.x1.xyz/validating/create-a-read-only-node.md).

# Create a read-only node

Open a Terminal application

## 1. Install rust, cargo, rustfmt etc

Install rustc, cargo and rustfmt.

```sh
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup component add rustfmt
```

Also install git and the build libraries:

{% code overflow="wrap" %}

```sh
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev libudev-dev zlib1g-dev \
  llvm clang libclang-dev cmake make libprotobuf-dev protobuf-compiler git curl
```

{% endcode %}

## 2. Install Tachyon and the Solana tools

Clone the Tachyon repository:

```sh
git clone https://github.com/x1-labs/tachyon.git
```

Build Tachyon and the solana tools from the `v4.0` branch:

```sh
cd tachyon
git checkout v4.0
git pull
cargo build --release
```

Update your `PATH` environment variable:

```sh
export PATH=$PATH:$(pwd)/target/release
echo "export PATH=$PATH:$(pwd)/target/release" >> ~/.bashrc
```

Verify the installation:

```sh
solana --version
tachyon-validator --version
```

> If you see the versions listed below, the installation was successful:

```
solana-cli 4.0.3 (src:xxxxxxxx; feat:2137973216, client:Tachyon)
tachyon-validator 4.0.3 (src:xxxxxxxx; feat:2137973216, client:Tachyon)
```

## 3. System Tuning (Linux)

Your system will need to be tuned in order to run properly. Your validator may not start without the settings below.

#### Optimize sysctl knobs

```sh
sudo bash -c "cat >/etc/sysctl.d/21-tachyon-validator.conf <<EOF
# Increase UDP buffer sizes
net.core.rmem_default = 134217728
net.core.rmem_max = 134217728
net.core.wmem_default = 134217728
net.core.wmem_max = 134217728

# Increase memory mapped files limit
vm.max_map_count = 1000000

# Increase number of allowed open file descriptors
fs.nr_open = 1000000
EOF"
```

```sh
sudo sysctl -p /etc/sysctl.d/21-tachyon-validator.conf
```

#### **Increase systemd and session file limits**

Add

```sh
LimitNOFILE=1000000
DefaultLimitMEMLOCK=2000000000
```

to the `[Service]` section of your systemd service file, if you use one, otherwise add

```sh
DefaultLimitNOFILE=1000000
DefaultLimitMEMLOCK=2000000000
```

to the `[Manager]` section of `/etc/systemd/system.conf, using`

```sh
nano /etc/systemd/system.conf
```

#### Execute configuration

```sh
sudo systemctl daemon-reload
```

```sh
sudo bash -c "cat >/etc/security/limits.d/90-tachyon-nofiles.conf <<EOF
# Increase process file descriptor count limit
* - nofile 1000000
# Increase memory locked limit (kB)
* - memlock 2000000
EOF"
```

Close all open sessions (log out then, in again) or run the following:

```sh
sudo loginctl terminate-user $USER
```

## 4. Set the network

Point the CLI at X1 Mainnet:

```sh
solana config set -u https://rpc.mainnet.x1.xyz
```

For X1 Testnet, use `https://rpc.testnet.x1.xyz` instead.

To verify set network, use:

```sh
solana config get
```

## 5. Create keypairs

Using command **solana-keygen** to generate a new wallet. It will generate a 12-word seed (aka. mnemonic, or recovery) phrase. Save it safe.

```sh
solana-keygen new --no-passphrase -o ~/.config/solana/id.json
solana-keygen new --no-passphrase -o ~/.config/solana/identity.json
solana-keygen new --no-passphrase -o ~/.config/solana/vote.json
solana-keygen new --no-passphrase -o ~/.config/solana/stake.json
```

<figure><img src="https://1886332998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fis100gr6YdQFA0E9ARbX%2Fuploads%2FonqmgqkNtGaoogOCLiRw%2Fid-1.png?alt=media&amp;token=0e0d39f6-6690-4072-8cee-a3ce5d93d34b" alt=""><figcaption><p>4 created keypairs are needed to run a validator. id can be used at withdrawer.</p></figcaption></figure>

To switch between keypairs:

```sh
solana config set -k id.json
```

## 6. Fund wallet

Make sure you have XNT in your wallet before you continue.

Check balance:

```sh
solana balance
```

## 7. Create a validator startup script & start node

In your ubuntu home directory (e.g. `/home/ubuntu/`), create a folder called `bin`. Inside that folder create a file called `validator.sh` and make it executable:

```sh
mkdir -p $HOME/bin
touch $HOME/bin/validator.sh
```

Next, open the `validator.sh` file for editing:

```sh
nano $HOME/bin/validator.sh
```

Copy and paste the following contents into `validator.sh` then save the file:

```sh
#!/bin/bash
export RUST_LOG=solana_metrics=warn,info
exec tachyon-validator \
  --identity $HOME/.config/solana/identity.json \
  --vote-account $HOME/.config/solana/vote.json \
  --entrypoint entrypoint0.mainnet.x1.xyz:8001 \
  --entrypoint entrypoint1.mainnet.x1.xyz:8001 \
  --entrypoint entrypoint2.mainnet.x1.xyz:8001 \
  --entrypoint entrypoint3.mainnet.x1.xyz:8001 \
  --entrypoint entrypoint4.mainnet.x1.xyz:8001 \
  --known-validator 2skZy1HiefFby6a8raendfWGKGRmpcDiwvuPj1v7atch \
  --known-validator 9zkHekQ7TS1JddcGMgMsZYDUc3xvGzUnXCAfKERvuwUR \
  --known-validator ErccS37ii8NbPjsDdGso93vGj7rkF8WhuCV7GhoWmqsS \
  --known-validator 8MUdMKKnod3zD1errE1jjeswLtuZ7jNiTvN2EC5cqbCG \
  --known-validator 3ka4FFFTm3YgTJ17598ApHuzxELd7PcHnHQsY8uqbDsu \
  --known-validator wwcXJz47MTnZacxJ4WSxbhtKuiZvHVqDrBbNCCpjVp1 \
  --only-known-rpc \
  --log $HOME/validator.log \
  --ledger $HOME/ledger \
  --rpc-port 8899 \
  --full-rpc-api \
  --dynamic-port-range 8000-8030 \
  --wal-recovery-mode skip_any_corrupted_record \
  --limit-ledger-size 50000000 \
  --enable-rpc-transaction-history \
  --enable-extended-tx-metadata-storage \
  --rpc-pubsub-enable-block-subscription \
  --full-snapshot-interval-slots 5000 \
  --maximum-incremental-snapshots-to-retain 10 \
  --maximum-full-snapshots-to-retain 50
```

{% hint style="warning" %}
**Using tmpfs or ZFS for accounts?** Tachyon v4.0 unpacks snapshots using direct I/O instead of routing snapshot writes through the operating system page cache. This improves startup time and snapshot restore performance, since snapshot data is streamed to disk and doesn't need to displace hotter validator data from memory. Filesystems that don't support `O_DIRECT` — such as `tmpfs` and `zfs` — can't do this, and snapshot unpacking will fail.

Check the filesystem holding your accounts directory (`--accounts` if you set one, otherwise `$HOME/ledger/accounts`):

```sh
df -T $HOME/ledger
```

If it reports `tmpfs` or `zfs`, add `--no-accounts-db-snapshots-direct-io` to `validator.sh` to opt out of direct I/O.
{% endhint %}

Make validator startup script executable:

```sh
chmod +x $HOME/bin/validator.sh
```

Make sure you're in the home directory:

```sh
cd $HOME
```

Start validator with nohup:

```sh
nohup $HOME/bin/validator.sh &
```

Check validator logs to see if it's running:

```sh
tail -f $HOME/validator.log
```

Check catch up status:

```
solana catchup --our-localhost
```

Use monitor command to check validator operations:

```sh
tachyon-validator --ledger ./ledger monitor
```

See all nodes connected to network, whether they are staked or not. Your identity.json should show up there.

```sh
solana gossip
```

Check validator process:

```sh
ps aux | grep validator
```

Kill validator process:

```sh
tachyon-validator exit -f
```
