Grin mining tutorial that novices can understand

Editor's Note: This article comes fromGrinUpEditor's Note: This article comes from
Regarding the relevant content of the Grin blockchain and the Grin algorithm, GrinUp has already been mentioned in previous articles. You are welcome to pay attention to the official account and reply [grin] and [algorithm] to obtain related articles. This article will directly enter the use of graphics cards to mine Grin. Mining tutorial, let you dig out Grin in the easiest and most comfortable way.
Notice:
Notice:
*This tutorial is also applicable to the Grin blockchain after the mainnet is launched in the future, but it may be necessary to re-download and install the node client and mining client.
Hardware requirements:
Hardware requirements:
A computer running Windows 10 Pro
A graphics card with an Nvidia GTX 1070 or higher configuration, with a minimum of 8G video memory
*Algorithms for 6G video memory may be launched in the future, but the time is unknown
*After testing, the efficiency of CPU mining is too low, and it is almost impossible to generate blocks. We will not recommend CPU mining
*The readers of this tutorial are novice users. For high-end Linux mining or Mac, please move to the official github
This tutorial will cover:
Create Ubuntu desktop virtual machine with Windows Hyper-v
Build a Grin node client in Ubuntu
Configure Grin Node and Wallet in Ubuntu
Confirm Mining Receipt in Ubuntu
secondary title

Create an Ubuntu virtual machine
Windows 10 Professional comes with its own virtualization technology Hyper-v, but it is disabled by default, and you need to manually enable the Hyper-v function. Click the [Windows] key to enter the start menu, enter Hyper-v, click [Start or close Windows features], then check [hyper-v] and click OK, wait for the system to be installed and restart the computer, and enter [hyper- v] You will see a [Hyper-V Manager].
Before installing the Ubuntu virtual machine, we need to obtain the official Ubuntu installation image, just copy the link below to download it, remember the directory you saved, it will be used later. The Ubuntu desktop version is more intuitive and more novice-friendly than the server version, but requires more computer resources.

Ubuntu Desktop: https://www.ubuntu.com/download/desktop
In the virtual machine creation interface, there are only a few parameters that need to be modified:
name ==> whatever
Virtual Machine Algebra ==> Change to "Second Generation"
Memory ==> default
Network ==> default switch (if there is no option, you need to exit the creation interface and create a switch in the Hyper-V interface-[Virtual Switch Manager], otherwise the virtual machine cannot be connected to the Internet)
Virtual hard disk ==> default
Installation options ==> select [Install from a bootable CD/DVD-ROM], select the Ubuntu iso file you just downloaded for the image file.

Click OK to complete the virtual machine creation.

Don't rush to start, [Right click] the virtual machine you just created, enter [Settings], in the [Security] option, cancel [Enable Secure Boot]; in the [Processor] option, add half of the computer's CPU to the virtual machine. Processor, because creating a node requires more computing power, the more the better, after the node is built, come back and reduce the core.
Start the virtual machine, and it is recommended to use English for installation (you will not use it mainly on Ubuntu anyway, and installing Chinese will delay downloading and updating by default), go all the way [Continue], cancel [Download updates while installing Ubuntu] in Updates and other software ] to cancel downloading the update.
In Who You Are, the username you enter is the username of the Ubuntu system, and the password should also be kept in mind, and then wait for the system to complete and restart to enter the Grin node configuration.
Build a Grin node

For Xiaobai who doesn't understand the Linux system at all, this step is the most painful. GrinUp will try to make this process more interesting and less painful.
After entering Ubuntu, click the [Menu] button in the lower left corner, enter terminal with the keyboard, and press Enter to enter the terminal (the middle end of the command line), and then our operations will be carried out in this window.
curlhttps://sh.rustup.rs-sSf|sh;source $HOME/.cargo/env

We'll first install RUST, since Grin is written using RUST. Typing the following command into the terminal will not execute because of the lack of curl:
At this time, you need to enter sudo apt install curl in the terminal, the system will confirm the password with you, and then confirm whether to install it, enter [y] or [yes], and the installation of curl will be completed in ten seconds.

Press the [↑] arrow key in the terminal to return to the command that was not executed just now, and press Enter again to install RUST.
The command line will pop up options, enter [1] to confirm the installation, and wait for the installation to complete (depending on the network situation, usually about half a minute).

If the download shown in the figure below is successful, congratulations, the rust language has been downloaded and installed.
sudo apt install build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config libssl-dev llvm

