Skip to content

Instantly share code, notes, and snippets.

@diman-io
Last active February 29, 2024 20:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diman-io/05fcaeddd265bdf9f4901d44c06a35c2 to your computer and use it in GitHub Desktop.
Save diman-io/05fcaeddd265bdf9f4901d44c06a35c2 to your computer and use it in GitHub Desktop.
How to run jito-validator

How to run jito-validator

For this example /opt/jito directory will be used as base directory. If you want you can use another base directory.

jito-validator source will be in /opt/jito/jito-solana

jito-validator releases will be in /opt/jito/releases

Use /opt/jito/releases/active_release/bin/solana-validator in your solana.service file

Before you start

Check that jito-solana repository contains solana version you want to install. For this go to https://github.com/jito-foundation/jito-solana and check the tag as showed on the picture:

jito-tags

Actually you can do this from terminal with git tag -l '*-jito' before checkout step (see bellow).

First time

  1. Try cargo -V. If you will see Command 'cargo' not found... (or similar) then install cargo (this's Rust package manager): curl https://sh.rustup.rs -sSf | sh. NB. Do not forget to update your $PATH. Run the command from last line of previous output (usually source "$HOME/.cargo/env")
  2. Install build-essential package and Solana dependencies: sudo apt update && sudo apt install -y build-essential libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler
  3. Try git -v. If you will see Command 'git' not found... (or similar) then install git: sudo apt install -y git
  4. Make base directory: mkdir /opt/jito (if you don't have folder /opt (this's very strange) then use -p arg in this command for creating /opt too (or make folders separately))
  5. Change current directory to base: cd /opt/jito
  6. Clone jito-validator source from github: git clone https://github.com/jito-foundation/jito-solana.git
  7. Change current directory to jito-solana: cd jito-solana

Continue with All times section bellow.

Not first time

  1. Change current directory to jito-solana: cd /opt/jito/jito-solana
  2. Fetch last history from github: git fetch

Continue with All times section bellow.

All times

  1. Save target version for convenience (change 1.10.10 to yours): export JV=v1.10.10-jito
  2. Checkout source: git checkout $JV
  3. Update submodules: git submodule update --init --recursive
  4. Build jito-validator from sources: CARGO_BUILD_JOBS=8 scripts/cargo-install-all.sh --validator-only /opt/jito/releases/$JV (there is a limit of 8 threads for compilation here, you can use this amount or another or don't use at all any limitation (remove CARGO_BUILD_JOBS=8 for this, compilation will get 100% CPU).
  5. Link active_release to this release: ln -sfn $JV /opt/jito/releases/active_release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment