Skip to content

The faucetjs is used to pay the registration fee for new users

License

Notifications You must be signed in to change notification settings

Onest-io/faucetjs

Repository files navigation

Faucet Onest

Faucet Onest is used to pay the registration fee for new Onest users. In order to ensure Anonymity of the user's IP, his IP-address is hashed.

NodeJS Setup (if necessary)

sudo apt-get install build-essential g++ python git curl ntp htop nmon iftop nano -y
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh 2>/dev/null | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm install 10.21.0 >>install.log
nvm use 10.21.0 >>install.log
nvm alias default 10.21.0
npm install -g npm forever grunt-cli

Install App

git clone https://github.com/Onest-io/faucetjs.git
cd faucetjs
npm install

Settings

mv sample.config.json config.json
nano config.json

Set

  • port - app port number default 48887 up to 65535
  • ons.node - public bitshares api node
  • ons.registrar - registrar account
  • ons.wif - registrar account private active key
  • ons.default_referrer - default referrer account name
  • ons.referrer_percent - referrer percent
  • ons.broadcastTx - default true, for testing set false
  • ons.timeoutIp - default 1800 sec (30 min) registration time on 1 ip
  • ons.allowPremium - default false, registration premium names
  • ons.allowCustomerReferer - default true, false - always use referrer from config

save and exit from nano editor: CTRL+O, CTRL+X

Start/Stop

npm start for testing

forever start bin/www for background running

forever stop bin/www for stopping

default on http://localhost:48887, for use domain setup nginx

Nginx Setup

sudo apt install nginx

cd /etc/nginx/sites-available

sudo nano faucet

  • insert config
server {
        listen 80;
        listen 443 ssl;
        server_name faucet.yoursite.com;
        location / {
        proxy_pass http://localhost:48887;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
       }
}

API

  • GET /api/v1/ip - test get ip address
  • GET /api/v1/latest - latest registrations
  • GET /api/v1/counter - count registrations
  • GET /api/v1/registrations - list registrations
  • POST /api/v1/accounts - register new account

About

The faucetjs is used to pay the registration fee for new users

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages