Skip to content

Latest commit

 

History

History
196 lines (140 loc) · 6.3 KB

INSTALL.md

File metadata and controls

196 lines (140 loc) · 6.3 KB

Vertpunk Installation Procedure

This guide will assist you with installing Vertpunk. This document assumes you are running Ubuntu 12.04 LTS, adjustments may need to be made for other OSes.

If you don't understand how to use this document, Vertpunk is not for you. Vertpunk requires a commanding understanding of UNIX system administration to be run safely.

Install Prerequisites

Update your repository data and packages if this is a fresh install of Ubuntu:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git autoconf libtool ntp build-essential

It is recommended you enable unattended security updates to help protect your system from security issues:

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

Install NodeJS

The latest information on installing NodeJS for your platform is available here, this is the current procedure for Ubuntu:

sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Install and Configure Redis

Redis is used to store your wallet data.

sudo apt-get install redis-server

Now you will need to edit /etc/redis/redis.conf to be more data persistent:

Change appendonly no to appendonly yes. Change appendfsync everysec to appendfsync always.

Restart redis: sudo service redis-server restart.

Install and Configure vertcoind

Currently Vertpunk depends on a custom build of vertcoind using this patch.

Install prerequisites:

sudo apt-get install libdb4.8++ libdb4.8++-dev pkg-config libprotobuf-dev \
libminiupnpc8 minissdpd libboost-all-dev ccache libssl-dev

Checkout and make vertcoin-watchonly:

git clone https://github.com/dayreiner/vertcoin-watchonly.git
cd vertcoin-watchonly/src
make -f makefile.unix USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1
strip vertcoind

Create a user for vertcoind and move the binary to where it can access it:

adduser vertcoin
mkdir -p ~vertcoin/bin
mv vertcoind /usr/home/vertcoin/bin

Now you need to configure vertcoind:

su - vertcoin
mkdir -p ~/.vertcoin
vi ~/.vertcoin/vertcoin.conf

And add the following information (set the rpcuser and rpcpassword to something else):

rpcuser=NEWUSERNAME
rpcpassword=NEWPASSWORD
rpcallowip=127.0.0.1
rpcport=5888
port=5889
txindex=1
server=1
daemon=1
addnode=192.241.125.215
addnode=192.241.125.216
addnode=192.241.125.217
addnode=192.241.125.218
addnode=192.241.125.219
addnode=192.241.125.220
addnode=31.220.27.16
addnode=162.217.249.196

If your vertcoind crashes due to memory consumption, try limiting your connections by adding maxconnections=10. Try further adjusting to 3 if you are still having issues.

Consider adding a startup script for vertcoind to either init.d or via upstart.

Start vertcoind as the vertcoin user:

su - vertcoin
vertcoind &

vertcoind may take up to an hour (or more, depending on growth) to download the blockchain. Vertpunk will not be able to function properly until this has occurred. Please be patient.

If you want something to monitor vertcoind to ensure it stays running and start it on system restart, take a look at Monit.

Install and Configure Vertpunk

Go to your user's home directory (cd ~), clone the repository and install nodejs dependencies:

git clone https://github.com/dayreiner/vertpunk.git
cd vertpunk
npm install

Now you will need to create and configure your config.json file, one for the main folder and one in public. From the vertpunk directory:

cp config.template.json config.json

Edit the file to connect to vertcoind on port 5888 using the user/password you set when configuring vertcoind:

{
  "bitcoind": "http://NEWUSERNAME:NEWPASSWORD@127.0.0.1:5888",
  "pricesUrl": "http://localhost:8080/rates.json",
  "httpPort": 8080
}

For SSL:

{
  "bitcoind": "http://NEWUSERNAME:NEWPASSWORD@127.0.0.1:5888",
  "pricesUrl": "http://localhost:8080/rates.json",
  "httpPort": 8080,
  "httpsPort": 8086,
  "sslKey": "./Vertpunk.key",
  "sslCert": "./Vertpunk.crt"
}

Alternately, you can use Nginx as your SSL endpoint and proxy requests over to Vertpunk instead of opening your node install directly to the world.

Now copy the client application's config:

cp public/config.template.json public/config.json

And change network to prod instead of testnet to use Vertpunk in production mode.

Start Vertpunk

You can start Vertpunk from the command line:

node start.js

Try to connect by going to http://YOURADDRESS.COM:8080 (If you're using the SSL config then try http://YOURADDRESS.COM:8085. OR https://YOURADDRESS.COM:8086) If it loads, then you should be ready to use Vertpunk!

Vertcoin Price Cron Job

Edit the crontab of the user you are running vertpunk as, and insert the following entry:

0,15,30,45 * * * * /home/vertpunk/vertpunk/get_vtc_exchange_rate.sh >> /home/vertpunk/vtcusd.log 2>&1

This will run the get_vtc_exchange_rate.sh script every 15 minutes to grab the current VTC/USD exchange rate. This is a simple hack to get around the lack of a bitpay-style pricing API for coins other than bitcoin.

Backing up Database

Redis maintains a file called /var/lib/redis/dump.rdb, which is a backup of your Redis database. It is safe to copy this file while Redis is running. It is strongly recommended that you backup this file frequently. You can also setup a Redis slave to listen to master in real time. Ideally you should do both!

Extra Steps for Contributors

If you want to contribute code to this project, you will need to use Grunt. Grunt is a task-runner that presently handles minifying and uglifying Vertpunk's CSS and JS resources. Grunt is installed by the npm install you ran from the Vertpunk directory.

Running ./node_modules/grunt-cli/bin/grunt in your Vertpunk directory will minify and uglify everything, and running ./node_modules/grunt-cli/bin/grunt watch will automatically uglify your JS files when they change.

You can also install grunt system-wide with sudo npm install -g grunt-cli.