Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
onsightit committed Aug 29, 2017
2 parents a759aa9 + 67a2f50 commit 925344d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 54 deletions.
59 changes: 22 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Web-Wallet

Web-Wallet for altcoin daemons.
A Web-Wallet for altcoin daemons.


## Prerequisites:

A running RPC coin daemon. See: https://github.com/YourApp/YourCoin
A running RPC coin daemon. See: https://github.com/Web-Wallet/YourCoin

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

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

If running 4.x:
> sudo apt-get purge nodejs npm
Expand All @@ -21,7 +22,7 @@ Node.js 6.x for running YourApp. For debian installations:
> curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
> sudo apt-get install -y nodejs
If YourApp is not running locally, https is the default protocol. To set up a self-signed SSL certificate in debian/apache2 environments, run:
If 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
Expand All @@ -31,11 +32,11 @@ If YourApp is not running locally, https is the default protocol. To set up a s

## Configuring:

Configure the database connection parameters, localizations and features of YourApp by copying 'settings.json.template' to 'settings.json' and making your changes in 'settings.json'.
Configure the database connection parameters, localizations and features of Web-Wallet by copying 'settings.json.template' to 'settings.json' and making your changes in 'settings.json'.

Configure YourApp and daemon for local or non-local operation, or a combination of both. For instance:
Configure Web-Wallet and daemon for local or non-local operation, or a combination of both. For instance:

If the coin daemon is running on the same machine as YourApp, the daemon's config file will be used. It can be found at:
If the coin daemon is running on the same machine as Web-Wallet, the daemon's config file will be used. It can be found at:

// Mac OS
'$HOME/Library/Application Support/YourCoin/yourcoin.conf'
Expand All @@ -48,55 +49,39 @@ If the coin daemon is running on the same machine as YourApp, the daemon's confi

