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

Linux

From VeriCoin & Verium Wiki
Jump to: navigation, search

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

A separate page on basic (and some advanced) Linux System Administration exists.

VeriCoin Wallet

Installation

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

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

It will do what is described in the following step-wise guide. 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.


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

  ./vericoind 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!

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

 cp ~/.vericoin/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 a file named wallet.dat . More detailed 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/

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

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

Security & Backup

Encrypt your wallet by

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

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

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

 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 a file named wallet.dat . More detailed 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/

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

Proxies and Pools

Proxies are a very useful thing for external-to-your-network pool mining farms (swarm of SBCs, for example). Private pools are useful for solo mining farms. Pool software could also be public, I suppose, but what fun is that? Read on.

SOCKS and HTTP

Why SOCKS or HTTP proxy? Suppose your ISP throttles stratum or restricts the UDP port(s) your miners rely on. Have you ever tried to pass stratum through a VPN to get around those restrictions? Your mining software has built-in support for SOCKS4 and HTTP proxies. (Maybe. Unknown if VRM-Vault wallet supports this. Presumably, it does because there's a proxy setting available in Settings->Options->Network. @Devs? Confirm, please.)

Source: effectsToCause/veriumMiner GitHub README

 Connecting through a proxy
 
 Use the --proxy option.
 
 To use a SOCKS proxy, add a socks4:// or socks5:// prefix to the proxy host
 Protocols socks4a and socks5h, allowing remote name resolving, are also available since libcurl 7.18.0.
 
 If no protocol is specified, the proxy is assumed to be a HTTP proxy.
 When the --proxy option is not used, the program honors the http_proxy and all_proxy environment variables.

stratum-proxies

Stratum is a protocol developed for bitcoin mining. As miners got faster, it was discovered pools and even solo nodes were unable to keep up with the work-request demands, leaving hashing hardware idle for significant time periods. It also was found to reduce the amount of network traffic, overall. See Bitcoin wiki stratum protocol entry if you're interested in the history and technical details. All we really need to know is it reduces the strain on our local solo nodes or reduces latency and bandwidth requirements when we mine on a pool.

  • world's first stratum proxy by @slush0 - still maintained! May be limited to the SHA256 mining algorithm and/or BTC-core RPC specific. My research hasn't gotten this far.
  • bfgminer has one built-in - support for Scrypt. Unknown if it supports n-Scrypt. Also a miner of it's own if you want to drive some ASICs or FPGAs in SHA256 or Scrypt algos.
  • proxy in java - unknown which algos are supported or if it's algo agnostic.
  • CryptoManiac's proxy in python. Supports Scrypt. Unknown if it supports n-Scrypt.
  • p4u/stratum-relay This author knows nothing about this software. It appears to be a stratum<->stratum proxy. Not very active development.

Pools

Why run a public pool? So you can be kept awake at night with rude demands of people you don't know and who don't give two s**ts about how much sleep you've had this week, or whether there's enough coin in the pool's hot-wallet for them to make a withdrawal. Oh, and $profit! from fees. :-)

Why a private pool? For easier, single-point of access, monitoring of your swarm of solo miners; duh! Also, most pool software implements stratum which is much friendlier to your node than the inbuilt getwork.

  • Con Kolivas' ckpool It is unknown if this will work with your VRM node. Con Kolivas is a staunch and stalwart supporter of BTC only, so there's a strong chance it does not. However, the author hasn't verified that.
  • Node Open Mining Portal Very popular software with pool managers of a wide variety of algos.
  • YAAMP may no longer be maintained. Last commit at GitHub in 2015...
  • yiimp by Tanguy Pruvot (of cpuminer-multi fame). Fork of YAAMP.

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.

hugepages

transparent_hugepages


To enable transparent_hugepages type in terminal : echo always | sudo tee /sys/kernel/mm/transparent_hugepage/enabled

To disable transparent_hugepages type in terminal : echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled preallocated


IMPORTANT -> To use preallocated in cpuminer you need to disable transparent_hugepages

To enable:

  1. sudo nano /etc/sysctl.conf
  2. scroll to the bottom
  3. type in vm.nr_hugepages=size
  4. Ctrl+O, then [Enter], then Ctrl+X.
  5. sudo sysctl -p

To disable:

  1. sudo nano /etc/sysctl.conf,
  2. scroll to the bottom,
  3. remove the line vm.nr_hugepages=size
  4. Ctrl+O, then [Enter], then Ctrl+X.
  5. sudo sysctl -p

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.

With screen:

I edit the /etc/rc.local file and put this in it:

 screen -dmS cgm sudo /veriumMiner/cpuminer -o stratum+tcp://stratum.beertendr.com:3334 -O user:pass

test it by typing

 /etc/rc.local  

then type

 screen -r 

and the miner should be running.

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