Difference between revisions of "Linux Full Node"

From Mochimo Wiki
Jump to: navigation, search
(Compile and Install the Mochimo Software)
Line 83: Line 83:
 
<br/>
 
<br/>
  
==Section II: Run the Mochimo Node/Miner==
+
==Section III: Run the Mochimo Node/Miner==
[[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.]]
 
 
This section will guide you through running your newly compiled Mochimo software.
 
This section will guide you through running your newly compiled Mochimo software.
 
<br>
 
<br>
  
===Create a Mining Address===
+
===Create a new wallet===
Before you can run the miner, you must create a mining address to mine to.<br/>
+
Start from the <code>mochimo/bin/</code> directory and invoke the wallet with the following command:</br>
The recommended option is to use the GUI Wallet [[Mojo_Wallet|Mojo]].<br/>
+
<pre>./wallet -p2095 -n</pre>
However, you can use the CLI Wallet to create an address like so:
+
(Note: port 2095 is required to be open on your network for mining to function, but not required for the wallet to run. You still need though, to enter the command exactly as above.)
#Go to ./bin directory and invoke the wallet: <code>./wallet -n</code>
+
 
#Give it a name like "mining".
+
# You will be prompted to choose a name for your wallet. We’ll call it My Wallet in our example.
#Choose a password (DON’T FORGET THIS)
+
# You will be prompted for a password.  Your wallet will be encrypted 100% of the time. This password will be used to decrypt the wallet - '''''don't lose it.'''''
#Enter Random Text (mash the keyboard, seriously, this should be as random as possible)
+
# You will be asked to enter some random text to help randomize your wallet seed.  You do not need to memorize this information.
#Save the file to "mining.wal"
+
## If this is a NEW installation of Linux, say on a cloud server, you may get stuck here. This means that your box doesn't have enough ''entropy'' to create the randomness needed for this step. Here is the proposed solution to that problem:
#Open the wallet: <code>./wallet mining.wal</code>
+
### You will have to open a new terminal window and do the following
#Select option 4 to create a new address. Name it ‘mining address’
+
### <code>sudo apt-get install rng-tools</code>
#Type N for the "Add Tag?" question.
+
### <code>sudo rngd -r /dev/urandom</code>
#Select Option 7 to export this address.
+
### This should solve your problem, if not check in the ''Discord'' group to see if there might be a newer solution.
#Type 1 and hit enter to select your mining address for export.
+
# You will be asked to pick a filename. We recommend <code>mochimo.wal</code>.
#Save this file as maddr.dat (required)
+
# The wallet file is saved to the disk and the wallet software exits.
#Type N for saving balance
+
# Confirm <code>mochimo.wal</code> was successfully created with a <code>ls</code> command to list the directory’s contents.
#Select 0 to exit
+
 
<br>
+
[[File:04-createWallet.gif|600px]]
 +
 
 +
===Download a list of network nodes and start the wallet===
 +
 
 +
Let's download a <code>startnodes.lst</code> file, so the wallet has multiple nodes to grab network information from. It will also help to avoid getting a <code>***Balance check failed***</code> error. The easiest way to do that in Linux is:
 +
<pre>
 +
wget https://www.mochimap.net/startnodes.lst</pre>
 +
 
 +
If you named your wallet ''mochimo.wal'', then open the wallet with the following command:
 +
<pre>
 +
./wallet -p2095 mochimo.wal</pre>
 +
 
 +
You will be prompted to enter your password.  If you enter this incorrectly, the system '''''will not tell you''''', but the name at the top of the wallet when you open it be some garbled gibberish.  The reason for this is the password is a decryption key and is not stored in the wallet itself.  If you enter it wrong, the wallet will still decrypt using the wrong key, and the result will be garbage.  You know you entered it correctly if the
 +
wallet name you chose displays at the top of the screen. In our case, we’ll see '''My Wallet''' at the top.
 +
 
 +
[[File:05-startnodes-StartWallet.gif|600px]]
 +
 
 +
===Generate a mining address===
 +
 
 +
With the wallet open:
 +
 
 +
# First, create a new address with option <code>4</code>.
 +
# You must give it a name here, let's use '''mining address'''.
 +
# You will be asked if you want to "tag" this address, say <code>N</code>.<br>
 +
'''''WARNING: YOU MUST *NOT* ADD A TAG TO A MINING ADDRESS.'''''
 +
# This address will be assigned an index sequentially higher than your last address. If you don't have any addresses yet, this would be index <code>1</code>.
 +
 
 +
[[File:M01-minerAddress.gif|600px]]
 +
 
 +
# Let’s check to make sure the address was successfully created. Select option <code>2</code>, to display your address entries. If you don’t have any coins yet, “My addresses:” will read “No entries.
 +
# Select option <code>6</code> to check the balance on this new address. If you don't have any coins yet, the wallet will read '''No entries.'''
 +
# To check that the address was created, select option <code>9</code> to go to Menu 2. Then select option <code>2</code> to <code>display change addresses</code> and you should now see '''mining address'''.
 +
 
 +
===Exporting your mining address===
 +
