Heurist Mining Guide
0. Start with heurist
Official Document: https://docs.heurist.ai/
Twitter: https://twitter.com/heurist_ai
Website: http://heurist.ai/
1. Where to rent GPU?
To mine on @heurist_ai, you will need a GPU. You can use your own GPU or rent from outside. My recommendation is using RTX 3xxx, 4xxx, A6000 and 6000ADA. Other GPU still be suitable for mining.
If you don’t have GPU or don’t want to use your own GPU, there are some place for you:
@heurist_ai: Team offers node rental. You don’t need to do anything, just pay money and get points. Team will take care the rest. Don’t need to read anymore, just head to https://discord.gg/QssH9JjC and create a ticket. Mod will reach you soon.
https://cloud.vast.ai/ : Most common marketplace for AI mining. Guide to rent: https://twitter.com/Psyxology_/status/1775279233537130954
https://console.akash.network/ : Onchain marketplace build on Cosmos network. Guide to rent: https://mirror.xyz/0xC36A87666c505Fe695fc097d238725ff4d34877D/4aIgauH_MXe9oxYvUNgtaZIS0qcQdaXcZYBLbO3N8O4
https://www.runpod.io/ : Other marketplace like vast.
https://clore.ai/marketplace : Onchain marketplace like akash, build on their own network.
Some notice when you deploy GPU:
You should use this docker/image:
pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel
. However other docker/image still fine.To run LLM you need 60GB storage, SD 80GB and if you want to run both 120GB
CUDA = 12.1 or 12.2
GPU minimum VRAM is 24GB
LLM performance is affected by bandwidth. If u run llm, choose a strong bandwidth GPU.
Vram of your GPU:
Optimal GPU: RTX3090, RTX4090 for 24GB Vram, A6000 and 6000ada for 40GB Vram model
2. Set up your node
First prepare an EVM wallet. It can hold NFT to boost point. The multiplier show below
Paste code on terminal: right click. Run code: Enter. End current task: Ctrl + C
Open your terminal, install tmux with this command and open tmux (If u have already got it skip this):
sudo apt update && sudo apt install tmux -y && tmux
It should appear like this:
Then install these libraries:
sudo apt update && sudo apt install python3-venv -y && sudo apt install curl -y && sudo apt install git -y
Then install anaconda:
curl --output anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh && bash anaconda.sh
Ctrl C then enter to skip reading their terms, then type yes to agree and enter to install. Finally type yes to finish
Next active conda:
conda init bash && source ~/.bashrc && conda create --name heurist-miner python=3.11 & conda activate heurist-miner
It should appear like this
Then install from heurist github and require lib:
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia && git clone https://github.com/heurist-network/miner-release && cd miner-release && pip install -r requirements.txt
Next create
.env
file:
touch .env && apt install nano -y && nano .env
Then input your EVM wallet address. This wallet will store your point mining and will receive airdrop further, so store it carefully.
MINER_ID_0=0xYourFirstWalletAddressHere
MINER_ID_1=0xYourSecondWalletAddressHere
The number of miner id depends on how much GPU on your device. If u rent GPU like this, you will need 4 miner id
MINER_ID_0=0xYourFirstWalletAddressHere
MINER_ID_1=0xYourSecondWalletAddressHere
MINER_ID_2=0xYourThirdWalletAddressHere
MINER_ID_3=0xYourFourthWalletAddressHere
Optional: You can add tag for your wallet by adding “-<Tag>” after the wallet, it will help you to track performance later on dashboard
After that, Ctrl + X to exit file, Y to save file and enter to remain its name.
Optional: You can view what is in the file by using cat
command.
cat .env
Modify
config.toml
nano config.toml
When:
Your gpu not located in Asia: You should use sequence url: http://sequencer-na.heurist.xyz/ . This server base in North America (New York). It can reduce your network latency
Change base_url
to http://sequencer-na.heurist.xyz/. You can use arrow to move around file
You have more than 1 GPU. This only apply to SD
Change num_cuda_devices
to your number of GPU
You want to get more point. This only apply to LLM (Your GPU should be strong enough to handle this)
Increase num_child_process
and concurrency_soft_limit
Remember to Ctrl + X to exit file, Y to save file and enter to remain its name.
For LLM: Finally, install these 2 libs:
sudo apt install jq -y && sudo apt install bc -y
3. Identity Wallet
After you have set up your GPU, now you need an Identity Wallet to authenticate every request sent by your miner. Each EVM wallet is only associated to one Identity Wallet. That mean you only need to do that for the first time
Remember:
One reward wallet always binds to one identity wallet. Without it, you won't receive rewards for completed jobs
Do not use the reward wallet as the identity wallet
Do not hold any funds in the identity wallet
Back up the seed phrase of the identity wallet. If you lose it, you need to sign an on-chain transaction from the reward wallet to recover.
To create Identity Wallet, run this cmd
cd $HOME/miner-release && python3 ./auth/generator.py
Then save your Identity Wallet information and press y. The number of Identity Wallets generated based on your number of EVM wallets in .env
If you change your GPU, when you run python3 ./auth/generator.py
it will appear like this
Then import your Identity Wallet seed phrase you have save before.
Finally press y and enter and you are done.
Now head to 4. Run the miner
Optional: In case you change GPU and forget to save Identity Wallet seed phrase after your wallet have bound:
First, faucet ETH on zkSync Era Sepolia testnet by using these link
Or you can buy from
https://testnetbridge.com/sepolia (Use Arbitrum for optimal amount, 0.1$ in ETH is enough)
Then bridge from Sepolia to zkSync Era Sepolia by
https://portal.zksync.io/bridge/?network=sepolia
Then add zkSync Era Sepolia testnet to your wallet
https://chainlist.org/chain/300
Then open Heurist contract https://sepolia.explorer.zksync.io/address/0x7798de1aE119b76037299F9B063e39760D530C10#contract
Then choose Write and connect your wallet.
Then choose mintandbind and input your wallet
rwAddress: your evm address . This must exactly the same with address you have connected to
iwAddress: your Identity Wallet
Then write, accept fee and you are done
Repeat this step for all other wallets.
After that returned to the terminal. You can run again to check if your wallet is binding.
python3 ./auth/generator.py
4. Run the miner
Finally, you have finish set up everything. Congratulations! Now you just need only a few command to start mining on Heurist.
For SD miner:
python3 sd-miner.py
If you want to run a lighter model, use this command. Although this will bring you less point, your GPU will take up less vram so that you can run more screen (However this is currently disable):
python3 sd-miner.py --exclude-sdxl
Finally type yes to install your model and let it cook.
In case your GPU is strong enough and you want to earn more points, create a new screen by pressing Ctrl + B then press C to create new window.
Then run
cd miner-release && conda activate heurist-miner
Then start the miner again. Remember to do this after you have installed model from your first screen. However it can crash your GPU, so be careful
For LLM miner:
./llm-miner-starter.sh <your model id>
Replace <your model id>
with
dolphin-2.9-llama3-8b
or openhermes-2-pro-mistral-7b
if your GPU have >24GB VRAM (ex: RTX 3090, RTX 4090)
openhermes-mixtral-8x7b-gptq
if your GPU have >40GB VRAM (ex: A6000, 6000ada)
Congratulations! Your node is running. Happy mining!
5. Update miner
If you are running older versions, update the miner:
git checkout main && git restore . && git pull
Then install all lib again
pip install -r requirements.txt
Then back to 3. Identity Wallet and follow instructions to bind your wallet.
6. Common question
What can I do if I change GPU and forget to save my previous Identity Wallet?
Solution: Run python auth/generator.py --new 0xYourRewardWalletAddress
to create new Identity Wallet and return to 3. Identity Wallet
What can I do if I have bound my Identity Wallet, change GPU and forget to save my previous Identity Wallet?
Solution: In 3. Identity Wallet Use mintandbind function, rwAddress
is your EVM wallet and iwAddress
is your new Identity Wallet.
Why sometime I face up with 0.0 token/s for llm model? How can I fix it?
Solution: You can switch to other model to run
I face up with this error, how can i fix?
Solution: Run cat .env
to check your number of miner id, make sure about syntax
and number of id have to match number of GPU. Also nano config.toml
to change num_cuda_devices
to match number of your GPU
I face up with this error, how can i fix?
Solution: run nvidia-smi
to check if your GPU have enough VRAM. In case it has enough but this error still occur, you are mining with CPU. My advice is you should rent other GPU
Last updated