Giter VIP home page Giter VIP logo

rbtc-faucet's Introduction

RBTC Faucet

Description

Faucet to dispense test RBTC for RSK Testnet.

This is a NextJS app that interacts with the RSK blockchain and uses a captcha service. Therefore we can identify 3 actors

  1. NextJS app
  2. RSK Blockchain

Setup -config.json variables

There are 3 differents environments, production, development and testing, each one has a specific -config.json file

  • Production: prod-config.json
  • Development: dev-config.json
  • Testing: test-config.json

Please check -config.json and fill them with right values.

{
  "RSK_NODE": "NODE_URL", 
  "API_URL": "API_FETCH_URL",
  "SOLVE_CAPTCHA_URL": "https://www.google.com/recaptcha/api/siteverify",
  "SECRET_VERIFY_CAPTCHA": "",
  "SITE_KEY_CAPTCHA": "",
  "FAUCET_ADDRESS": "ADDRESS",
  "FAUCET_PRIVATE_KEY": "PRIVATE_KEY",
  "GAS_PRICE": 60000000,
  "GAS_LIMIT": 800000,
  "VALUE_TO_DISPENSE": 0.001,
  "TAG_MANAGER_ID": "GTM-XXXXXXX"
}

In order to run a production version, please check if prod-config.json exists, if not create one with the configuration described previously.

  • RSK_NODE is the URL where the node is running.
  • API_URL where the API is hosted.
  • SOLVE_CAPTCHA_URL is for checking the solution.
  • SECRET_VERIFY_CAPTCHA secret for captcha validation.
  • SITE_KEY_CAPTCHA verification key from the client.
  • TAG_MANAGER_ID id for google service (this one shouldn't be changed).

You need to create a proyect in Google to get the site_key and captcha secret.

Running development environment

Node

This project requires node version 16

First install depenecies (use yarn)

yarn

Then run app

yarn dev

You'll need a running blockchain in order to run this environment. To do this, you can run a local ganache and point it at dev-config.json, RSK_NODE variable. Notice that you won't be able to get a real explorer link because you're running a local blockchain instead of an RSK one!

There is no need to change API_URL, VALUE_TO_DISPENSE, GAS_PRICE, GAS_LIMIT and TAG_MANAGER_ID.

Production deploy

Checkout Next.js tutorial or docs

Docker

This project has been dockerized

First build the image

docker build -t rbtc-faucet .

Then run

docker run -d --name rbtc-faucet -p 3000:3000 rbtc-faucet

Linting

You can lint the whole project with prettier, just run

yarn lint

Setup linting options at .prettierrc

rbtc-faucet's People

Contributors

alebanzas avatar dependabot[bot] avatar ezequiel-rodriguez avatar fedejinich avatar iovgomezdn avatar jonathansmirnoff avatar krlz16 avatar lucasvuotto avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbtc-faucet's Issues

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.