# StarNode更新教程

By [Rain](https://paragraph.com/@rain-2) · 2022-07-18

---

运行StarNode主要是使用PathFinder

[https://github.com/eqlabs/pathfinder](https://github.com/eqlabs/pathfinder)

是源码进行下载编译后，使用编译生成的文件运行。

所以要更新时 ，应更新源码，进行重新编译生成，再执行运行

操作步骤：
-----

*   停止当前pathfinder，使用”ctrl + c”进行停止
    
*   2.进入pathfinder源码目录，并进行更新
    
        // 进入到pathfinder所在目录
        cd pathfinder目录   
        // 查看pathfinder的源码仓库地址
        git remote -v 
        
    

![git status查看当前源码版本；git remote -v查看源码仓库地址](https://storage.googleapis.com/papyrus_images/af328f996712c4e5550b7178282c21e738f66a33a844e95c4938b28bb5a40c99.png)

git status查看当前源码版本；git remote -v查看源码仓库地址

*   3.获取新的源码，切换到最新版本
    
        // 获取新的源码
        git pull
        // 切换到当前最新的代码版本
        // 最新的代码版本可以通过仓库地址查看，如下图在Release下是最新代码版本
        git checkout 最新代码版本
        // 示例：git checkout v0.2.5-alpha
        
    

![](https://storage.googleapis.com/papyrus_images/748da4964c5ae50bf7d907964386fbd546e734b36dce470c2cab293cd0affc84.png)

*   更新依赖（因为当前教程只是讲解更新，所以假设Ruse、Python已经安装完成）
    
        // 进入pathfinder下的py目录
        cd py
        // 激活python虚拟环境
        source .venv/bin/activate
        // 更新PIP，通常不需要
        PIP_REQUIRE_VIRTUALENV=true pip install --upgrade pip
        // 更新项目的依赖，必须操作（因为可能新版本会有其他代码仓库依赖）
        PIP_REQUIRE_VIRTUALENV=true pip install -r requirements-dev.txt
        
    
*   测试
    
        // 进行测试，如下图提示14 passed, 1 skipped，只要没有error都是可以的
        pytest
        
    
*   编译
    
        cargo build --release --bin pathfinder
        
    
*   运行
    
        source py/.venv/bin/activate
        
        cargo run --release --bin pathfinder -- <pathfinder options>
        
    

![测试、编译、运行](https://storage.googleapis.com/papyrus_images/f5a49c5367cecb3c01f613ca53b8179b5abb0082f8fed00b140584865f26bc44.png)

测试、编译、运行

---

*Originally published on [Rain](https://paragraph.com/@rain-2/starnode)*
