Skip to content
/ cfweb3 Public
forked from cloudflare/cfweb3

build Web3 app with Cloudflare’s open-source template

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT
Notifications You must be signed in to change notification settings

pr0x2b/cfweb3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFWeb3

CFWeb3 is a Web3 demo application. It uses Hardhat and Solidity to create an Ethereum smart contract. This code is a proof-of-concept showing how to build Web3 applications with Cloudflare, and should not be used as a production example.

The contract offers 2048 tokens which can be minted via the frontend Svelte application. The entire app runs on the Rinkeby test network.

Demo

A live version of this demo app can be found at cf-web3.pages.dev.

Building locally

  1. Clone the repo with git clone git@github.com:cloudflare/cfweb3.git
  2. npm install in contract and frontend with:
cd cfweb3/contract
npm install
cd ../frontend
npm install
  1. Install Metamask, switch to the testnet and add funds (instructions below)
  2. Click on Metamask and then on the hamburger icon in the top right
  3. Click on "Account details"
  4. Click on "Export Private Key"
  5. Enter Metamask password
  6. Copy your private key
  7. In one terminal window, move into the contract directory and run:
dapk="YOUR_PRIVATE_KEY" npx hardhat node
  1. In a different terminal window, move into the frontend directory and run:
npm run dev

Adding funds to your Metamask test account

  1. Install Metamask
  2. Switch Metamask to the Rinkeby test network

Metamask switch to testnet

  1. Copy your Rinkeby account wallet address.

  2. Go to the Rinkeby faucet

  3. Post a Tweet or a Facebook status with your Rinkeby wallet address.

  4. Enter the URL of your Tweet or Facebook post on the faucet website.

  5. Claim the amount you want.

  6. Delete the social media post (optional).

About

build Web3 app with Cloudflare’s open-source template

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 46.7%
  • Svelte 26.0%
  • Solidity 12.3%
  • CSS 10.5%
  • TypeScript 3.0%
  • HTML 1.5%