Difference between revisions of "Linux Full Node"

From Mochimo Wiki
Jump to: navigation, search
(Porting the original setup instructions from our Google Doc, pinned in New-Member-Setup)
 
(Compile and Install the Mochimo Software)
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This guide was built by and for the Mochimo Discord Community. It will cover the basics for installing and running the Mochimo GPU Miner/Node on Ubuntu 16.04 with Nvidia Graphics Cards.
+
This guide was originally built by, and for, the Mochimo Discord Community. It has since been updated for compatibility with code version 2.2 and will cover the basics for installing and running the Mochimo GPU Miner/Node on Ubuntu 16.04 with Nvidia Graphics Cards.
  
 
__TOC__
 
__TOC__
  
  
==Section I: GPU Mining Setup==
+
==Section I: GPU Mining Rig Setup==
Prepared by Mochimo Discord Community
+
[[File:Rufus Program.png|thumb|right|Use Rufus to create a bootable USB stick for installing a fresh Ubuntu 16.04 OS]]
===OVERVIEW===
+
This section will guide you through preparing your system installation and settings to allow you to mine on the Mochimo network with an Nvidia GPU.  
This section will guide you through installing Ubuntu, updating your drivers, and getting any other settings changed to allow you to mine on a GPU.  
 
 
<br>
 
<br>
  
 
===ISO Setup===
 
===ISO Setup===
These tools are used to create a bootable drive to install Ubuntu. Skip if you already are running an OS. The miner will not work on any version of Windows currently.
+
With the exception of the CLI wallet, the Full Node software is not compatible with any version of Windows.<br/>
 +
These tools are used to create a bootable drive to install Ubuntu. Skip if you already are running an OS.
 
#Download: [https://rufus.akeo.ie/ Rufus] Install.
 
#Download: [https://rufus.akeo.ie/ Rufus] Install.
 
#Download: [http://releases.ubuntu.com/16.04/ubuntu-16.04.5-desktop-amd64.iso Ubuntu 16.04 ISO]
 
#Download: [http://releases.ubuntu.com/16.04/ubuntu-16.04.5-desktop-amd64.iso Ubuntu 16.04 ISO]
Line 19: Line 19:
  
 
===Static IP===
 
===Static IP===
If you do not have a static IP you need to set one to save yourself from future issues.
+
Depending on your router you may not need to set a Static IP address, however it is encouraged to do so to save yourself the pain of future issues.<br/>
#Open a Terminal
+
Firstly, open a Terminal and type <code>ip route</code><br/>
#Type <code>ifconfig</code> to get your IP and Gateway.
+
[[File:Find Gateway and IP Address.png|600px|none|left|Use 'ip route' in a terminal to find the Gateway and IP address of the system.]]
#Select the up/down arrows in the top right corner.
+
Your output may differ, but generally your Gateway can be found next to "default via", and your IP address can be found next to "src".<br/>
#Select Disable Connection
+
Alternatively, you can type <code>ifconfig</code> in a terminal to find your IP address.<br/>
#Select Edit Connections
+
To set your IP address as static:
#Remove any old connections.
+
#Click the Network icon in the top right corner and select "Edit Connections".
#Make new connect with: IP of your choosing, a /24 mask (255.255.255.0), Your Gateway IP, and 8.8.8.8 for DNS
+
#Choose your network connection and click the "Edit" button.
#Selection Enable to grab a new IP via DHCP
+
#Navigate to the "IPv4 Settings" tab.
 +
#Change the "Method" to "Manual".
 +
#Next to the "Addresses" table, click the "Add" button and enter your IP Address, Netmask (usually 255.255.255.0) and Gateway.
 +
#Click save and close the Network Connections window.
 
<br>
 
<br>
  
