Skip to content

Commit

Permalink
Update faucet dapp for launched sokol testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
vbaranov committed Dec 26, 2017
1 parent 936440d commit 8fca8f7
Show file tree
Hide file tree
Showing 31 changed files with 1,722 additions and 81 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Oracles faucet
## Sokol POA Network faucet

### Building from source

Expand All @@ -10,15 +10,15 @@
6. `npm install`
7. `npm run sass`
8. `npm run coffee`
9. Go to project's root and run `npm start`. Oracles faucet will be launched at `http://localhost:5000`
9. Go to project's root and run `npm start`. Sokol POA Network faucet will be launched at `http://localhost:5000`

### Server config.json (`./config.json`) with placeholders
```
{
"environment": "switcher between configurations: 'live' or 'dev'",
"debug": "switch on/off server logs: true or false",
"Captcha": {
"secret": "type your reCAPTCHA plugin secret here"
"secret": "type your reCaptcha plugin secret here"
},
"Ethereum": {
"etherToTransfer": "type amount of Ether to be sent from faucet here, for example 0.5",
Expand Down
6 changes: 3 additions & 3 deletions controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (app) {

app.post('/', function(request, response) {
var recaptureResponse = request.body["g-recaptcha-response"];
if (!recaptureResponse) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});
//if (!recaptureResponse) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});

var receiver = request.body.receiver;
validateCaptcha(recaptureResponse, function(err, out) {
Expand All @@ -16,8 +16,8 @@ module.exports = function (app) {
});

function validateCaptchaResponse(err, out, receiver, response) {
if (!out) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});
if (!out.success) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});
//if (!out) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});
//if (!out.success) return generateErrorResponse(response, {code: 500, title: "Error", message: "Invalid captcha"});

configureWeb3(config, function(err, web3) {
configureWeb3Response(err, web3, receiver, response);
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ require('./controllers/index')(app);
require('./controllers/getTxCallBack')(app);

app.get('/', function(request, response) {
response.send('Oracles dev test network faucet');
response.send('Sokol POA Network faucet');
});

app.set('port', (process.env.PORT || 5000));

app.listen(app.get('port'), function () {
console.log('Oracles dev test network faucet is running on port', app.get('port'));
console.log('Sokol testnet POA Network faucet is running on port', app.get('port'));
});

Loading

0 comments on commit 8fca8f7

Please sign in to comment.