(Substitute your coin's name for 'YourCoin' 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:
You will need to configure wallet params in settings.conf to match the wallet daemon's config file. The wallet daemon's config file will need the following parameters:

> rpcuser=rpcuser
> rpcuser=rpcuser # Change me.
> rpcpassword=password # Change me!
> rpcconnect=localhost # RPC daemon
> rpcport=18181
> server=1 # If not running a daemon
Local vs Not-Local configuration:

The config file parameter 'rpcconnect' determines whether the daemon is local or not-local, even if the daemon and YourApp are both running on the same machine. YourApp'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
The last two examples allow for YourApp to be considered 'local', even though the node and daemon may be running on different machines on the same local network.

If the daemon and YourApp are both running on the same machine, you can still define YourApp as NOT-local by setting the 'rpcconnect' parameter to a fully qualified domain name (i.e. myhost.homelan.net), which requirs a simple modification to the machine's hosts file. (e.g. 192.168.1.246 myhost.homelan.net)

If 'isLocal' is true, more control over YourApp is allowed. (i.e. encrypting the wallet, locking/unlocking the wallet for sending/staking, and more wallet stats and features are available.)

[See 'rpcconnect' in the coin's source code, init.cpp, for more information.]
> rpcport=19184
> server=1
> listen=1
> daemon=1
> staking=1
> rpcallowip=<your IP address>
If you need to run YourApp app from a "sub directory" of the main web-site (e.g. https://example.com/wallet/), change the settings.json parameter, chRoot to: "".
If you need to run Web-Wallet app from a "sub directory" of the main web-site (e.g. https://example.com/web-wallet/), change the settings.json parameter, chRoot to: "".


## Running:

Windows:

> YourApp.bat
> Web-Wallet.bat
(If supervisor is not installed, run 'npm install supervisor'.)

Linux:

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

YourApp has an admin account pre-defined which you can login with:
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)
The MASTER_ACOUNT always sees YourApp as 'local' and has views into the wallet as if you were running a Qt wallet (i.e. the full wallet balance).
The MASTER_ACOUNT always sees Web-Wallet as 'local' and has views into the wallet as if you were running a Qt wallet (i.e. the full wallet balance).

To setup individual accounts, use YourApp's Signup page, or login with a social media account.
To setup individual accounts, use Web-Wallet's Signup page, or login with a social media account.
1 change: 0 additions & 1 deletion lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var commands = module.exports.commands = [
// non-rpc commands
'getNodeInfo',
'getUserAccount',
'getnodestats',
'saveUserProfile',
'saveUserWallet'
];
Expand Down
2 changes: 0 additions & 2 deletions lib/init-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ function Init() {
newUser.local.id = coin.settings.masterAccount;
newUser.local.password = newUser.local.generateHash("password");
newUser.local.changeme = true;
// This is temporarily set for logging into the Storj bridge.
newUser.profile.bridge_password = btoa("password");
newUser.profile.login_type = "local";
newUser.profile.last_login = Date.now();
newUser.profile.role = "Admin";
Expand Down
12 changes: 6 additions & 6 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ exports.env = "development";
exports.appHost = "localhost";

// The app title, visible in browser window
exports.appTitle = "YourApp";
exports.appTitle = "YourCoin App";

// The app slogan
exports.appSlogan = "Explore YourApp!";
exports.appSlogan = "Explore YourCoin App!";

// The app description
exports.appDescription = "YourApp description goes here.";
exports.appDescription = "YourCoin App description goes here.";

// The copyright for the footer
exports.copyRight = "Copyright (c) " + moment().utc().format("YYYY") + ", The " + this.appTitle + " developers. All rights reserved.";
Expand All @@ -44,8 +44,8 @@ exports.favicon = "./public/wallet/favicon.ico";
// Coin name / page heading
exports.coinName = "YourCoin";

// Coin symbol, e.g. BTC, VRC, SPCD, HCN, ...
exports.coinSymbol = "SPCD";
// Coin symbol, e.g. BTC, VRC, SSH, HCN, ...
exports.coinSymbol = "SSH";

// Coin addresses start with this character
exports.coinChar = "S";
Expand All @@ -64,7 +64,7 @@ exports.txComment = false;
// # ORIGINAL RewriteRule . /index.php [L]
// RewriteRule ./ /index.php [L]
// Set to "" to allow the sub-folder 'wallet' to be exposed for proxying.
// Set to "/wallet" to chroot the node to /public/wallet/ (Normal for stand-alone YourApp).
// Set to "/wallet" to chroot the node to /public/wallet/ (Normal for stand-alone YourCoin).
exports.chRoot = "/wallet";

// Show stats in navigation
Expand Down
2 changes: 1 addition & 1 deletion public/wallet/js/viewmodels/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ define(['knockout',
// Called once at startup.
walletType.prototype.initNode = function(chRoot){
var self = this;
// Catch-22: We don't know if YourApp is chRoot'd to /public or /public/wallet,
// Catch-22: We don't know if YourCoin is chRoot'd to /public or /public/wallet,
// because 'settings' has not been set yet, so we need to test for a failure first
// to determine if settings().chRoot is "" or "/wallet".
var getNodeInfoCommand = new Command('getnodeinfo', [],
Expand Down
12 changes: 6 additions & 6 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"appHost": "localhost",

// The app title, visible in browser window
"appTitle": "YourApp Title",
"appTitle": "YourCoin Title",

// The app slogan
"appSlogan": "Explore YourApp!",
"appSlogan": "Explore YourCoin!",

// The app description
"appDescription": "YourApp description goes here.",
"appDescription": "YourCoin App description goes here.",

// The copyright for the footer (uncomment to override default)
//"copyRight": "Copyright (c) 2016-2017, The YourApp developers. All rights reserved.",
//"copyRight": "Copyright (c) 2016-2017, The YourCoin developers. All rights reserved.",

// Logo
"logo": "/images/Logo.png",
Expand All @@ -38,7 +38,7 @@
"coinName": "YourCoin",

// Coin symbol
"coinSymbol": "SPC",
"coinSymbol": "SSH",

// Coin addresses start with this character
"coinChar": "S",
Expand All @@ -57,7 +57,7 @@
// # ORIGINAL RewriteRule . /index.php [L]
// RewriteRule ./ /index.php [L]
// Set to "" to allow the sub-folder 'wallet' to be exposed for proxying.
// Set to "/wallet" to chroot the node to /public/wallet/ (Normal for stand-alone YourApp).
// Set to "/wallet" to chroot the node to /public/wallet/ (Normal for stand-alone YourCoin).
"chRoot": "/wallet",

// Show stats in navigation
Expand Down
2 changes: 1 addition & 1 deletion wallet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* YourApp App
* YourCoin App
*/

Object.defineProperty(Error.prototype, 'toJSON', {
Expand Down

0 comments on commit 925344d

Please sign in to comment.