Skip to content

Commit

Permalink
Use a real coin for defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
onsightit committed Dec 18, 2016
1 parent 436b048 commit 5faccf1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
24 changes: 12 additions & 12 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ RUN apt-get --yes upgrade
# Install utils.
RUN apt-get install --yes git sudo openssh-server vim aptitude daemon nodejs inetutils-ping telnet cron

RUN useradd --user-group --create-home --shell /bin/bash healthcoin \
&& echo 'healthcoin:healthcoin' | chpasswd && adduser healthcoin sudo
RUN echo 'healthcoin ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
RUN useradd --user-group --create-home --shell /bin/bash solarcoin \
&& echo 'solarcoin:solarcoin' | chpasswd && adduser solarcoin sudo
RUN echo 'solarcoin ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

COPY web-wallet /home/healthcoin/
RUN chmod a+rwx /home/healthcoin/web-wallet
RUN chown healthcoin:healthcoin /home/healthcoin/web-wallet
RUN mkdir /home/healthcoin/.healthcoin
COPY coin.conf /home/healthcoin/.healthcoin/
RUN chown -R healthcoin:healthcoin /home/healthcoin/.healthcoin
COPY web-wallet /home/solarcoin/
RUN chmod a+rwx /home/solarcoin/web-wallet
RUN chown solarcoin:solarcoin /home/solarcoin/web-wallet
RUN mkdir /home/solarcoin/.solarcoin
COPY coin.conf /home/solarcoin/.solarcoin/
RUN chown -R solarcoin:solarcoin /home/solarcoin/.solarcoin

USER healthcoin
USER solarcoin

# Install web-wallet
RUN cd ~ \
Expand All @@ -38,8 +38,8 @@ EXPOSE 8181
#EXPOSE 8383

# Add VOLUMEs to allow backup of data
VOLUME ['/home/healthcoin']
VOLUME ['/home/solarcoin']

WORKDIR /home/healthcoin
WORKDIR /home/solarcoin

CMD ./web-wallet
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@

## Prerequisites:

A running RPC coin daemon. See: https://github.com/onsightit/healthcoin
A running RPC coin daemon. See: https://github.com/onsightit/solarcoin

Mongo DB for storing account info and biomarker data. See: https://www.mongodb.com/

Create DB and user:
> use healthcoin
> db.createUser( { user: "healthcoin", pwd: "{password}", roles: [ "readWrite" ] } )
> use solarcoin
> db.createUser( { user: "solarcoin", pwd: "{password}", roles: [ "readWrite" ] } )
Node.js 6.x for running the Web Wallet. For debian installations:

If running 4.x:
sudo apt-get purge nodejs npm

Install 6.x:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
> curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
> sudo apt-get install -y nodejs
If the Web Wallet is not running locally, https is the default protocol. To set up a self-signed SSL certificate in debian/apache2 environments, run:

sudo mkdir /etc/apache2/certs
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/certs/{domain name}.key -out /etc/apache2/certs/{domain name}.crt
> sudo mkdir /etc/apache2/certs
> sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/certs/{domain name}.key -out /etc/apache2/certs/{domain name}.crt
Note: Also copy the crt and key file to the {nodejs}/sslcert directory. Change the owner to that of the nodejs process, then make sure your settings.json SSL parameters have the correct file-names for your key and crt files.

Expand All @@ -37,33 +37,33 @@ Configure the Web Wallet and daemon for local or non-local operation, or a combi
If the daemon is running on the same machine as the Web Wallet, the daemon's config file will be used. It can be found at:

// Mac OS
'$HOME/Library/Application Support/Healthcoin/healthcoin.conf'
'$HOME/Library/Application Support/SolarCoin/solarcoin.conf'

// Linux
'$HOME/.healthcoin/healthcoin.conf'
'$HOME/.solarcoin/solarcoin.conf'

// Windows
'$APPDATA/Healthcoin/healthcoin.conf'
'$APPDATA/SolarCoin/solarcoin.conf'

