Skip to content

PatrickAlphaC/html-fund-me-fcc

Repository files navigation

html-fund-me-fcc

This is a minimalistic example what you can find in the metamask docs.

Requirements

  • git
    • You'll know you've installed it right if you can run:
      • git --version
  • Nodejs
    • You'll know you've installed nodejs right if you can run:
      • node --version And get an ouput like: vx.x.x
  • Yarn instead of npm
    • You'll know you've installed yarn right if you can run:
      • yarn --version And get an output like: x.x.x
      • You might need to install it with npm
  • Metamask
    • This is a browser extension that lets you interact with the blockchain.

Quickstart

  1. Clone the repo, install dependencies, and create the build.
git clone https://github.com/PatrickAlphaC/html-fund-me-fcc
cd html-fund-me-fcc
yarn
yarn build
  1. Serve the file
yarn http-server

And you'll see an output like:

Available on:
  http://127.0.0.1:8080
  http://x.x.x.x:8080
Hit CTRL-C to stop the server

Copy paste the first link into your browser, and you should see a small button that says "connect".

Connect

Hit it, and you should see metamask pop up.

Execute a transaction

If you want to execute a transaction follow this:

Make sure you have the following installed:

  1. You'll need to open up a second terminal and run:
git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn hardhat node

This will deploy a sample contract and start a local hardhat blockchain.

  1. Update your constants.js with the new contract address.

In your constants.js file, update the variable contractAddress with the address of the deployed contract. You'll see it near the top of the hardhat output.

  1. Rebuild
yarn build
  1. Connect your metamask to your local hardhat blockchain.

PLEASE USE A METAMASK ACCOUNT THAT ISNT ASSOCIATED WITH ANY REAL MONEY. I usually use a few different browser profiles to separate my metamasks easily.

In the output of the above command, take one of the private key accounts and import it into your metamask.

Additionally, add your localhost with chainid 31337 to your metamask.

  1. Reserve the front end with yarn http-server, input an amount in the text box, and hit fund button after connecting

Thank you!

If you appreciated this, feel free to follow me or donate!

ETH/Polygon/Avalanche/etc Address: 0x9680201d9c93d65a3603d2088d125e955c73BD65

Patrick Collins Twitter Patrick Collins YouTube Patrick Collins Linkedin Patrick Collins Medium

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published