Skip to content

Latest commit

 

History

History
179 lines (132 loc) · 3.59 KB

README_CN.md

File metadata and controls

179 lines (132 loc) · 3.59 KB

这里是一个 GPT 优化教程帮助你在 DEVNET 上安装和配置 ORE V2

View in English


ORE V2 Mine on DEVNET

系统和环境

安装 Debian(可选)

  1. 安装 Debian:

    wsl --install debian
  2. 设置 Debian 为默认 WSL:

    wsl --setdefault Debian
  3. 进入系统:

    wsl

安装依赖

sudo apt install -y curl wget git build-essential software-properties-common

安装 Rust

curl https://sh.rustup.rs -sSf | sh

安装 Solana CLI(完成后重启终端)

sh -c "$(curl -sSfL https://release.solana.com/stable/install)"

生成私钥(自定义开头地址可选)

  1. 进入主目录:

    cd ~
  2. 生成自定义开头地址的私钥:

    solana-keygen grind --starts-and-ends-with 自定义::1 --ignore-case >> seed.txt
  3. 复制私钥到默认路径:

    cp ~/*.json $HOME/.config/solana/id.json

领取测试网 Gas

solana config set --url d
solana airdrop 1

克隆 ORE V2 分支

  1. 克隆 ORE 仓库:

    cd ~
    git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore
  2. 克隆 ORE-CLI 仓库:

    git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore-cli
  3. 克隆 DrillX 仓库:

    git clone https://github.com/hardhatchad/drillx

配置 CUDA & NVCC

  1. 下载并安装 CUDA 密钥环:

    wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb
    sudo dpkg -i cuda-keyring_1.1-1_all.deb
  2. 添加贡献软件库并更新:

    sudo add-apt-repository contrib
    sudo apt-get update
  3. 安装 CUDA 工具包和驱动:

    sudo apt-get -y install cuda-toolkit-12-4 nvidia-kernel-open-dkms cuda-drivers

修复 NVCC 问题

  1. 添加 CUDA 环境变量:
    echo -e "\nexport CUDA_HOME=/usr/local/cuda\nexport LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64\nexport PATH=\$PATH:\$CUDA_HOME/bin" >> ~/.bashrc

编译

  1. 进入 ORE-CLI 目录:

    cd ~/ore-cli
  2. 使用 GPU 编译:

    cargo build --release --features="gpu"
    sudo cp ~/ore-cli/target/release/ore /usr/local/bin/ore
  3. 使用 CPU 编译:

    cargo build --release
    sudo cp ~/ore-cli/target/release/ore /usr/local/bin/ore

挖矿

For GPU:

ore --rpc https://api.devnet.solana.com --keypair ~/.config/solana/id.json mine --buffer-time 2

For CPU:

ore --rpc https://api.devnet.solana.com --keypair ~/.config/solana/id.json mine --buffer-time 2 --threads 12

ORE 更新

  1. 删除旧版本:

    cd ~
    rm -rf ~/ore* && rm -rf ~/drillx
  2. 克隆新版本:

    git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore
    git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore-cli
    git clone https://github.com/hardhatchad/drillx
  3. 编译新版本:

    cd ~/ore-cli
    cargo build --release
    sudo cp ~/ore-cli/target/release/ore /usr/local/bin/ore

ORE 卸载

sudo rm /usr/local/bin/ore

Windows 屏幕关闭

(Add-Type '[DllImport("user32.dll")]public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)