Skip to content

Commit 8f6f48b

Browse files
author
Jon
committed
Update INSTALL.md
Customize install document for vertcoin. Add details on cron job workaround for VTC pricing.
1 parent da20b69 commit 8f6f48b

File tree

1 file changed

+75
-53
lines changed

1 file changed

+75
-53
lines changed

docs/INSTALL.md

+75-53
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# Coinpunk Installation Procedure
1+
# Vertpunk Installation Procedure
22

3-
This guide will assist you with installing Coinpunk. This document assumes you are running Ubuntu 12.04 LTS, adjustments may need to be made for other OSes.
3+
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.
44

5-
If you don't understand how to use this document, **Coinpunk is not for you**. Coinpunk requires a commanding understanding of UNIX system administration to be run safely. If you are learning, you can use Coinpunk's `testnet` mode to ensure that mistakes cannot lead to loss of money.
6-
7-
## System Requirements
8-
9-
A VPS with at least 2GB RAM is needed for the moment, due to the memory usage of bitcoind. This will hopefully be lowered in the future (either from bitcoind becoming more memory efficient, or from Coinpunk switching to a lighter SPV-based node).
5+
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.
106

117
## Install Prerequisites
128

@@ -51,79 +47,96 @@ Change `appendfsync everysec` to `appendfsync always`.
5147

5248
Restart redis: `sudo service redis-server restart`.
5349

54-
## Install and Configure Bitcoind
50+
## Install and Configure vertcoind
5551

