🛰️Relayer

Clear and concise explanation of how to install relayer.

Key generating

If you have used Jito-Relayer before, you can skip this step as you already have the keys.

The relayer needs to authenticate connections from validators. It accomplishes this through challenge/reponse system that creates authentication tokens signed by both the relayer and validator. The relayer uses a pair of JWT tokens that can be generated with the following commands:

OUTPUT_DIR=/home/sol/.keys
openssl genrsa --out $OUTPUT_DIR/private.pem
openssl rsa --in $OUTPUT_DIR/private.pem --pubout --out $OUTPUT_DIR/public.pem

Enter the path where you want to store the tokens in OUTPUT_DIR. You will need to provide this path when starting the relayer below.

Additionally, the relayer must be authenticated by the block engine. To do this, you need to generate a Solana keypair and submit a ticket in the Jito Discord to get whitelisted for the block engines. JitoDiscord: https://discord.gg/GeSsKtBeJn

solana-keygen new --no-bip39-passphrase --outfile relayer-keypair.json

Build Relayer

To set it up, you will need to clone our relay from Git and build it.

git clone https://github.com/jito-foundation/jito-relayer.git
cd jito-relayer
git submodule update -i -r
cargo b --release

SetUp JitoRelayer

This command will automatically create the relayer.service file, and it will detect and insert the public IP and user ID. Make sure the paths to all files are correct before executing the command.

sudo tee /etc/systemd/system/jito-relayer.service > /dev/null <<EOF
[Unit]
Description=Solana transaction relayer
Requires=network-online.target
After=network-online.target

# Ensure required keypair files exist
ConditionPathExists=/home/sol/keys/relayer-keypair.json
ConditionPathExists=/home/sol/keys/private.pem
ConditionPathExists=/home/sol/keys/public.pem

[Service]
Type=simple
User=root
Restart=on-failure
Environment=RUST_LOG=debug
Environment=SOLANA_METRICS_CONFIG="host=http://metrics.jito.wtf:8086,db=relayer,u=relayer-operators,p=jito-relayer-write"
Environment=BLOCK_ENGINE_URL=http://195.189.96.112:9090/
Environment=GRPC_BIND_IP=127.0.0.1
Environment=GRPC_BIND_PORT=11226
Environment=TPU_QUIC_PORT=11228
Environment=TPU_QUIC_FORWARD_PORT=11229

ExecStart=/home/sol/jito-relayer/target/release/jito-transaction-relayer \
          --keypair-path=/home/sol/keys/relayer-keypair.json \
          --signing-key-pem-path=/home/sol/keys/private.pem \
          --verifying-key-pem-path=/home/sol/keys/public.pem \
          --grpc-bind-ip ${GRPC_BIND_IP} \
          --grpc-bind-port ${GRPC_BIND_PORT} \
          --tpu-quic-port ${TPU_QUIC_PORT} \
          --tpu-quic-fwd-port ${TPU_QUIC_FORWARD_PORT} \
          --block-engine-url ${BLOCK_ENGINE_URL} \
	  --forward-all \
          --allowed-validators your-validator-pubkey
EOF

The systemctl jito-relayer was created, but do not start it now.

SetUp Solana validator with this keys

DO NOT start a validator without this keys!

When you end with Relayer preparation and add needed keys to the validator you need to setting up firewall:

  --relayer-url http://127.0.0.1:11226 \
  --block-engine-url http://195.189.96.112:9090 \
  --shred-receiver-address 195.189.96.112:1002 \
  --private-rpc \
  --full-rpc-api \
  --rpc-port 8899 \
  --account-index program-id \
  --account-index-include-key AddressLookupTab1e1111111111111111111111111

Firewall

sudo ufw allow 8000:8020/tcp
sudo ufw allow 8000:8020/udp
sudo ufw allow 11228,11229/udp

🚀 Relayer Launch

Finally! Now we can launch the relayer and our validator with all the necessary parameters.

For starting rellayer you need to write next commands:

Reload the systemd configuration sudo systemctl daemon-reload

Start the relayer sudo systemctl restart jito-relayer

If everything is set up correctly, you will see that your validator is connected and using the relayer: https://grafana.metrics.jito.wtf:3000/ (use your PUBKEY in the "Host" field to locate your relayer).

Last step

Before starting to use the relayer, go to the next section and read it carefully.

Last updated