Giter Club home page Giter Club logo

faucy's People

Contributors

alavarello avatar lndgalante avatar ragonzal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

faucy's Issues

Create bot to market Faucy

Bot de Twitter que detecte los hashtags #Rinkeby por ej y le contestemos con algo así:
“Hi [TWITTER_HANDLE] :hola: We’re developing Faucy to get ethers from any testnet easily! You can reach us through @wearexivis or telegram. https://faucy.dev”

Add status service

app.get('/healthcheck', (req, res) => {
  res.status(200).json({
    statusCode: 200,
    body: { message: 'The service is running.' },
  });
});

PLEASE HELP

i need georli test PLEASE HELP
0x5A8Dc9347252Cd63f3f0d97120ecdAD9302d7925

Implement GunDB

  • Save each request on frontend, and send id in the body
  • Display the latest ongoing request
  • Update request on the server when the operation it's finished
  • Allow only one operation per network at a time
  • Save successful operations to display stats afterwards
  • Save ethers automatically into an account then request from a SC

Add health check endpoint

Now we have only one endpoint for /health router

app.js

app.use('/health', healthRouter);

modules/health/router.js

healthRouter.get('/check', (req, res) => {
  res.status(200).json({ statusCode: 200, body: { message: 'The service is running' } });
});

Inside this last router we will need to add an new .get method per each Faucet checking if it's UP or not.

As an example:

// Utils
const { wretch } = require('../../utils/fetch');

// Constants - Environment variables
const { RINKEBY_FAUCET_URL } = process.env;

healthRouter.get('/health/rinkeby', async (req, res) => {
  try {
  await wretch(RINKEBY_URL).get();
  res.status(200).json({ statusCode: 200, body: { message: 'Rinkeby is running' } });
  } catch (error) {
  res.status(503).json({ statusCode: 503, body: { message: 'Rinkeby is down' } });
  }
});

---

On the frontend side, we need to trigger a call to each of one of these new endpoints.



Util example were it checks if all services are up or down regarding the status code you will receive all the info.
```javascript

export const checkAllServices = async () => {
  const services = ['kovan', 'rinkeby', 'goerli', 'ropsten'];

  const promises = services.map(async (service) => {
    const status = await faucyApi.url(`/health/${service}`).get().json();
    return status;
  });

  const results = Promise.allSettled(promises);
  return results;
};

Read: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled

In did mount of the form we will need to run this util and afterwards set it on some React state therefore we can use it on the UI.

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.