Added recursive watch so web development is easier.
This commit is contained in:
parent
20ff126253
commit
631575ed7b
6
coins/galleon.json
Normal file
6
coins/galleon.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name" : "Galleon",
|
||||||
|
"symbol" : "GLN",
|
||||||
|
"algorithm" : "keccak",
|
||||||
|
"txMessages" : false
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "Helixcoin",
|
"name" : "Helixcoin",
|
||||||
"symbol" : "HXC",
|
"symbol" : "HXC",
|
||||||
"algorithm" : "keccak",
|
"algorithm" : "max",
|
||||||
"txMessages" : false
|
"txMessages" : false
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "Wecoin",
|
"name" : "Wecoin",
|
||||||
"symbol" : "WEC",
|
"symbol" : "WEC",
|
||||||
"algorithm" : "keccak",
|
"algorithm" : "max",
|
||||||
"txMessages" : false
|
"txMessages" : false
|
||||||
}
|
}
|
||||||
@ -1,28 +1,3 @@
|
|||||||
/* TODO
|
|
||||||
|
|
||||||
|
|
||||||
Need to condense the entire website into a single html page. Embedding the javascript and css is easy. For images,
|
|
||||||
hopefully we can only use svg which can be embedded - otherwise we can convert the image into a data-url that can
|
|
||||||
be embedded, Favicon can also be a data-url which some javascript kungfu can display in browser. I'm focusing on
|
|
||||||
this mainly to help mitigate ddos and other kinds of attacks - and to just have a badass blazing fast project.
|
|
||||||
|
|
||||||
Don't worry about doing any of that condensing yourself - go head and keep all the resources as separate files.
|
|
||||||
I will write a script for when the server starts to read all the files in the /website folder and minify and condense
|
|
||||||
it all together into one file, saved in memory. We will have 1 persistent condensed file that servers as our "template"
|
|
||||||
file that contains things like:
|
|
||||||
<div>Hashrate: {{=stats.hashrate}</div>
|
|
||||||
|
|
||||||
And then on some caching interval (maybe 5 seconds?) we will apply the template engine to generate the real html page
|
|
||||||
that we serve and hold in in memory - this is the file we serve to seo-bots (googlebot) and users when they first load
|
|
||||||
the page.
|
|
||||||
|
|
||||||
Once the user loads the page we will have server-side event source connected to the portal api where it receives
|
|
||||||
updated stats on some interval (probably 5 seconds like template cache updater) and applies the changes to the already
|
|
||||||
displayed page.
|
|
||||||
|
|
||||||
We will use fs.watch to detect changes to anything in the /website folder and update our stuff in memory.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
@ -31,6 +6,8 @@ var async = require('async');
|
|||||||
var dot = require('dot');
|
var dot = require('dot');
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
|
|
||||||
|
var watch = require('node-watch');
|
||||||
|
|
||||||
var api = require('./api.js');
|
var api = require('./api.js');
|
||||||
|
|
||||||
|
|
||||||
@ -101,8 +78,9 @@ module.exports = function(logger){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
fs.watch('website', function(event, filename){
|
watch('website', function(filename){
|
||||||
if (event === 'change' && filename in pageFiles)
|
//if (event === 'change' && filename in pageFiles)
|
||||||
|
//READ ALL THE FILEZ BLAHHH
|
||||||
readPageFiles();
|
readPageFiles();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -40,7 +40,8 @@
|
|||||||
"async": "*",
|
"async": "*",
|
||||||
"express": "*",
|
"express": "*",
|
||||||
"dot": "*",
|
"dot": "*",
|
||||||
"colors": "*"
|
"colors": "*",
|
||||||
|
"node-watch": "*"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10"
|
"node": ">=0.10"
|
||||||
|
|||||||
33
pool_configs/galleon_example.json
Normal file
33
pool_configs/galleon_example.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"disabled": false,
|
||||||
|
"coin": "galleon.json",
|
||||||
|
|
||||||
|
"address": "GRAiuGCWLrL8Psdr6pkhLpxrQGHdYfrSEz",
|
||||||
|
"blockRefreshInterval": 1000,
|
||||||
|
"txRefreshInterval": 20000,
|
||||||
|
"connectionTimeout": 600,
|
||||||
|
|
||||||
|
|
||||||
|
"ports": {
|
||||||
|
"3537": {
|
||||||
|
"diff": 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"daemons": [
|
||||||
|
{
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 19632,
|
||||||
|
"user": "testuser",
|
||||||
|
"password": "testpass"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"p2p": {
|
||||||
|
"enabled": false,
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 19333,
|
||||||
|
"protocolVersion": 70002,
|
||||||
|
"magic": "fcc1b7dc"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"disabled": false,
|
"disabled": true,
|
||||||
"coin": "helixcoin.json",
|
"coin": "helixcoin.json",
|
||||||
|
|
||||||
"address": "H9xyrh45LzLX4uXCP6jG6ZGrWho8srUgiG",
|
"address": "H9xyrh45LzLX4uXCP6jG6ZGrWho8srUgiG",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"disabled": true,
|
"disabled": false,
|
||||||
"coin": "litecoin.json",
|
"coin": "litecoin.json",
|
||||||
|
|
||||||
"shareProcessing": {
|
"shareProcessing": {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
|
|
||||||
To get started....
|
To get started simply....
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user