Gridcoin Tutorial: Setting up a Gridcoin Wallet Staking 24hrs/day

in gridcoin •  8 years ago  (edited)

Gridcoin is a wallet running with the BOINC science network for securing it. It is a Proof of Stake wallet that earns interest as you run it, since you are awarded as your wallet finds new blocks. To be able to earn this interest you have to have your wallet running. The more coins your wallet contains that can stake the easier it is to find a new block but all this is not going to happen unless your wallet is running.

More information about Gridcoin if you are new

This tutorial will go through the steps on how to:

  • Renting a Linux Box
  • Installing BOINC
  • Setup Gridcoin Wallet
  • Secure Running and Automatic Update scripts

Important Note

As you can not stake on more than one wallet at the same time, you should only unlock any other wallet for sending transactions or voting and then lock it once the transaction is done.

Renting a Linux Box

If you have no way, or do not want to, have a Linux box running all day long there are several places that you can use to rent a Linux box for a low cost. I recommend Linode because they have been around for a long time, they have a good price and they are giving out good results on speed and memory for your rented box.

Linode has a low cost plan for $10/month, which is enough for running a Gridcoin wallet. This plan is powerful enough to run many other things that you would like to use it for. Once you’ve found a plan or box that you would like to use, we are ready to go to the step of setting up a Gridcoin wallet and BOINC (that will do no work) on it.

Choosing the Operating System

This documentation will ONLY be about setting up a Linux box with Ubuntu 16.04. This is a fairly new version of Linux and everything is working on it.

Setting up Linode

We will not walk trough this, but the Linode Manager is easy to navigate and they have a great forum for support.

Installing BOINC (INVESTORS: Skip this step)

As a coin holder or a pool miner you do not have to go trough the step of installing BOINC.

To install BOINC with a good console UI (boinctui) type the following.

sudo apt-get install boinc-client boinctui

BAM – The Account Manager

An account manager is preferred since it will be easier to control all BOINC clients. Since we don’t want our Linux box with the Gridcoin wallet to run any projects we will tell it to attach projects, but not do any work.
If you have not yet signed up to BAM, you should do this at https://boincstats.com

One setting that should be done is to go to “My Projects” and tell it to not attach any project by default. This will make sure our new machine does not get any project attach to it. We do not want to run anything on this machine, just monitor all the data for the Neural Network.

BAM-Projects.png

Next step is to make your BOINC client to attach to BAM. You do this with the following command.

boinccmd --join_acct_mgr bam.boincstats.com your-email your-passwd

Once you have made your BOINC client attach to BAM you should go to “Hosts List” on their page and find the new machine you attached. Click on it on the list. On the hosts details page click the icon “Edit Projects”. This list should look something like this.

BAM-HostList.png

You should attach all new projects to this host. This is what links your CPID with the Neural Network of Gridcoin. Your BOINC client is now attached and ready to collect the project stats.

Setup Gridcoin Wallet

There is a tutorial on the Gridcoin webpage, but we will go trough most of the steps here.

To install the Gridcoin wallet, first install the Dependencies with the following command

sudo apt-get install ntp git build-essential libssl-dev libdb-dev libdb++-dev libboost-all-dev libqrencode-dev libcurl4-openssl-dev curl libzip-dev libzip2

Build Gridcoin from source

We now wish to install and compile Gridcoin from source. To do this do the following.

cd ~ 
mkdir src
cd src
git clone https://github.com/gridcoin/Gridcoin-Research 
cd Gridcoin-Research/src
mkdir obj 
make -f makefile.unix USE_UPNP=- 
strip gridcoinresearchd 
sudo install -m 755 gridcoinresearchd /usr/bin/gridcoinresearchd 
mkdir ~/.GridcoinResearch 
cd ~
chmod 700 .GridcoinResearch 
cd .GridcoinResearch 

Configure your wallet

Type nano ~/.GridcoinResearch/gridcoinresearch.conf and paste the following

email=<your email, must match your BOINC projects>
server=1
daemon=1
rpcallowip=127.0.0.1
rpcuser=<username (anything you want, does not need to match BOINC)>
rpcpassword=<password (anything you want, does not need to match BOINC)>
addnode=node.gridcoin.us

Start the girdcoin wallet.