The next step is even cooler. You need to type the following code into the terminal. This step will complete the installation of multiple dependent packages, and it will be done automatically. You need to confirm whether to install during the process:
The installation of this string of dependent packages takes about 2 minutes, and the whole process is automatically executed.
https://github.com/mimblewimble/grin/blob/master/doc/build.md
* It is too troublesome to type codes because virtual machines cannot copy content? Then it is better to open this page in the Firefox browser of Ubuntu, there are live codes that can be copied directly.
git clone https://github.com/mimblewimble/grin.git
Once done, enter the following code into the grin folder:
cd grin
Next step:
cargo build --release

Next step:
The process of building this build takes a long time, and it takes 5 minutes at the fastest. During this period, multiple files need to be downloaded, and it may be stopped or interrupted due to network errors. Don't panic, and repeat the last line of code until the final installation is complete.

When you see this interface, you already have a Grin node client on your computer.
We recommend that you learn to use Linux, but adding environment variables is also a big challenge for novices, so here we directly use the "file path" to execute without using environment variables, and we will talk about it after you learn it. If you can add environment variables then ./grin/target/release/grin is equivalent to typing grin directly. In addition, because it is a test network, the command must be accompanied by --floonet.
./grin/target/release/grin --floonet

Enter in the terminal (note the first . ) to start the grin client:
You will see such a screen, which is the grin client. But before actually running the node, we need to make some adjustments to the configuration to mine, so press [Q] to exit.
sudo vim ~/.grin/floo/grin-server.toml

Now let's adjust the configuration file of grin-server, and enter the vim editor in the terminal
Use the direction [↓] key to find this position, find [insert] on the keyboard, enter the edit mode, move the cursor to the two marks, and modify them to the content shown in the picture (respectively start the mining server and modify the mining mine server access address). After the modification is completed, click [ESC] to exit the editing mode. At this time, directly press [:wq] on the keyboard to execute the save and exit command.
./grin/target/release/grin --floonet wallet init

After that, we need to obtain a Grin wallet. Enter the following command in the terminal to obtain an address. During the process, we need to enter the password and confirm the password. Be sure to remember and write down the generated mnemonic:
(Don’t try it, the above wallet is no longer used, it’s just for tutorial demonstration)
./grin/target/release/grin --floonet wallet info

How to check the assets in the wallet, enter in the terminal to get the account information, all are 0 alas:
./grin/target/release/grin --floonet

Start the node, synchronize the block information, and enter in the terminal:
./grin/target/release/grin --floonet wallet listen

After the interface runs for a period of time, it will change to the running state. During this period, the information must be downloaded from the blockchain and synchronized. When the state is running, the node server is ready. Next, the wallet monitor will be turned on, and a new Terminal input (password confirmation required):
ip address

Then open a new terminal and enter the command to get the ip address of the node server (red box):
During the mining process, neither the node window nor the wallet monitoring window can be closed. The former is responsible for connecting to the blockchain, and the latter is responsible for receiving mined grins into the account. If you need to perform other operations, you need to open a new terminal for operations.
*If you want to use the same node on other mining computers, you need to learn the skill of [port forwarding].
Mining with Graphics Cards
Finally, we don't have to operate in Ubuntu, and we are back to the familiar Windows interface.
https://github.com/mozkomor/GrinGoldMiner/releases

Copy the address below to the browser, download the desktop mining compression package (GGM_Testnet4_Win64_cuda.zip),
It should be noted that VS 2017 C++ runtime and .NET CORE 2 runtime are required to run the grin mining client. After clicking the first link shown in the figure, you need to select the installation package of Run Apps, and the second link is directly downloaded. Then make sure your computer has installed the latest version of the Nvidia graphics driver.

Everything is ready and ready to go!

After decompressing the mining client, open the GGM_MultiGPU software.


Fill in the ip address you just obtained in the Stratum Server, and you don’t need to fill in the others (you will fill in the user name and password information after you have a mining pool), select GPU, and click [Start ALL] to start the mining machine!
If everything goes well, you will see the above screen, the graphics card has started intensive graphics calculation and decryption work.
After running for a period of time, your graphics card will start to heat up. Of course, the power consumption brings rewards of Grin tokens. When your graphics card successfully digs out a block in the blockchain, the Grin system will reward 60 A Grin token, so how to check it? Remember the code above to view account information?
./grin/target/release/grin --floonet wallet info

Open your virtual machine, open a new Terminal, and enter to check the Grin balance in the account:
Total represents the amount of Grin in your current wallet, Immature Coinbase represents the number of tokens that have not been fully confirmed by the blockchain, Awaiting Confirmation represents the number waiting for confirmation, and Locked by previous transaction represents the number that has been sent or received but has not been confirmed by the blockchain Confirmed quantity.
Next, we will also give a transfer tutorial, so stay tuned.







