This is a full front/backend implementation of a cryptocurrency faucet for Ark written in Node using the Express framework.
First and foremost, you will need a MySQL server installed. Once the database server is running, create the ArkFaucet tables by running db.sql
located inside the DataModel
directory.
Then, familiarize yourself with config.json
{
"node": "5.39.9.240",
"port": 80,
"payPerClick": 0.05,
"cooldown": 3600,
"paySchedule": "0 01 0 * * *",
"payMinimum": 1.1,
"txFee": 0.1,
"log": "tx.log",
"database": {
"username": "arkfaucet",
"password": "test"
},
"recaptcha": {
"siteKey": "",
"secretKey": ""
}
}
node
- The IP address of the Ark node the backend will use to query Ark's blockchainport
- The port the server will listen onpayPerClick
- How much Ark to credit users per use of the faucetcooldown
- How long users have to wait before using the faucet again (in seconds)paySchedule
- When the faucet automatically pays out, in cron formatpayMinimum
- The minimum balance users must accrue before they are paid outtxFee
- The transaction fee to be subtracted from users' payouts. Set to 0 if you want to pay their transaction fees.log
- Filename of log filedatabase:username
- MySQL usernamedatabase:password
- MySQL passwordrecaptcha:siteKey
- ReCaptcha site keyrecaptcha:secretKey
- ReCaptcha secret key
First, remember to prepare your MySQL database as mentioned above and insert your credentials and other settings in config.json
- Clone this repository
cd Ark-Faucet
npm install
node server --pass "Your Faucet Passphrase"
If applicable, you can also put in your second passphrase: node server --pass "Your Faucet Passphrase" --secPass "Your Faucet Multisig"
Note: You will need to run as root if you want the web server to listen on port 80
This project includes a reference UI that's served automatically in the frontend
directory. You can test it out by going to http://localhost
or http://localhost:PORT
- Eugene Li - eugeneli
See also the list of contributors who participated in this project.
The MIT License (MIT)
Copyright (c) 2017 Eugene Li
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.