(thanks XenTzu)
This guide covers the installation of Rust and Solana, wallet creation and funding on the Solana testnet, and running the 420Miner script.
Prerequisites: Get access to a server where you can execute these commands. I am using Ubuntu 22.04 on WSL (Windows Subsystem for Linux) to illustrate the process in this guide.
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Install Solana
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
You may need to Configure Solana CLI (make sure your home directory matches):export PATH="/home/ubuntu/.local/share/solana/install/active_release/bin:$PATH"
Confirm Solana is installedsolana --version
Create and Configure Wallets
Create a first wallet:
solana-keygen new
Configure Solana Testnet
solana config set --url https://api.testnet.solana.com
Airdrop 1 Sol to your first wallet
solana airdrop 1
Check balance, should be 1 SOLsolana balance
Set up a second wallet
cp /home/ubuntu/.config/solana/id.json /home/ubuntu/.config/solana/id1.json
Create second walletsolana-keygen new --force
Airdrop 1 Sol to your second wallet:solana airdrop 1
If it doesn’t work and you encounter the following error:
, note that the Solana Testnet faucet limits the rate of SOL based on your computer’s wallet and IP address.
Easy fix:
Create a Cargo Project
cargo new my_project
If you get an error, install cargo first:
sudo apt install cargo
Navigate to the new directory:cd my_project
Once done, edid Cargo.toml file to add solana-client and solana-sdk dependencies:nano Cargo.toml
To do so, insert these lines into dependencies:
[dependencies]
solana-client = "1.10"
solana-sdk = "1.10"
Set Up & Run SolXEN Miner
Get SolXEN Miner (code) from the following URL:
https://gist.githubusercontent.com/jacklevin74/b3b3709aa3e66eab8f762c0fb4de53ff/raw/51ad482cd8c5a1d6c77457ae2c12378e4333a788/rs
Now, edit the miner script main.rs, remove all content from it and paste the content into it from the URL above:nano src/main.rs
and
Please note, if your home directory is not /home/ubuntu, amend the script to ensure home directory paths are correct.
Once done, save the file.
Build the project
cargo build
Execute the compiled program (run the miner)cargo run
Verify transactions on the testnet:
Check the updated SOL balancesolana balance
Check the transaction history and results by entering your wallet’s public address on the Solana explorer: https://explorer.solana.com/address/YOUR_WALLET_ADDRESS?cluster=testnet.
Navigate to Transaction History, to see the hashes with ‘420’ string to confirm the successful mining of SolXen:
Enjoy!