Skip to content

Commit 3d08028

Browse files
Version 2.1.0
1 parent 41a2b70 commit 3d08028

45 files changed

Lines changed: 562 additions & 1631 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Live settings file
22
settings.json
3+
coin.conf
34

4-
# SSL certs
5+
# SSL certs and keys
56
sslcert/*.*
7+
key.ring/*.*
68

79
# node_modules
810
node_modules/

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# Web-Wallet
2-
3-
Web-Wallet for altcoin daemons.
1+
# YourApp
2+
![YourApp, LLC](https://github.com/YourApp/YourApp/blob/master/public/images/YourApp-logo.png)
43

54

65
## Prerequisites:
76

8-
A running RPC coin daemon. See: https://github.com/onsightit/SpaceCredits
7+
A running RPC coin daemon. See: https://github.com/YourApp/YourCoin
98

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

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

1817
If running 4.x:
1918
> sudo apt-get purge nodejs npm
@@ -22,7 +21,7 @@ Node.js 6.x for running Web-Wallet. For debian installations:
2221
> curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
2322
> sudo apt-get install -y nodejs
2423
25-
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:
24+
If YourApp is not running locally, https is the default protocol. To set up a self-signed SSL certificate in debian/apache2 environments, run:
2625

2726
> sudo mkdir /etc/apache2/certs
2827
> sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/certs/{domain name}.key -out /etc/apache2/certs/{domain name}.crt
@@ -32,22 +31,22 @@ If Web-Wallet is not running locally, https is the default protocol. To set up
3231

3332
## Configuring:
3433

35-
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'.
34+
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'.
3635

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

39-
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:
38+
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:
4039

4140
// Mac OS
42-
'$HOME/Library/Application Support/SpaceCredits/spacecredits.conf'
41+
'$HOME/Library/Application Support/YourCoin/yourcoin.conf'
4342

4443
// Linux
45-
'$HOME/.spacecredits/spacecredits.conf'
44+
'$HOME/.yourcoin/yourcoin.conf'
4645

4746
// Windows
48-
'$APPDATA/SpaceCredits/spacecredits.conf'
47+
'$APPDATA/YourCoin/yourcoin.conf'
4948

50-
(Substitute your coin's name for 'SpaceCredits' above.)
49+
(Substitute your coin's name for 'YourCoin' above.)
5150

5251
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
5352

@@ -61,43 +60,43 @@ Either way, the config file will need at a minimum the following parameters:
6160
6261
Local vs Not-Local configuration:
6362

64-
The config file parameter 'rpcconnect' determines whether the daemon (and thus Web-Wallet) is local or not-local, even if the daemon and Web-Wallet are both running on the same machine. Web-Wallet's boolean flag 'isLocal' is determined to be true if 'rpcconnect' is one of the following:
63+
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:
6564

6665
> rpcconnect=127.0.0.1
6766
> rpcconnect=localhost
6867
> rpcconnect=192.168.x.x
6968
> rpcconnect=hostname_with_no_tld
7069
71-
The last two examples allow for Web-Wallet to be considered 'local', even though the node and daemon may be running on different machines on the same local network.
70+
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.
7271

73-
If the daemon and Web-Wallet are both running on the same machine, you can still define Web-Wallet 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)
72+
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)
7473

75-
If 'isLocal' is true, more control over Web-Wallet is allowed. (i.e. encrypting the wallet, locking/unlocking the wallet for sending/staking, and more wallet stats and features are available.)
74+
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.)
7675

7776
[See 'rpcconnect' in the coin's source code, init.cpp, for more information.]
7877

79-
If you need to run Web-Wallet app from a "sub directory" of the main web-site (e.g. https://example.com/wallet/), change the settings.json parameter, chRoot to: "".
78+
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: "".
8079

8180

8281
## Running:
8382

8483
Windows:
8584

86-
> web-wallet.bat
85+
> YourApp.bat
8786
8887
(If supervisor is not installed, run 'npm install supervisor'.)
8988

9089
Linux:
9190

92-
> web-wallet.sh
91+
> YourApp.sh
9392
9493
(If 'daemon' is not installed, please consult your Linux distro's documentation for installing 'daemon'.)
9594

96-
Web-Wallet has an admin account pre-defined which you can login with:
95+
YourApp has an admin account pre-defined which you can login with:
9796

9897
> Login: MASTER_ACCOUNT
9998
> Password: password (you will be required to change this)
10099
101-
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).
100+
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).
102101

103-
To setup individual accounts, use Web-Wallet's Signup page, or login with a social media account.
102+
To setup individual accounts, use YourApp's Signup page, or login with a social media account.

coin.conf.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rpcuser=rpcuser
2+
rpcpassword=password
3+
rpcconnect=localhost # RPC Node
4+
rpcport=19184

lib/coinapi.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ fs = require('fs-extra');
33
// Get the user defined application settings.
44
settings = require('./settings');
55

6-
// If the daemon is running on the same machine as the node, its config file will be used.
7-
// Otherwise, you will need to configure the config file found in: lib/coin.conf
6+
// You will need to configure the config file found in: coin.conf
7+
// Otherwise, if the daemon is running on the same machine as the node, its config file will be used.
88
// See README.md for more information.
9-
if (process.platform == 'darwin'){
10-
// Mac OS
11-
filepath = process.env.HOME + '/Library/Application Support/' + settings.coinName + '/' + settings.coinName + '.conf';
12-
} else if (process.platform == 'linux'){
13-
// Linux
14-
filepath = process.env.HOME + '/.' + settings.coinName + '/' + settings.coinName + '.conf';
15-
} else {
16-
// Windows
17-
filepath = process.env.APPDATA + '/' + settings.coinName + '/' + settings.coinName + '.conf';
18-
}
19-
9+
filepath = 'coin.conf';
10+
console.log("Reading " + filepath + " parameters...");
2011
if (fs.existsSync(filepath) === false){
21-
console.log("WARNING: Config file does not exists. Using the node's config file...");
22-
filepath = 'lib/coin.conf';
12+
console.log("WARNING: " + filepath + " does not exists. Using the coin's config file...");
13+
if (process.platform == 'darwin'){
14+
// Mac OS
15+
filepath = process.env.HOME + '/Library/Application Support/' + settings.coinName + '/' + settings.coinName + '.conf';
16+
} else if (process.platform == 'linux'){
17+
// Linux
18+
filepath = process.env.HOME + '/.' + settings.coinName.toLowerCase() + '/' + settings.coinName.toLowerCase() + '.conf';
19+
} else {
20+
// Windows
21+
filepath = process.env.APPDATA + '/' + settings.coinName + '/' + settings.coinName + '.conf';
22+
}
23+
if (fs.existsSync(filepath) === false){
24+
console.log("ERROR: " + filepath + " does not exists. Exiting.");
25+
process.exit(3);
26+
}
2327
}
2428

2529
conf_data = fs.readFileSync(filepath, 'utf8', function (err) {

lib/commands.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var commands = module.exports.commands = [
2525
'getMemoryPool',
2626
'getMiningInfo',
2727
'getNewAddress',
28+
'getPeerInfo',
2829
'getRawTransaction',
2930
'getReceivedByAccount',
3031
'getReceivedByAddress',

0 commit comments

Comments
 (0)