Now let's save this address to a '''maddr.dat''' file the miner uses, so that we can start mining and have our block rewards go to this address.
 +
# Select option <code>7</code>, to export.  You will be prompted to select the index number of the address you want to export.  In this case it will be index <code>1</code>, since it's the only address you have. Type <code>1</code> and hit enter.
 +
# You will be prompted to select a file name. '''The file has to be named: <code>maddr.dat</code>'''
 +
# You will be asked where to save the Balance.  Please select <code>N</code>.
 +
# If you are replacing a mining address, you will be told that maddr.dat file already exists. If you are asked, enter <code>Y</code> to overwrite the old mining address with your new mining address.
 +
# Now type <code>0</code> to exit, and go invoke your miner. 
 +
 
 +
You are ready to mine!
 +
 
 +
[[File:M02_createmaddrdat.gif|600px]]
 +
 
  
 
===Running the Miner===
 
===Running the Miner===
Line 118: Line 161:
  
 
===How do I know my node is working?===
 
===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/>
 
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 your node is updating blocks and receiving transactions from the network, <code>TX recvd</code>, then your node is working.
Line 126: Line 171:
  
 
==Troubleshooting & FAQ==
 
==Troubleshooting & FAQ==
For frequently encountered issues and troubleshooting, see our [[Troubleshooting_FAQ]].
+
For frequently encountered issues and troubleshooting, see our [[Mining_FAQ|Mining FAQ Page]].
 +
</br></br>

Revision as of 22:03, 21 March 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

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
  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 new wallet

Start from the mochimo/bin/ directory and invoke the wallet with the following command:

./wallet -p2095 -n

(Note: port 2095 is required to be open on your network for mining to function, but not required for the wallet to run. You still need though, to enter the command exactly as above.)

  1. You will be prompted to choose a name for your wallet. We’ll call it My Wallet in our example.
  2. You will be prompted for a password. Your wallet will be encrypted 100% of the time. This password will be used to decrypt the wallet - don't lose it.
  3. You will be asked to enter some random text to help randomize your wallet seed. You do not need to memorize this information.
    1. If this is a NEW installation of Linux, say on a cloud server, you may get stuck here. This means that your box doesn't have enough entropy to create the randomness needed for this step. Here is the proposed solution to that problem:
      1. You will have to open a new terminal window and do the following
      2. sudo apt-get install rng-tools
      3. sudo rngd -r /dev/urandom
      4. This should solve your problem, if not check in the Discord group to see if there might be a newer solution.
  4. You will be asked to pick a filename. We recommend mochimo.wal.
  5. The wallet file is saved to the disk and the wallet software exits.
  6. Confirm mochimo.wal was successfully created with a ls command to list the directory’s contents.

04-createWallet.gif

Download a list of network nodes and start the wallet

Let's download a startnodes.lst file, so the wallet has multiple nodes to grab network information from. It will also help to avoid getting a ***Balance check failed*** error. The easiest way to do that in Linux is:

wget https://www.mochimap.net/startnodes.lst

If you named your wallet mochimo.wal, then open the wallet with the following command:

./wallet -p2095 mochimo.wal

You will be prompted to enter your password. If you enter this incorrectly, the system will not tell you, but the name at the top of the wallet when you open it be some garbled gibberish. The reason for this is the password is a decryption key and is not stored in the wallet itself. If you enter it wrong, the wallet will still decrypt using the wrong key, and the result will be garbage. You know you entered it correctly if the wallet name you chose displays at the top of the screen. In our case, we’ll see My Wallet at the top.

05-startnodes-StartWallet.gif

Generate a mining address

With the wallet open:

  1. First, create a new address with option 4.
  2. You must give it a name here, let's use mining address.
  3. You will be asked if you want to "tag" this address, say N.

WARNING: YOU MUST *NOT* ADD A TAG TO A MINING ADDRESS.

  1. This address will be assigned an index sequentially higher than your last address. If you don't have any addresses yet, this would be index 1.

M01-minerAddress.gif

  1. Let’s check to make sure the address was successfully created. Select option 2, to display your address entries. If you don’t have any coins yet, “My addresses:” will read “No entries.”
  2. Select option 6 to check the balance on this new address. If you don't have any coins yet, the wallet will read No entries.
  3. To check that the address was created, select option 9 to go to Menu 2. Then select option 2 to display change addresses and you should now see mining address.

Exporting your mining address

Now let's save this address to a maddr.dat file the miner uses, so that we can start mining and have our block rewards go to this address.

  1. Select option 7, to export. You will be prompted to select the index number of the address you want to export. In this case it will be index 1, since it's the only address you have. Type 1 and hit enter.
  2. You will be prompted to select a file name. The file has to be named: maddr.dat
  3. You will be asked where to save the Balance. Please select N.
  4. If you are replacing a mining address, you will be told that maddr.dat file already exists. If you are asked, enter Y to overwrite the old mining address with your new mining address.
  5. Now type 0 to exit, and go invoke your miner.

You are ready to mine!

M02 createmaddrdat.gif


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.

Troubleshooting & FAQ

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