===Nvidia Drivers===
+
===Port Forwarding===
This will download the latest Nvidia drivers. They can be manually downloaded if any errors occur or you want a newer/older version.
+
For a Mochimo node to operate correctly, you must have port 2095 (TCP protocol) forwarded to your Rig's local IP.
<br>To download Nvidia drivers search for “Additional Drivers” on Ubuntu and open it.
+
<br>If you need help, visit the following site, find your router, and follow its instructions:
<br>The appropriate drivers should be available for download.
+
<br>[https://www.portforwarding.com portforwarding.com]
Manually complete the following commands, then reboot:
 
:<code>sudo add-apt-repository ppa:graphics-drivers/ppa</code>
 
:<code>sudo apt update</code>
 
:<code>sudo apt install nvidia-387</code>
 
 
<br>
 
<br>
  
===Install CUDA Toolkit 9.2===
+
===Install build-essential Package===
After install, if you still recieve error “ XXXXX “ then reinstall.
+
The <code>build-essential</code> package contains software that must be installed to compile a Mochimo node. On rare occasions, this may not already be installed.<br/>
<br>Download the Base Installer: [https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal Installer]
+
To Install:
 +
:<code>sudo apt-get install build-essential</code>
 +
<br/>
 +
 
 +
===Install CUDA 9.2 and Nvidia Drivers===
 +
 
 +
''You can skip this section if you dont intent to mine with your node''
 +
 
 +
During the installation of CUDA, a compatible Nvidia Driver will also be installed. If you wish to use a different Nvidia driver, you must install it AFTER the CUDA installation.
 +
<br>Download the Base Installer: [https://developer.nvidia.com/cuda-92-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal Cuda 9.2 for Ubuntu 16.04]
 
<br>To Install:<br>
 
<br>To Install:<br>
:<code>sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.deb</code>
+
<pre>   sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.deb
:<code>sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub</code>
+
    sudo apt-key add /var/cuda-repo-9-2*/7fa2af80.pub
:<code>sudo apt-get update</code>
+
    sudo apt-get update
:<code>sudo apt-get install cuda</code>
+
    sudo apt-get install cuda</pre>
 +
Depending on your internet connection, this installation can take some time.<br/>
 +
So, while you're waiting, take the time to:
 +
* Learn how to use the GUI Wallet [[Mojo_Wallet|Mojo]]
 +
* Come say hi on [https://discord.gg/7ma6Bk2 Discord]
 +
* or Chillax with a realtime visualisation of the Mochimo Network on [https://www.mochimap.net/ MochiMap.net]
 
<br>
 
<br>
  
===CUDA 9.2 Post-Install Instructions===
+
==Section II: Mochimo Software Installation==
If you do not save these to the bash then after each reboot you will have to reapply.
+
[[File:Mochimo GitHub Repository.png|thumb|right|Cloning Mochimo's public GitHub repository using the terminal is the most reliable way to obtain the software.]]
<br>Once installed, go to: [https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions Nvidia Post Installation Guide]
+
This section will guide you through downloading, compiling and installing the latest Mochimo software.
<br>Add this path to the PATH variable, by typing:
 
:<code>export PATH=/user/local/cuda-9.2/bin${PATH:+:${PATH}}</code>
 
Add path to PATH variable:
 
:<code>sudo nano ~/.bashrc</code>
 
All the way at the bottom add this line:
 
:<code>export LD_LIBRARY_PATH=/usr/local/cuda-9.2/lib64/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}</code>
 
 
<br>
 
<br>
  
===Port Forwarding===
+
===Download the Latest Mochimo Software===
The errors “xxxx” and “xxxx” are usually caused from a mistake made during these steps.
+
The Mochimo software is available on a public Github repository for everyone to see and contribute to: [https://github.com/mochimodev/mochimo/releases Mochimo Github]<br/>
<br>Make sure that port 2095 on both tcp/udp is forwarded to your rigs IP
+
To Download:
<br>If you need help, visit the following site, find your router, and follow its instructions:
+
:<code>git clone https://github.com/mochimodev/mochimo.git</code>
<br>[https://www.portforwarding.com portforwarding.com]
+
<br/>
<br>
 
  
 +
===Compile and Install the Mochimo Software===
 +
Before you can run the miner/node, you must compile the software into binary executable files.<br/>
 +
There are 3 simple steps:
 +
#Navigate to the src directory: <code>cd mochimo/src</code>
 +
#Compile the software: <code>./makeunx bin -DCUDA</code>. For a non-mining node, use <code>./makeunx bin -DCPU</code>
 +
#Install the software: <code>./makeunx install</code><br/>
 +
[[File:MochimoCompilation.png|500px|none|left|Mochimo Compilation No Errors]]
 +
*If you encounter errors during compilation, there may be a problem with your system setup and your Mochimo node may not operate correctly.<br/>
 +
There is almost always someone on the Mochimo [https://discord.gg/7ma6Bk2 Discord] to help you identify the issue if you are having trouble.
 +
<br/>
  
===Mochimo Miner/Node===
+
==Section III: Run the Mochimo Node/Miner==
Download the latest release from the Github: [https://github.com/mochimodev/mochimo/releases Mochimo Github]
+
This section will guide you through running your newly compiled Mochimo software.
#Click on: Source code (tar.gz)
 
#Place it in whatever directory you want.
 
#In a terminal type: <code>tar zxvf (drag the file here) && cd mochi</code>
 
#Make sure you are in the mochi directory. Now type: <code>cd ./src</code>
 
#Initiate the build script:
 
:<code>./makeunx bin</code>
 
If you get a cuda error here, installing Cuda 9.2 failed at some point possibly. Try re-installing.
 
<br>If you get the <code>collect 2</code> error try:
 
:<code>ln -s /usr/local/cuda/lib64/libcudart.so /usr/lib/libcudart.so</code>
 
If you get no errors, use the following command to install the software in the mochi/bin directory:
 
:<code>./makeunx install</code>
 
 
<br>
 
<br>
 +
===Create a wallet===
 +
You can follow the [[Mojo Quick Start Guide|quick start]] or [[Mojo Wallet|advanced]] guide to create a wallet.
  
===Create a Mining Address===
+
===Exporting your mining address===
You must create a mining address before you can begin mining.
+
Create an address [[Mojo_Wallet#Activate_an_address|without tag]] and export it as ''Legacy''.
#Go to ./bin directory and invoke the wallet: <code>./wallet -p2095 -n</code>
+
Rename the file to ''maddr.dat''
#Give it a name like "mining".
 
#Choose a password (DON’T FORGET THIS)
 
#Enter Random Text (mash the key, seriously)
 
#Save the file to "mining.wal"
 
#Open the wallet: <code>./wallet -p2905 mining.wal</code>
 
#Select option 4 to create a new address. Name it ‘mining address’
 
#Select N to the "Add Tag?" question.
 
#Select Option 7 to export this address.
 
#Type 1 and hit enter to select your mining address for export.
 
#Save this file as maddr.dat (required)
 
#Type N for saving balance
 
#Select 0 to exit
 
<br>
 
  
 
===Running the Miner===
 
===Running the Miner===
Go to the ./bin directory
+
Go to the <code>./bin directory</code>
<br>Type: <code>./gomochi d</code>
+
<br>Type: <code>./gomochi d</code><br/>
 
The miner is running now, but it may take up to a few minutes to sync.
 
The miner is running now, but it may take up to a few minutes to sync.
 
<br>Type: CTRL+C to bring up command prompt
 
<br>Type: CTRL+C to bring up command prompt
Line 109: Line 103:
 
:q for exit
 
:q for exit
 
:r for restart
 
:r for restart
 +
<br/>
 +
 +
===How do I know my node is working?===
 +
[[File:MochiMap.net.png|thumb|right|The MochiMap website shows a realtime visualisation of the Mochimo network and can be useful for monitoring your nodes.]]
 +
 +
There are a few obvious indications as to whether your node is working or not.<br/>
 +
* If your node is updating blocks and receiving transactions from the network, <code>TX recvd</code>, then your node is working.
 +
* If you are achieving 100% GPU Utilisation when you type <code>nvidia-smi</code> into a Terminal, then your node is mining.
 +
:Don't worry if it's not mining straight away, sometimes it can take until the next block to receive transactions to mine with.
 +
* If you can find your node on [https://www.mochimap.net/ MochiMap.net], it's also a good sign that it's operating correctly.
 +
:Additionally, if you click your node on MochiMap, it will give you the apparent health status of your node.
 +
 +
==Section IV: Updating the Mochimo Software==
 +
Assumptions:
 +
* Your Mochimo mining installation is found in your home directory at `~/mochimo/bin`
 +
* You are GPU mining
 +
# Stop your miner:
 +
## '''Ctrl-C''' <Enter> '''q''' <Enter>
 +
# Backup your old installation:
 +
## '''cd ~'''
 +
## '''mv mochimo/ mochimo-bak/'''
 +
# Download new source files:
 +
## '''git clone https://github.com/mochimodev/mochimo'''
 +
# Compile new source:
 +
## '''cd mochimo/src/'''
 +
## '''./makeunx bin -DCUDA'''
 +
## '''./makeunx install'''
 +
## '''cd ../bin'''
 +
# Move your old mining address over to the new installation:
 +
## '''cp ~/mochimo-bak/bin/maddr.dat ~/mochimo/bin/'''
 +
# Run the new miner:
 +
## '''./gomochi d'''
 +
 +
==Troubleshooting & FAQ==
 +
For frequently encountered issues and troubleshooting, see our [[Mining_FAQ|Mining FAQ Page]].
 +
</br></br>

Latest revision as of 04:00, 9 August 2019

This guide was originally built by, and for, the Mochimo Discord Community. It has since been updated for compatibility with code version 2.2 and will cover the basics for installing and running the Mochimo GPU Miner/Node on Ubuntu 16.04 with Nvidia Graphics Cards.


Section I: GPU Mining Rig Setup

Use Rufus to create a bootable USB stick for installing a fresh Ubuntu 16.04 OS

This section will guide you through preparing your system installation and settings to allow you to mine on the Mochimo network with an Nvidia GPU.

ISO Setup

With the exception of the CLI wallet, the Full Node software is not compatible with any version of Windows.
These tools are used to create a bootable drive to install Ubuntu. Skip if you already are running an OS.

  1. Download: Rufus Install.
  2. Download: Ubuntu 16.04 ISO
  3. Use Rufus to make a USB bootable with this ISO.
  4. When Installing: Do a full wipe and fresh install.


Static IP

Depending on your router you may not need to set a Static IP address, however it is encouraged to do so to save yourself the pain of future issues.
Firstly, open a Terminal and type ip route

Use 'ip route' in a terminal to find the Gateway and IP address of the system.

Your output may differ, but generally your Gateway can be found next to "default via", and your IP address can be found next to "src".
Alternatively, you can type ifconfig in a terminal to find your IP address.
To set your IP address as static:

  1. Click the Network icon in the top right corner and select "Edit Connections".
  2. Choose your network connection and click the "Edit" button.
  3. Navigate to the "IPv4 Settings" tab.
  4. Change the "Method" to "Manual".
  5. Next to the "Addresses" table, click the "Add" button and enter your IP Address, Netmask (usually 255.255.255.0) and Gateway.
  6. Click save and close the Network Connections window.


Port Forwarding

For a Mochimo node to operate correctly, you must have port 2095 (TCP protocol) forwarded to your Rig's local IP.
If you need help, visit the following site, find your router, and follow its instructions:
portforwarding.com

Install build-essential Package

The build-essential package contains software that must be installed to compile a Mochimo node. On rare occasions, this may not already be installed.
To Install:

sudo apt-get install build-essential


Install CUDA 9.2 and Nvidia Drivers

You can skip this section if you dont intent to mine with your node

During the installation of CUDA, a compatible Nvidia Driver will also be installed. If you wish to use a different Nvidia driver, you must install it AFTER the CUDA installation.
Download the Base Installer: Cuda 9.2 for Ubuntu 16.04
To Install:

    sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.deb
    sudo apt-key add /var/cuda-repo-9-2*/7fa2af80.pub
    sudo apt-get update
    sudo apt-get install cuda

Depending on your internet connection, this installation can take some time.
So, while you're waiting, take the time to:

  • Learn how to use the GUI Wallet Mojo
  • Come say hi on Discord
  • or Chillax with a realtime visualisation of the Mochimo Network on MochiMap.net


Section II: Mochimo Software Installation

Cloning Mochimo's public GitHub repository using the terminal is the most reliable way to obtain the software.

This section will guide you through downloading, compiling and installing the latest Mochimo software.

Download the Latest Mochimo Software

The Mochimo software is available on a public Github repository for everyone to see and contribute to: Mochimo Github
To Download:

git clone https://github.com/mochimodev/mochimo.git


Compile and Install the Mochimo Software

Before you can run the miner/node, you must compile the software into binary executable files.
There are 3 simple steps:

  1. Navigate to the src directory: cd mochimo/src
  2. Compile the software: ./makeunx bin -DCUDA. For a non-mining node, use ./makeunx bin -DCPU
  3. Install the software: ./makeunx install
Mochimo Compilation No Errors
  • If you encounter errors during compilation, there may be a problem with your system setup and your Mochimo node may not operate correctly.

There is almost always someone on the Mochimo Discord to help you identify the issue if you are having trouble.

Section III: Run the Mochimo Node/Miner

This section will guide you through running your newly compiled Mochimo software.

Create a wallet

You can follow the quick start or advanced guide to create a wallet.

Exporting your mining address

Create an address without tag and export it as Legacy. Rename the file to maddr.dat

Running the Miner

Go to the ./bin directory
Type: ./gomochi d
The miner is running now, but it may take up to a few minutes to sync.
Type: CTRL+C to bring up command prompt

? for options
q for exit
r for restart


How do I know my node is working?

The MochiMap website shows a realtime visualisation of the Mochimo network and can be useful for monitoring your nodes.

There are a few obvious indications as to whether your node is working or not.

  • If your node is updating blocks and receiving transactions from the network, TX recvd, then your node is working.
  • If you are achieving 100% GPU Utilisation when you type nvidia-smi into a Terminal, then your node is mining.
Don't worry if it's not mining straight away, sometimes it can take until the next block to receive transactions to mine with.
  • If you can find your node on MochiMap.net, it's also a good sign that it's operating correctly.
Additionally, if you click your node on MochiMap, it will give you the apparent health status of your node.

Section IV: Updating the Mochimo Software

Assumptions:

  • Your Mochimo mining installation is found in your home directory at `~/mochimo/bin`
  • You are GPU mining
  1. Stop your miner:
    1. Ctrl-C <Enter> q <Enter>
  2. Backup your old installation:
    1. cd ~
    2. mv mochimo/ mochimo-bak/
  3. Download new source files:
    1. git clone https://github.com/mochimodev/mochimo
  4. Compile new source:
    1. cd mochimo/src/
    2. ./makeunx bin -DCUDA
    3. ./makeunx install
    4. cd ../bin
  5. Move your old mining address over to the new installation:
    1. cp ~/mochimo-bak/bin/maddr.dat ~/mochimo/bin/
  6. Run the new miner:
    1. ./gomochi d

Troubleshooting & FAQ

For frequently encountered issues and troubleshooting, see our Mining FAQ Page.