这里是一个 GPT 优化教程帮助你在 DEVNET 上安装和配置 ORE V2
-
安装 Debian:
wsl --install debian
-
设置 Debian 为默认 WSL:
wsl --setdefault Debian
-
进入系统:
wsl
sudo apt install -y curl wget git build-essential software-properties-common
curl https://sh.rustup.rs -sSf | sh
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
-
进入主目录:
cd ~
-
生成自定义开头地址的私钥:
solana-keygen grind --starts-and-ends-with 自定义::1 --ignore-case >> seed.txt
-
复制私钥到默认路径:
cp ~/*.json $HOME/.config/solana/id.json
solana config set --url d
solana airdrop 1
-
克隆 ORE 仓库:
cd ~ git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore
-
克隆 ORE-CLI 仓库:
git clone -b hardhat/v2 --single-branch https://github.com/hardhatchad/ore-cli
-
克隆 DrillX 仓库:
git clone https://github.com/hardhatchad/drillx
-
下载并安装 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
-
添加贡献软件库并更新:
sudo add-apt-repository contrib sudo apt-get update
-
安装 CUDA 工具包和驱动:
sudo apt-get -y install cuda-toolkit-12-4 nvidia-kernel-open-dkms cuda-drivers
- 添加 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
-
进入 ORE-CLI 目录:
cd ~/ore-cli
-
使用 GPU 编译:cargo build --release --features="gpu" sudo cp ~/ore-cli/target/release/ore /usr/local/bin/ore
-
使用 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
-
删除旧版本:
cd ~ rm -rf ~/ore* && rm -rf ~/drillx
-
克隆新版本:
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
-
编译新版本:
cd ~/ore-cli cargo build --release sudo cp ~/ore-cli/target/release/ore /usr/local/bin/ore
sudo rm /usr/local/bin/ore
(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)