Donate VRC/VRM for the Wiki to VBzaNDExHyFpnNvYc5QH5e4ipBZqxxPnKJ . Thank you, Joe.

Difference between revisions of "Linux"

From VeriCoin & Verium Wiki
Jump to: navigation, search
(+HUGE list of OS-level sub-topics; some for newbs; some for nerds)
m (Hardware Control and Tuning: change section title)
Line 357: Line 357:
 
* disk & system images
 
* disk & system images
  
=== Hardware ===
+
=== Hardware Control and Tuning ===
 
* BIOS tweaks, upgrades
 
* BIOS tweaks, upgrades
 
* fan speed control
 
* fan speed control

Revision as of 14:28, 24 January 2018

This page should provide guideline how to use VeriCoin and Verium on Linux or FreeBSD Systems.

VeriCoin Wallet

Installation


In a Terminal start with an update of your system

 sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -f -y

Install the wallets dependencies:

 sudo apt-get install build-essential libboost-dev libboost-system-dev libboost-filesystem-dev \
      libcurl4-openssl-dev libboost-thread-dev libssl-dev libdb++-dev libboost-program-options-dev \
      libminiupnpc-dev libboost-all-dev libqrencode-dev freeglut3-dev git libminizip-dev -y

Clone the wallet software itself

 git clone https://github.com/vericoin/vericoin.git

Compile the wallet within its source directory

 cd vericoin/src
 make -f makefile.unix

Configuration

Get latest config file with sync nodes

 wget http://www.vericoin.info/downloads/vericoin.conf

Configure daemon

 nano vericoin.conf

scroll to its very end, the lines to configure are

server=1
listen=1
daemon=1
rpcuser=vericoinrpc
rpcpassword=

below the nodes list.

Usage

After the wallets installation we need to go to its directory

 cd vericoin/src

and start the wallet

 ./vericoind 

Get info about its status by:

 ./vericoind getinfo 

One important thing is your wallets address gotten by

  ./veriumd getaddressesbyaccount ""

Learn how to use the VeriCoin Daemon

 ./vericoind help

will print a wall of text with commands and

 ./vericoind help [command]

explains each further. Stopping the wallet

 ./vericoind stop

Some further wallet commands that are interesting.

Security & Backup

Encrypt your wallet by

 $ ./vericoind encryptwallet "YOUR passphrase here :)"
  ^ space

Put a space in front so it doesn't remember it in bash history!

The wallet stores private key information in a file named wallet.dat. It contains:

  • keypairs for each of your addresses
  • transactions done from/to your addresses
  • user preferences
  • default key
  • reserve keys
  • accounts

The wallet.dat file is located in

 ~/.vericoin/

Backup your wallet.dat in a secure place (USB drive, CD, ...).

Linux users of the vericoind make sure to use encryptwallet to excrypt your wallet with a passphrase.

Finally backup by

 cp ~/.verium/wallet.dat somewhere/save/wallet.dat

To restore your wallet just do a fresh installation and replace the new wallet.dat with your saved one.

The most important thing you need to keep backed up is your private keys for your address(s) which are stored in the wallet.dat . Store & Secure both VeriCoin & Verium in One Paper Wallet [Paper Wallet Link]

Troubleshooting

Currently the VeriCoin wallet uses a lot of memory. This is going to be fixed soon, the workaround is to limit the number of connections in

 nano vericoin.conf

by adding

 maxconnections=10

Verium Vault

Installation

Daemon build

Updated for Version 1.1

The whole thing as a script: [Download Shell script] or use

 wget https://raw.githubusercontent.com/DJoeDt/verium/master/install_Verium_Wallet.sh
 chmod +x install_Verium_Wallet.sh
 ./install_Verium_Wallet.sh

It will do what is described in the step-wise Manual Verium Wallet Installation .

In case you see ERRORS like -No such file... - it actually helps to run the script again since probably the installation of some dependencies failed.

Configuration

It is configured in

 nano verium.conf

scroll to its very end, the lines to configure are

rpcuser=YourSoloMiningName
rpcpassword=YourSoloMiningPassword
rpcallowip=YourAccessIP
rpcallowip=localhost

You have to configure the IPs of the machines that should be able to connect. If you mine solo you have to come up with a username and a password for your miners to access the wallet.

Usage

The wallet should run now, but we need to go to its directory

 cd verium/wallet/src

Now start the wallet again

 ./veriumd 

and get info about its status by:

 ./veriumd getinfo 

The most important thing right now is your wallets address gotten by

  ./veriumd getaddressesbyaccount ""

Now stop the wallet

 ./veriumd stop

Learn how to use the Verium Daemon

 ./veriumd help

will print a wall of text with commands and

 ./veriumd help [command]

explains each further.

further wallet commands

Backup

Finally backup by

 cp ~/.verium/wallet.dat somewhere/save/wallet.dat

To restore your wallet just do a fresh installation and replace the new wallet.dat with your saved one.

The most important thing you need to keep backed up is your private keys for your address(s) which are stored in the wallet.dat . Store & Secure both VeriCoin & Verium in One Paper Wallet [Paper Wallet Link]

Backup

The wallet stores private key information in a file named wallet.dat. It contains:

  • keypairs for each of your addresses
  • transactions done from/to your addresses
  • user preferences
  • default key
  • reserve keys
  • accounts

The wallet.dat file is located in

 ~.verium/

Backup your wallet.dat in a secure place (USB drive, CD, ...).

Troubleshooting

How to include the blockchain manually in veriumd:

Download and save in verium subfolder

 wget -O ~/verium/bootstrap_VRM.zip http://www.vericoin.info/downloads/bootstrap_VRM.zip

Unzip it

 cd ~/verium
 unzip bootstrap_VRM.zip