(Substitute your coin's name for 'Healthcoin' above.)
(Substitute your coin's name for 'SolarCoin' above.)

If the daemon is running on another machine, you will need to configure node.js's coin.conf file to match the daemon's config file. coin.conf is found in: lib/coin.conf

Either way, the config file will need at a minimum the following parameters:

rpcuser=rpcuser
rpcpassword=password # Change me!
rpcconnect=localhost # RPC daemon
rpcport=18184
> rpcuser=rpcuser
> rpcpassword=password # Change me!
> rpcconnect=localhost # RPC daemon
> rpcport=18184
Local vs Not-Local configuration:

The config file parameter 'rpcconnect' determines whether the daemon (and thus the Web Wallet) is local or not-local, even if the daemon and Web Wallet are both running on the same machine. The Web Wallet's boolean flag 'isLocal' is determined to be true if 'rpcconnect' is one of the following:

rpcconnect=127.0.0.1
rpcconnect=localhost
rpcconnect=192.168.x.x
rpcconnect=hostname_with_no_tld
> rpcconnect=127.0.0.1
> rpcconnect=localhost
> rpcconnect=192.168.x.x
> rpcconnect=hostname_with_no_tld
The last two examples allow for the Web Wallet to be considered 'local', even though the node and daemon may be running on different machines on the same local network.

Expand All @@ -80,20 +80,20 @@ If you need to run the Web Wallet app from a "sub directory" of the main web-sit

Windows:

web-wallet.bat
> web-wallet.bat
(If supervisor is not installed, run 'npm install supervisor'.)
(If supervisor is not installed, run 'npm install supervisor'.)

Linux:

web-wallet.sh
> web-wallet.sh
(If 'daemon' is not installed, please consult your Linux distro's documentation for installing 'daemon'.)
(If 'daemon' is not installed, please consult your Linux distro's documentation for installing 'daemon'.)

The Web Wallet has an admin account pre-defined which you can login with:

Login: MASTER_ACCOUNT
Password: password (you will be required to change this)
> Login: MASTER_ACCOUNT
> Password: password (you will be required to change this)
The MASTER_ACOUNT always sees the Web Wallet as 'local' and has views into the wallet as if you were running a Qt wallet (i.e. the full wallet balance).

Expand Down
14 changes: 7 additions & 7 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ var jsonminify = require("jsonminify");
exports.env = "development";

// The app title, visible in browser window
exports.coinTitle = "Healthcoin Web Wallet";
exports.coinTitle = "SolarCoin Web Wallet";

// Coin description
exports.coinDescription = "Healthcoin keeps track of the user's biomarker progress in diabetic and pre-diabetic patients. Biomarker data is sent anonymously to the blockchain for research purposes later.";
exports.coinDescription = "SolarCoin keeps track of the user's biomarker progress in diabetic and pre-diabetic patients. Biomarker data is sent anonymously to the blockchain for research purposes later.";

// The copyright for the footer
exports.copyRight = "Copyright (c) 2016, The Healthcoin Developers. All rights reserved.";
exports.copyRight = "Copyright (c) 2016, The SolarCoin Developers. All rights reserved.";

// Coin name / page heading
exports.coinName = "healthcoin";
exports.coinName = "solarcoin";

// Coin symbol, e.g. BTC, VRC, SLR, HCN, ...
exports.coinSymbol = "HCN";
Expand Down Expand Up @@ -74,17 +74,17 @@ exports.sslCrt = "./sslcert/server.crt";

// This setting is passed to MongoDB to set up the database
exports.mdb = {
"user": "healthcoin",
"user": "solarcoin",
"password": "password",
"database": "healthcoin",
"database": "solarcoin",
"host" : "127.0.0.1",
"port" : 27017
};

// MASTER_ACCOUNT will become an address label in the wallet.
// *** DO NOT CHANGE THE ACCOUNT NAME AFTER FIRST RUN! ***
exports.masterAccount = "MASTER_ACCOUNT"; // Master UI login account, and Label to assign to "" wallet accounts.
exports.masterEmail = "admin@healthcoin.com"; // Master email account.
exports.masterEmail = "admin@solarcoin.com"; // Master email account.
exports.masterCanEncrypt = false; // Allow wallet encryption by MASTER_ACCOUNT


Expand Down
2 changes: 1 addition & 1 deletion node_modules/coin-node/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"copyRight": "Copyright (c) 2016, The Healthcoin Developers. All rights reserved.",

// Coin name / page heading
"coinName": "healthcoin",
"coinName": "solarcoin",

// Coin symbol
"coinSymbol": "HCN",
Expand Down Expand Up @@ -75,9 +75,9 @@

// Database settings (MongoDB)
"mdb": {
"user": "healthcoin",
"user": "solarcoin",
"password": "password",
"database": "healthcoin",
"database": "solarcoin",
"host": "localhost",
"port": 27017
},
Expand All @@ -87,7 +87,7 @@
"masterAccount": "MASTER_ACCOUNT",

// Master email account.
"masterEmail": "admin@healthcoin.com",
"masterEmail": "admin@solarcoin.com",

// Master can encrypt the wallet
"masterCanEncrypt": true
Expand Down

0 comments on commit 5faccf1

Please sign in to comment.