Giter Site home page Giter Site logo

baidang201 / nodejs-faucet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sschiessl-bcp/nodejs-faucet

0.0 1.0 0.0 79 KB

The BitShares faucet is used to pay the registration fee for new users in mainnnet & testnet.

Home Page: https://bitshares.org

License: MIT License

JavaScript 96.56% HTML 2.15% CSS 0.94% Shell 0.36%

nodejs-faucet's Introduction

BitShares Faucet NodeJS

Faucet is used to pay the registration fee for new BitShares 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/technologiespro/nodejs-faucet.git
cd nodejs-faucet
npm install

Settings

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

Set

  • port - app port number default 48887 up to 65535

  • bts.node - public bitshares api node

  • bts.registrar - registrar BitShares account

  • bts.wif - registrar BitShares account private active key

  • bts.default_referrer - default referrer account name

  • bts.referrer_percent - referrer percent

  • bts.broadcastTx - default true, for testing set false

  • bts.timeoutIp - default 1800 sec (30 min) registration time on 1 ip

  • bts.allowPremium - default false, registration premium names

  • bts.allowCustomerReferer - default true, false - always use referrer from config

  • bts.sendAfterReg.asset - asset name for send to new registered user

  • bts.sendAfterReg.amount - asset amount for send to new registered user

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

Start/Stop

cd nodejs-faucet

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

Logs

forever list - get log url

tail -f /home/yourusername/.forever/T9Rc.log -

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

Vote for

witness: xbtsio-wallet

nodejs-faucet's People

Contributors

technologiespro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.