/pathfinder

A Starknet full node written in Rust

Primary LanguageRustOtherNOASSERTION

Welcome to Pathfinder

A StarkNet full node written in Rust.

This project is a work-in-progress and is not yet usable.

A first release will be made with the completion of Milestone I.

Table of Contents

Roadmap

The end goal is to have a node which

  • holds the full StarkNet state
  • synchronises StarkNet state from both L1 and L2 (p2p)
  • verifies L2 state against L1
  • provides an RPC API for interacting with StarkNet state
  • participates in the L2 StarkNet network
    • propagating state
    • propagating transactions

The roadmap has been split into milestones, with goals in the later milestones being less certain and well-defined.

Milestone I

A node which has no p2p capabilities. It synchronises network state using L1 and L2 (StarkNet gateway), and provides an HTTP RPC API.

  • retrieve state updates from L1
    • state root
    • contract deployments
    • contract updates
  • retrieve state from StarkNet sequencer gateway
    • blocks
    • transactions
    • contract code
  • serve RPC API
  • storage
    • global state
    • contract definitions
    • transactions
    • blocks
  • basic user configuration
  • sync state from L1 and L2
  • run starknet_call locally
  • validate contract code against L1
  • integrate various components
  • documentation

Milestone II

Establish p2p network, state is now propagated between nodes.

Add support for syncing completely from L1.

Milestone III

Create a transaction mempool, transactions are now propagated between nodes.

Add contract calls to RPC API: invoke and deploy.

Developers

Note that this project is currently only built on linux; but we do plan on supporting MacOs and Windows in the future.

Getting started

Install Rust, by following the official Rust instructions.

git clone this project and you should be good to go.

Building

Invoke cargo build from the project root.

Testing

Some of our tests require access to an archive Ethereum node. If you want to run these tests you will require setting the environment variable STARKNET_ETHEREUM_WEBSOCKET_URL to the websocket address of a Goerli full node. Infura provides such nodes for free (on Goerli testnet), and is what we currently use for our own CI.

Example with an Infura node:

export STARKNET_ETHEREUM_WEBSOCKET_URL=wss://goerli.infura.io/ws/v3/<project-id>

Run the tests (invoke from project root):

cargo test

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.