Coder Social home page Coder Social logo

faucet-project's Introduction

Ethereum Faucet Project

Overview

This project is a part of the curriculum for the "FromWeb2toWeb3 Blockchain Eng. Master" course offered by CodeCrypto Academy.

This repository contains instructions and code for setting up a faucet for a private Ethereum network. The faucet allows users to request and receive Ether (ETH) for testing and development purposes.

App Architecture

The architecture of the app is given by codecrypto.academy, see the scheme below:

App Architecture, source: cedecrypto.academy

*Node Express is exposed on port 3000

Prerequisites

Before you begin, ensure you have the following prerequisites installed:

  1. Docker: Install Docker to set up a local Ethereum node with the desired network configuration.
  2. Metamask: Ensure you have Metamask installed in your browser and configure it to connect to the Ethereum private network.

Steps

1. Faucet Node

Run Docker Desktop

Open your Metamask

Set YOUR wallet direction in nodo/genesis.json and Save It

ethereum/client-go version 1.11.5

In terminal:

cd faucet-node/node

docker run --rm -it -v ${PWD}/data/keystore:/data ethereum/client-go:v1.11.5 account new --keystore /data
// Set password: 1234 (if you prefer another, remember change it also in Back module)

docker run -d -p 8545:8545 -p:30303:30303 -v ${PWD}/data:/data -v ${PWD}/genesis.json:/genesis.json --name eth-node  ethereum/client-go:v1.11.5 init --datadir data /genesis.json
// Set  your metamask to see the first results and if it works

docker run -d -p 8545:8545 -p:30303:30303 -v ${PWD}/data:/data --name eth-node-8888  ethereum/client-go:v1.11.5 \
--datadir data --http.api personal,admin,eth,net,web3 --http.corsdomain="*" --http --http.addr 0.0.0.0 \
--http.port 8545 --mine --miner.etherbase <<YOUR_WALLET>> --miner.threads=1

Reset web explorer and Metamask

Set the NEW wallet direction in nodo/genesis.json and Save It

The new account will be the Faucet miner

Rename the file created (UTC--... for account.json) and take the new wallet address (add an 0x where you paste it (genesis and comand))

2. Faucet Back

cd ..
cd back
yarn init -y
yarn add web3
yarn add express
yarn add cors
npx nodemon app.js
//new terminal 
// Destiny address of the funds from faucet account
curl localhost:3000/faucet/<<Your 0x Wallet Account >>

//Refresh the cache in metamask or the entire explorer to see the balance of the new account, could take a minutes
curl localhost:3000/balance/<<Your 0x Wallet Account >>

3. Faucet Front

yarn create vite faucet-front --template react
cd ..
cd faucet-front
yarn
yarn dev

faucet-project's People

Stargazers

Sergio Gonzalez avatar

Watchers

Sergio Gonzalez 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.