Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.DS_Store
node_modules/
public/assets/javascripts/application.js
public/stylesheets/application.css
public/assets/stylesheets/application.css
config.json

# IDE
.idea
.vscode
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@
### Building from source

1. Clone repository
```
git clone https://github.com/poanetwork/poa-faucet
```
2. Copy `config.json.example` to `config.json`
```
cp config.json.example config.json
```
2. Update config.json `./config.json` (see config.json with placeholders below)
3. Update `./public/index.html`: Find `<div class="g-recaptcha" data-sitekey="type your reCaptcha plugin secret here"></div>` line and type your reCaptcha plugin secret in `data-sitekey` attribute. For more info, [see](https://developers.google.com/recaptcha/docs/verify?hl=ru)
4. `npm install` from project's root
5. cd `./public`
6. `npm install`
7. `npm run sass`
8. `npm run coffee`
9. Go to project's root and run `npm start`. Sokol POA Network faucet will be launched at `http://localhost:5000`
4. Install dependencies `npm install` from the project's root
5. Run faucet with `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'",
"environment": "switcher between configurations: 'prod' or 'dev'",
"debug": "switch on/off server logs: true or false",
"Captcha": {
"secret": "type your reCaptcha plugin secret here"
"secret": "reCaptcha plugin secret"
},
"Ethereum": {
"etherToTransfer": "type amount of Ether to be sent from faucet here, for example 0.5",
"gasLimit": "type Ethereum transaction gas limit here, for example, 0x7b0c",
"live": {
"rpc": "type Ethereum RPC address here, for example http://127.0.0.1:8545",
"account": "type sender address here",
"privateKey": "type private key of sender here"
"etherToTransfer": "The number of milliEther to be sent from the faucet. For example, 500",
"gasLimit": "Transaction gas limit, for example, 21000",
"prod": {
"rpc": "JSON RPC endpoint. For example, https://core.poa.network",
"account": "The address from which the funds will be drained",
"privateKey": "Private key of the account"
},
"dev": {
...
Expand Down
4 changes: 2 additions & 2 deletions config.json → config.json.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"environment": "live",
"environment": "prod",
"debug": false,
"Captcha": {
"secret": ""
},
"Ethereum": {
"milliEtherToTransfer": 500,
"gasLimit": "21000",
"live": {
"prod": {
"rpc": "http://127.0.0.1:8545",
"account": "",
"privateKey": ""
Expand Down
108 changes: 0 additions & 108 deletions controllers/index.js

This file was deleted.

24 changes: 12 additions & 12 deletions public/gulpfile.js → gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const gulp = require('gulp');
const sass = require('gulp-sass');
const sass = require('gulp-sass')(require('sass'));
const sassGlob = require('gulp-sass-glob');
const autoprefixer = require('gulp-autoprefixer');
const uglifycss = require('gulp-uglifycss');
Expand All @@ -14,31 +14,31 @@ const uglify = require('gulp-uglify');

gulp.task('sass', function() {
return gulp.src([
'assets/stylesheets/*.scss',
'./assets/stylesheets/sweetalert2.min.css'
'./public/assets/stylesheets/*.scss',
'./public/assets/stylesheets/sweetalert2.min.css'
])
.pipe(sassGlob())
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(concatCss('application.css'))
.pipe(uglifycss())
.pipe(gulp.dest('assets/stylesheets/'));
.pipe(gulp.dest('./public/assets/stylesheets/'));
});

gulp.task('javascript', function() {
return gulp.src('assets/javascripts/application/*.js')
.pipe(addsrc('assets/javascripts/vendor/index.js'))
return gulp.src('public/assets/javascripts/application/*.js')
.pipe(addsrc('public/assets/javascripts/vendor/index.js'))
.pipe(order([
"assets/javascripts/vendor/index.js",
"assets/javascripts/application/*.js"
"public/assets/javascripts/vendor/index.js",
"public/assets/javascripts/application/*.js"
], {base: '.'}))
.pipe(include())
.pipe(concat('application.js'))
//.pipe(uglify())
.pipe(gulp.dest('assets/javascripts'));
// .pipe(uglify())
.pipe(gulp.dest('public/assets/javascripts'));
});

gulp.task('watch', function() {
gulp.watch('assets/stylesheets/**/**/*.scss', ['sass']);
gulp.watch('assets/javascripts/application/*.js', ['javascript']);
gulp.watch('./public/assets/stylesheets/**/**/*.scss', ['sass']);
gulp.watch('./public/assets/javascripts/application/*.js', ['javascript']);
});
19 changes: 0 additions & 19 deletions helpers/blockchainHelper.js

This file was deleted.

67 changes: 0 additions & 67 deletions helpers/captchaHelper.js

This file was deleted.

10 changes: 0 additions & 10 deletions helpers/configHelper.js

This file was deleted.

8 changes: 0 additions & 8 deletions helpers/debug.js

This file was deleted.

15 changes: 0 additions & 15 deletions helpers/generateResponse.js

This file was deleted.

Loading