The first line !nvidia-smi -L is a command to list all the available NVIDIA GPUs on the machine.
The next line adds the Ethereum repository to the list of sources that the system package manager (apt) will use to look for packages. This is done using the command sudo add-apt-repository ppa:ethereum/ethereum.
The command sudo cat /etc/apt/sources.list is used to concatenate the existing sources.list file with the newly added Ethereum repository.
The command sudo apt update updates the list of available packages in the repository.
The command sudo apt install ethereum installs the Ethereum package, which is required for mining.
The next command wget https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz downloads the ethminer program from the official GitHub releases page.
The command tar -zxvf ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz is used to extract the downloaded archive.
The command %cd bin/ changes the current working directory to the bin folder where the extracted ethminer program is located.
Overall, this code automates the installation and setup process for mining Ethereum using a GPU on a Linux machine.
Note:Google may ban your colab account for mining Ethereum continuously 2 hours
# The following command can also be used for getting the GPU details (Not Mandatory)
!nvidia-smi -L
!sudo add-apt-repository ppa:ethereum/ethereum
# Concatenating sources.list with ethereum repository
!sudo cat /etc/apt/sources.list
# Update entire packages thats installed
!sudo apt update
# Installing Ethereum Package
!sudo apt install ethereum
# Downloading Ethminer Github Releases
!wget https://github.com/ethereum-mining/ethminer/releases/download/v0.18.0/ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz
#Extracting Ethimer and Changing to bin directory
%ls
!tar -zxvf ethminer-0.18.0-cuda-9-linux-x86_64.tar.gz
%cd bin/
# Exec ethminer using Pool address
!./ethminer -G -P stratum1+tcp://<YOUR_POOL_ADDRESS>@eth-asia1.nanopool.org:9999
# %ls
0 Comments