Delete previous files

 rm -rf ~/.verium/txleveldb
 rm -rf ~/.verium/blk0001.dat

Move unzipped files to .verium folder

 mv ~/verium/bootstrap/blk0001.dat ~/.verium/blk0001.dat
 mv ~/verium/bootstrap/txleveldb ~/.verium/txleveldb

Verium Mining

Special Hardware Guides

Mining Software

!linuxguide Thanks to technikpto for this helpful guide! https://vericoinandverium.slack.com/files/U6JB348M6/F7ML8F7JS/install-verium-cpu-miner-linux.pdf.pdf

Install scripts by dominer: I've released a script for installing @fireworm's miner. Until now only for Linux_x64 but ARMv7/v8 will follow later today. Supports GCC 7.2 (fully automatic), compiling or precompiled packages (fully automatic) and magic stuff on hugepages (autocalculated).

git repo

Optimization

Odroid

ODROID Verium Mining Image: Download

  1. Burn it without extracting it (because it's 2 partitions)
  2. On first bootup give it 5-10 mins time until you should be able to find the device in the network.
  3. Log in with standard root/odroid
  4. Then
 nano /etc/rc.local 

For further information visit out special Odroid section.

GCC

It was noticed, that using latest GCC version to compile the miner causes hashrate to increase. Default version in Ubuntu 16.04 is GCC 5.4.0. Basic Ubuntu GCC update instructions:

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:jonathonf/gcc-7.2
sudo apt-get update
sudo apt-get install gcc-7 g++-7

check the version:

gcc --version

update alternatives if needed:

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60

Autostart

rc.local

Autostart configuration:

 sudo nano /etc/rc.local
 # Verium Miner Configuration
/root/verium/nwayminer/cpuminer \
-o stratum+tcp://vrm.n3rd3d.com:3332 -u joe_rondx.1 -p joe \
--no-color >> /root/verium/nwayminer/miner.log &

You must enter the full path to the miner.

crontab

you can follow these steps to make the miner auto start after a reboot: (make a run command that will startup the miner)

 nano run.sh

(add the following line, changing the values to correspond to your pool, account name, miner name, and password)

 ./cpuminer -o pool -u username.miner -p x

ctrl-o to save, ctrl-x to exit (make the run command executable)

 chmod +x run.sh

(create a startup command that is used to automatically start the miner when you reboot your system)

 nano ~/startup.sh

(add the following 2 lines, changing username to your Linux account name)

 cd /home/username/veriumMiner
 ./run.sh > run.out &

(make the startup command executable)

 chmod +x ~/startup.sh

(Tell cron to run startup at reboot)

 crontab -e

(add this as the last line in crontab, changing username to your Linux account name)

 @reboot /home/username/startup.sh 2>&1


systemd

@hillbillyhacker: ok, so i'd recommend just creating a systemd unit file for the wallet then. and then you can use journalctl to see the log output one sec, let me get an example for ya

[Unit]
Description=Veriumd Wallet
Before=nomp.service

[Service]
User=user
ExecStart=/usr/local/bin/veriumd -printtoconsole
ExecStop=/usr/local/bin/veriumd stop
Restart=always

[Install]
WantedBy=multi-user.target

replace user with the user you want to run the wallet as. and update paths to wallet binary of course

place that somewhere like: /etc/systemd/system/veriumd.service

run: sudo systemctl daemon-reload then sudo systemctl <start|stop|status> veriumd.service

to see logs: sudo journalctl --unit veriumd.service

make sure to also enable the service so it starts on boot: sudo systemctl enable veriumd.service


Operating System

  • Intro to working the shell whether bash, zsh, fish, etc.
  • Lightweight GUI options
  • barebones-basic shell scripting (links to external edu resources. way beyond purpose of this wiki)

Tuning and Pruning

Getting the leanest, meanest OS you can still make use of.

Basic Networking

  • nmTUI
  • avahi
  • /etc/hosts & /etc/hostname
  • etc. (advanced networking in Clustering)

Security & Hardening

  • PAM
  • firewalls (ufw and iptables are most common?)
  • intrusion detection and resistance (fail2ban ?)
  • SSH basics (save advance usage for Clustering section)
  • user/group permissions
  • jail and container intro (more detail in own section)
  • etc.

Remote Administration

webmin and other resources

Clustering

  • webmin Cluster modules
  • ansible, chef, etc.
  • SSH, pSSH, SSHfs, gpg-key passwordless logins
  • NFS
  • PXE-booting (not supported most SBCs, but definitely supported most servers)
  • More advanced networking: DNS, DHCP, NTP, NAT (?)
  • see Containers and Virtual Machines

Containers and Virtual Machines

  • Pros, Cons of containers vs. VMs vs. bare metal
  • Available container technologies, pros/cons of each
    • lxc (personal favorite)
    • Docker
    • BSD jails
    • snapd containerized user-space applications
    • Management and provisioning tools (virt-engine, swarm, kubernetes, etc)
  • Available VMs, pros/cons of each
    • KVM
    • VMware/Vagrant
    • VirtualBox
    • Management and provisioning tools (virt-engine, swarm, kubernetes, etc)

Backup, Fail-Over, & Disaster Recovery

  • backups
  • disk & system images

Hardware Control and Tuning

  • BIOS tweaks, upgrades
  • fan speed control
  • CPU throttling, overclocking and heat!
  • RAM throttling, overclocking and heat!
  • swap and swappiness
  • RAM-disks
  • HDD tuning - platters and SSDs
  • proprietary drivers
  • DRM and another GPU-related intro article (link to external resource for more depth)
  • PSU sizing for maximum reliability and longevity
  • battery backup and graceful shutdown (also sizing the battery)