gridcoinresearchd

Automatic Staking on Startup

Once your wallet is up to date with the network, you should copy your wallet.dat file to the server. Put the wallet.dat file in the .GridcoinResearch folder. Make sure your wallet is encrypted, we do not want to run an unprotected wallet on a server we do not monitor! Do this within your wallet by going to Settings -> Encrypt your wallet

To check that the server is up to date you can type

gridcoinresearchd getinfo

Look at the entry saying “Blocks”. This should match the latest block on the network.
GRC-Info.png

We want the wallet to stake all the time, but we don’t want it to be unprotected so we only open it for staking. This is done by adding a hashed phrase of your password in the configuration file. To make this hash type

gridcoinresearchd execute encrypt YourPassPhrase

Modify the configuration file and restart the client

echo “autounlock=encrypted_pass_phrase” >> ~/.GridcoinResearch/gridcoinresearch.conf
killall -9 gridcoinresearchd && gridcoinresearchd

Secure Running and Automatic Update

Secure Running

Make a file called gridcoinKeeper.sh with the following code: (ie. nano gridcoinKeeper.sh)

#!/bin/bash
SERVICE='gridcoinresearchd'
DATE=`date -u`
OPER=`ps ax | grep -v grep | grep $SERVICE -c`
SLEEPTIME=300
if [ $OPER -lt 1 ]; then
    echo "[$DATE] $SERVICE is not running, restarting"
    exec $SERVICE
else
    echo "[$DATE] $SERVICE is running ($OPER). All is normal"
fi

Make a cronjob to run this script with crontab -e and add the following line at the bottom.

*/5 * * * * ~/gridcoinKeeper.sh >> ~/gridcoinKeeper.log

Automatic Update Script

To make an easy update of the Gridcoin wallet at any time make a script called “update-gridcoin.sh” with the following code in your ~/src folder.

#!/bin/sh
cd Gridcoin-Research
git pull
cd src
make -f makefile.unix USE_UPNP=-
strip gridcoinresearchd
sudo install -m 755 gridcoinresearchd /usr/bin/gridcoinresearchd
killall -9 gridcoinresearchd

To make it update the wallet, type

./update-gridcoin.sh

Once the script updates the wallet, it will kill the Gridcoin daemon. With the help of the previous script we just made it will be restarted within 5 minutes. If the update script fails because of something, the wallet will not be killed.

Wrapping up

I hope you enjoy reading our tutorials, please upvote them on steemit if you enjoy them.
If this is just your very first steps into a new and very exiting crypto coin, there are many places you can go for discussing and reading about it.

IRC: freenode.net #gridcoin and #gridcoin-help
Gridcoin Webpage
Gridcoin Forum
Gridcoin Reddit
Gridcoin Wiki
Gridcoin Pool
Right here on Steemit

Other Tutorials:
Gridcoin Tutorial: Get started with the Pool
Gridcoin Tutorial: Solo Mining; A guide trough magnitude, neural network and beacons
Gridcoin Tutorial: Setting up a Gridcoin Wallet Staking 24hrs/day

I also want to shout out to @officialfuzzy with #beyondbitcoin for doing a great show. Gridcoin is making appearance on his show from time to time so please check them out and vote us in if you are around.

Please be aware that typos may happen and will be corrected on mentions

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Linode is now $5 apparently for a 1GB RAM box. Totally doing this.

  ·  8 years ago (edited)

typo:

  • "to happened" -> "to happen"
  • on linux the binary is called with small b: boinccmd, not "Boinccmd --join_acct_mgr"

Thanks for the reading trough and noticing my small typos.

Just wanted to share guys.. Earn POS Mining rewards while you trade at Btcpop.co!

Staking GRC.png

Good post!

Excellent post, sc-steemit!

I've got an automatic node setup script that i'll be updating with some of your scripts, cheers mate :)

Glad you liked it :)

Good! Very useful.
Thanks for the additional scripts and links

Your welcome, just glad to have helped you :)

Excellent post !

I know this is an older post but I get an error when trying to install GRC wallet through my linode VPS. E: Unable to locate package libzip
going to try to work around this issue. Just a heads up.

Did you install libzip-dev and libzip2 through apt?
If your still having issue I suggest you to join the Team Gridcoin Slack channel.