Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 3.37 KB

install-from-source.md

File metadata and controls

112 lines (72 loc) · 3.37 KB

Installation from source

Prerequisites

Currently only supports Linux. Windows and MacOS support is planned. We need access to a full Ethereum node operating on the network matching the Starknet network you wish to run. Currently this is either Sepolia or Mainnet.

⚠️ If using Infura as an L1 provider, you will need access to their archive node facilities. This is because pathfinder requires access to the full log history.

Before you start, make sure your system is up to date with Curl and Git available:

sudo apt update
sudo apt upgrade
sudo apt install curl git

Install Rust

pathfinder requires Rust version 1.80 or later. The easiest way to install Rust is by following the official instructions.

If you already have Rust installed, verify the version:

cargo --version # must be 1.80 or higher

To update your Rust version, use the rustup tool that came with the official instructions:

rustup update

Install build dependencies

pathfinder compilation needs additional libraries to be installed (C compiler, linker, other deps)

sudo apt install build-essential pkg-config libssl-dev protobuf-compiler libzstd-dev

Make sure protoc version is at least 3.15

protoc --version # must be >= 3.15

Alternatively you can grab the latest protoc from the releases page.

Clone pathfinder

Checkout the latest pathfinder release by cloning this repo and checking out the latest version tag. Take care not to be on our main branch as we do actively develop in it.

The remainder of the installation documentation assumes you are in the checkout directory.

Compiling pathfinder

You should now be able to compile pathfinder by running (from within the pathfinder repo):

cargo build --release --bin pathfinder

Updating pathfinder

Updating a pathfinder node from source is fairly straightforward and is a simpler variant of the installation and compilation described above.

pathfinder repository

Start by updating the pathfinder repository to the desired version. From within your pathfinder folder:

git fetch
git checkout <version-tag>

where <version-tag> is the desired pathfinder version. To display a list of all available versions, run

git tag

Build and run pathfinder

Re-compile pathfinder:

cargo build --release --bin pathfinder

and you should now be able to run your pathfinder node as described in the next section.

Running the node

cargo run --release --bin pathfinder -- <pathfinder options>

Note the extra "--" which separates the Rust cargo command options from the configuration options for our node. You can list these configuration options using --help:

cargo run --release --bin pathfinder -- --help

It may take a while to first compile the node on the first invocation if you didn't do the compilation step.

pathfinder runs relative to the current directory. This means things like the database will be created and searched for within the current directory.