forked from ethereum/ethereum-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ build/Release | |
node_modules | ||
|
||
# Certificates | ||
certs/* | ||
keys/* | ||
|
||
# Users Environment Variables | ||
.lock-wscript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,43 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var debug = require('debug')('frontier.ethereum.org'); | ||
var ssl_options = require('../config/config').ssl_options; | ||
var http = require('http'); | ||
var https = require('https'); | ||
var app = require('../app'); | ||
var fs = require('fs'); | ||
var ssl_options; | ||
|
||
function fileExists(filePath) { | ||
try { | ||
fs.statSync(filePath); | ||
} catch(err) { | ||
if(err.code == 'ENOENT') return false; | ||
} | ||
return true; | ||
}; | ||
|
||
if(fileExists('./keys/cert.key')) { | ||
ssl_options = { | ||
key: fs.readFileSync('./keys/cert.key'), | ||
cert: fs.readFileSync('./keys/cert.crt'), | ||
requestCert: false | ||
}; | ||
} | ||
|
||
app.set('port', process.env.PORT || 3000); | ||
app.set('httpsPort', process.env.SSL_PORT || 3443); | ||
|
||
var server = http.createServer(app); | ||
server.listen(app.get('port'), function() { | ||
debug('Express server listening on port ' + server.address().port); | ||
}); | ||
|
||
var server = app.listen(app.get('port'), function() { | ||
debug('Express server listening on port ' + server.address().port); | ||
}); | ||
if(ssl_options.key !== undefined) { | ||
var secureServer = https.createServer(ssl_options, app); | ||
secureServer.listen(app.get('httpsPort'), function() { | ||
debug('Express secure server listening on port ' + secureServer.address().port); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
var approvedBlock = { | ||
var fs = require('fs'); | ||
|
||
module.exports = { | ||
number: 146118, | ||
hash: "dea5342d507a30c49e6298b10d44dc5e047a27260a284dc78f6c96781c6f6e58", | ||
timestamp: Math.floor(Date.now()/1000) | ||
}; | ||
|
||
module.exports = approvedBlock; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters