AbhyasKanaujia / Driver-Registration-DApp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Driver Registration Project

Getting Started

1. Create an app

  1. Sign up for an account at Alchemy
  2. Go to the Alchemy dashboard
  3. Click on "Create App"
  4. Enter the app name "Driver Registration"
  5. Enter the app description "Driver Registration DApp"
  6. Choose chain "Ethereum"
  7. Choose Network "Goerli"

2. Setup MetaMask

  1. Follow this official tutorial by MetaMask on getting started with MetaMask
  2. Switch MetaMask to Goerli
  3. Copy your public address
  4. Go to Goerli FAUCET
  5. Log in with your Alchemy account
  6. Paste your public address
  7. Click "Send Me ETH"
  8. Click on MetaMask to see the balance increase in a while

3. Create the .env

  1. In the root of the project, find .env.example
  2. Duplicate this file and rename it to .env
  3. Open .env
  4. Go to the Alchemy dashboard
  5. Click on "View Key" for the Driver Registration app
  6. Copy the "HTTPS" link
  7. Replace API_URL in .env
  8. Follow this official tutorial by MetaMask on How to reveal your Secret Recovery Phrase
  9. Copy the 12-word phrase
  10. Replace MNEMONIC in .env
  11. Save .env

4. Install truffle

  1. Download and install node.js.
  2. Install truffle globally
    • On a Unix-like system use, sudo npm install -g truffle
    • On Windows, use, npm install -g truffle

Windows Execution policy

If the truffle command doesn't work on Windows, the execution policy might be set to restricted. Follow these steps to remove the restriction.

This is an extremely dangerous setting change. It might leave space for malicious scripts to run on your system. Do it at your own risk. Alternatively, use npx.

  1. Open Power Shell as administrator.
  2. Enter command Set-ExecutionPolicy -ExecutionPolicy Unrestricted
  3. Enter Y if prompted

5 Deploy contracts

  1. truffle migrate --reset --network goerli
  2. Copy the contract address
  3. Open /client/src/constants.js
  4. Replace the contract address

Sources

About


Languages

Language:JavaScript 50.3%Language:CSS 18.9%Language:Solidity 16.9%Language:HTML 13.0%Language:Shell 0.9%