56-
Currently Coinpunk depends on a custom build of Bitcoind using [this patch](https://github.com/bitcoin/bitcoin/pull/2861).
52+
Currently Vertpunk depends on a custom build of vertcoind using [this patch](https://github.com/dayreiner/vertcoin-watchonly).
5753

54+
Install prerequisites:
5855
```
59-
wget https://github.com/sipa/bitcoin/archive/watchonly.tar.gz
60-
tar -zxf watchonly.tar.gz
61-
cd bitcoin-watchonly
62-
sudo add-apt-repository ppa:bitcoin/bitcoin
63-
sudo apt-get update
64-
sudo apt-get install libdb4.8++ libdb4.8++-dev pkg-config libprotobuf-dev libminiupnpc8 minissdpd libboost-all-dev ccache libssl-dev
65-
./autogen.sh
66-
./configure --without-qt
67-
make
68-
sudo make install
56+
sudo apt-get install libdb4.8++ libdb4.8++-dev pkg-config libprotobuf-dev \
57+
libminiupnpc8 minissdpd libboost-all-dev ccache libssl-dev
6958
```
7059

71-
If you see this error when running configure: `configure: error: Could not find a version of the library!`
72-
Try running with this command instead: `./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu --without-qt`
60+
Checkout and make [vertcoin-watchonly](https://github.com/dayreiner/vertcoin-watchonly):
61+
```
62+
git clone https://github.com/dayreiner/vertcoin-watchonly.git
63+
cd vertcoin-watchonly/src
64+
make -f makefile.unix USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1
65+
strip vertcoind
66+
```
67+
68+
Create a user for vertcoind and move the binary to where it can access it:
69+
```
70+
adduser vertcoin
71+
mkdir -p ~vertcoin/bin
72+
mv vertcoind /usr/home/vertcoin/bin
73+
```
7374

74-
Now you need to configure bitcoind:
75+
Now you need to configure vertcoind:
7576

7677
```
77-
mkdir -p ~/.bitcoin
78-
vi ~/.bitcoin/bitcoin.conf
78+
su - vertcoin
79+
mkdir -p ~/.vertcoin
80+
vi ~/.vertcoin/vertcoin.conf
7981
```
8082

81-
And add the following information (set the `rpcuser` and `rpcpassword` to something else:
83+
And add the following information (set the `rpcuser` and `rpcpassword` to something else):
8284

8385
```
8486
rpcuser=NEWUSERNAME
8587
rpcpassword=NEWPASSWORD
88+
rpcallowip=127.0.0.1
89+
rpcport=5888
90+
port=5889
8691
txindex=1
87-
testnet=1
92+
server=1
93+
daemon=1
94+
addnode=192.241.125.215
95+
addnode=192.241.125.216
96+
addnode=192.241.125.217
97+
addnode=192.241.125.218
98+
addnode=192.241.125.219
99+
addnode=192.241.125.220
100+
addnode=31.220.27.16
101+
addnode=162.217.249.196
88102
```
103+
**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.
89104

90-
**If your bitcoind crashes due to memory consumption**, try limiting your connections by adding `maxconnections=10`. Try further adjusting to 3 if you are still having issues.
91-
92-
If you want to run Coinpunk in production rather than on testnet, remove `testnet=1` from the config. Testnet emulates the production Bitcoin network, but does so in a way that you can't lose money. You can send money to your Coinpunk accounts using Bitcoin Testnet Faucets like [the Mojocoin Testnet3 Faucet](http://faucet.xeno-genesis.com/). I strongly recommend this mode for testing.
105+
Consider adding a startup script for vertcoind to either init.d or via upstart.
93106

94-
Start bitcoind:
107+
Start vertcoind as the vertcoin user:
95108

96109
```
97-
bitcoind &
110+
su - vertcoin
111+
vertcoind &
98112
```
99113

100-
**Bitcoind will take several hours or more to download the blockchain.** Coinpunk will not be able to function properly until this has occurred. Please be patient.
114+
**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.
101115

102-
If you want something to monitor bitcoind to ensure it stays running and start it on system restart, take a look at [Monit](http://mmonit.com/monit/).
116+
If you want something to monitor vertcoind to ensure it stays running and start it on system restart, take a look at [Monit](http://mmonit.com/monit/).
103117

104-
## Install and Configure Coinpunk
118+
## Install and Configure Vertpunk
105119

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

108122
```
109-
git clone https://github.com/kyledrake/coinpunk.git
110-
cd coinpunk
123+
git clone https://github.com/dayreiner/vertpunk.git
124+
cd vertpunk
111125
npm install
112126
```
113127

114-
Now you will need to create and configure your config.json file, one for the main folder and one in `public`. From the `coinpunk` directory:
128+
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:
115129

116130
```
117131
cp config.template.json config.json
118132
```
119133

120-
Edit the file to connect to `bitcoind`. Use port `18332` for testnet, `8332` for production. Also remove the `testnet` entry for production:
134+
Edit the file to connect to `vertcoind` on port 5888 using the user/password you set when configuring vertcoind:
121135

122136
```
123137
{
124-
"bitcoind": "http://NEWUSERNAME:[email protected]:18332",
125-
"pricesUrl": "https://bitpay.com/api/rates",
126-
"testnet": true,
138+
"bitcoind": "http://NEWUSERNAME:[email protected]:5888",
139+
"pricesUrl": "http://localhost:8080/rates.json",
127140
"httpPort": 8080
128141
}
129142
```
@@ -132,43 +145,52 @@ For SSL:
132145

133146
```
134147
{
135-
"bitcoind": "http://NEWUSERNAME:[email protected]:18332",
136-
"pricesUrl": "https://bitpay.com/api/rates",
137-
"testnet": true,
138-
"httpPort": 8085,
148+
"bitcoind": "http://NEWUSERNAME:[email protected]:5888",
149+
"pricesUrl": "http://localhost:8080/rates.json",
150+
"httpPort": 8080,
139151
"httpsPort": 8086,
140-
"sslKey": "./coinpunk.key",
141-
"sslCert": "./coinpunk.crt"
152+
"sslKey": "./Vertpunk.key",
153+
"sslCert": "./Vertpunk.crt"
142154
}
143155
```
156+
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.
144157

145158
Now copy the client application's config:
146159

147160
```
148161
cp public/config.template.json public/config.json
149162
```
150163

151-
And change `network` to `prod` instead of `testnet` if you are using Coinpunk in production mode.
164+
And change `network` to `prod` instead of `testnet` to use Vertpunk in production mode.
152165

153-
## Start Coinpunk
166+
## Start Vertpunk
154167

155-
You can start Coinpunk from the command line:
168+
You can start Vertpunk from the command line:
156169

157170
```
158171
node start.js
159172
```
160173

174+
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!
175+
176+
## Vertcoin Price Cron Job
177+
178+
Edit the crontab of the user you are running vertpunk as, and insert the following entry:
179+
180+
```
181+
0,15,30,45 * * * * /home/vertpunk/vertpunk/get_vtc_exchange_rate.sh >> /home/vertpunk/vtcusd.log 2>&1
182+
```
161183

162-
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 Coinpunk!
184+
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.
163185

164186
## Backing up Database
165187

166188
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!
167189

168190
## Extra Steps for Contributors
169191

170-
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 Coinpunk's CSS and JS resources. Grunt is installed by the `npm install` you ran from the coinpunk directory.
192+
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.
171193

172-
Running `./node_modules/grunt-cli/bin/grunt` in your Coinpunk directory will minify and uglify everything, and running `./node_modules/grunt-cli/bin/grunt watch` will automatically uglify your JS files when they change.
194+
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.
173195

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

0 commit comments

Comments
 (0)