David Zup
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Run your first StarkNet node Thanks to great work of [Equilibrium](https://www.equilibrium.co/) and [Starkware](https://starkware.co/) teams we are now able to **run our own nodes** on StarkNet, helping to keep the network secure and the data accurate. This tutorial will guide you through the process of setting up your first **StarkNet node**. # Part 1: Install Windows Subsystem for Linux You can skip this part if you have a **Linux distribution** already running. In this tutorial we will use **Ubuntu 20.04 LTS** or **18.04 LTS** as Linux distributions. Feel free to use any other distro if you find it more preferable. 1. First, open **Windows PowerShell** or CMD by searching for it in your Windows search bar, then select Run as administrator. ![](https://i.imgur.com/5M0NvNN.png) 2. At the command prompt type: `wsl –install` And wait for the process to complete. For WSL to be properly activated, you will now need to **restart** your computer. 3. Open **Microsoft store app** and search for **Ubuntu**. There will be three options available. You can choose any of them. Once installed, you can either launch the application directly from the store or search for Ubuntu in your Windows search bar. ![](https://i.imgur.com/EhCk59D.png) 5. **Configure Ubuntu** Congratulations, you now have an Ubuntu terminal running on your Windows machine. Once it has finished its initial setup, you will need to create a username and password (this does not need to match your Windows user credentials). ![](https://i.imgur.com/SM5Z0f3.png) Finally, it’s always good practice to install the latest **updates** with the following commands, entering your password when prompted. `sudo apt update` Then `sudo apt full-upgrade` Press **Y** when prompted. For any **troubleshooting** or more in-depth instructions on how to get Ubuntu running on your system please visit Ubuntu official tutorials - links provided in [Resources](https://hackmd.io/6OHE-4y8SRidp1IVm1qRqg#Resources). # Part 2: Install dev tools on your Linux distro 1. First check the **version of Python 3** that is installed in the system by typing: `python3 -V` You’ll receive output in the terminal window that will let you know the version number. While this number may vary, the output will be similar to this: ![](https://i.imgur.com/o6EV0E6.png) 2. To manage software packages for Python, let’s install **pip**, a tool that will install and manage programming packages we may want to use later. `sudo apt install -y python3-pip` 3. There are a **few more packages and development tools** to install to ensure that we have a robust setup for our programming environment: `sudo apt install -y build-essential libssl-dev libffi-dev python3-dev` Then `sudo apt-get install libgmp-dev` And then `pip3 install fastecdsa` Now you have **fastecdsa** (a python tool for doing fast elliptic curve cryptography, specifically digital signatures) installed. To really not miss something later also run `sudo apt-get install -y pkg-config` # Part 3: Install Rust 1. We also need to install **Rust programming language** and its tools since Equilibrium node is built in Rust. Run `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` 2. Just in case if there was something left uninstalled in previous step then run `sudo apt install cargo` # Part 4: Clone pathfinder github repository Congratulations, you now made it to the part where we will actually start preparing enviroment for our node. **Create a local copy** of pathfinder's github repository by typing: `git clone https://github.com/eqlabs/pathfinder.git` # Part 5: Create a virtual environment for a node 1. Install a **tool that will enable us to create virtual environment** in which our node will run: `sudo apt install python3.8-venv` 2. Move to **py folder** by typing `cd pathfinder/py` You should now see something like this ![](https://i.imgur.com/jDqeYpW.png) 3. Create the **virtual environment** called *venv* `python3 -m venv .venv` and activate it `source .venv/bin/activate` You will know that you are in your virtual environment when you will see (.venv) on the left side of you command line: ![](https://i.imgur.com/2jqgyBx.png) 4. Install some **more tools** for our node by running `PIP_REQUIRE_VIRTUALENV=true pip install --upgrade pip` then `PIP_REQUIRE_VIRTUALENV=true pip install -r requirements-dev.txt` 5. **Test** if your previous steps were successful by running `pytest` Your output should look something like this ![](https://i.imgur.com/NBdnoIX.png) # Part 6: Assemble your node You can compile your node by running the following command. Please stay in your virtual environment (venv) for this step. You will also be running your node from venv. `cargo build --release --bin pathfinder` This step will take a bit longer than the others (up to 30 minutes depending on your system configuration). # Part 7: Create Infura or Alchemy account If you want to run a node on Layer 2 (StarkNet) you will also need to know what is happening on Layer 1 since your node will calculate StarkNet state's root and **confirm it against L1**. Thus, we need to access **L1 full archive node**. You can do that by connecting to your L1 node or if you don't run one set up an account with a third party API provider like [Infura](https://infura.io/), [Alchemy](https://alchemyapi.io/), [ArchiveNode](https://archivenode.io/) or [QuikNode](https://www.quiknode.io/). In this tutorial we will set up an account with **Infura** or **Alchemy**. Choose either one. > Additional tutorial on how to run your L2 node in parallel with **Ethereum execution client** like [Nethermind](http://nethermind.io/), [Erigon](https://github.com/ledgerwatch/erigon) or [Besu](https://consensys.net/quorum/developers/) will be provided at a later date. ## Infura 1. Go to infura.io and sing up 2. On your dashboard click on *Connect to the Ethereum network in seconds* ![](https://i.imgur.com/XcOkH7m.png) 4. Create a new project and gave it a name. 5. Still on your dashboard click on Settings ![](https://i.imgur.com/YD4ivxH.png) 7. In settings panel you will be able to see the endpoints. Copy the **https** one. At this stage you will also have to decide on which Ethereum network you will run your node on. You can choose either **Mainnet** or **Goerli**. >If you choose the endpoint on the Goerli network, then your node will run on the **StarkNet testnet** on Goerli. If the chosen endpoint is on mainnet, then it will run on **StarkNet Mainnet**. ## Alchemy 1. Go to [alchemy.com](https://www.alchemy.com/)and sing up 2. On your dashboard click on *Create App* ![](https://i.imgur.com/9thPpyI.png) 3. Give your new app a name and choose either Mainnet or Goerli Network ![](https://i.imgur.com/ABYjQZ4.png) 4. You will now be able to see the endpoint on your dashboard. Copy the **https** one. ![](https://i.imgur.com/NF22X1T.png) # Part 8: Run your node There is only one thing left to do - to run your first node on Layer 2! You can test run your node by typing (replace the xxxxx with your Infura endpoint number) `cargo run --release --bin pathfinder -- --ethereum.url https://mainnet.infura.io/v3/xxxxx` or in case you are using Alchemy API by running (replace the xxxxx with your Alchemy API key) `cargo run --release --bin pathfinder -- --ethereum.url https://eth-goerli.alchemyapi.io/v2/xxxxx` Please make sure that you are in your pathfinder/py folder and have your virtual enviroment activated in order to successfully run the node. You should see something like this: ![](https://i.imgur.com/e28hgMb.png) # Resources **Ubuntu** installation (WIN10 and WIN11) https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview **Rust** insatllation https://www.rust-lang.org/tools/install **Pathfinder** repository https://github.com/eqlabs/pathfinder

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully