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.
A live version of this demo app can be found at cf-web3.pages.dev.
- Clone the repo with
git clone email@example.com:cloudflare/cfweb3.git
- npm install in
cd cfweb3/contract npm install cd ../frontend npm install
- Install Metamask, switch to the testnet and add funds (instructions below)
- Click on Metamask and then on the hamburger icon in the top right
- Click on "Account details"
- Click on "Export Private Key"
- Enter Metamask password
- Copy your private key
- In one terminal window, move into the
contractdirectory and run:
dapk="YOUR_PRIVATE_KEY" npx hardhat node
- In a different terminal window, move into the
frontenddirectory and run:
npm run dev
Adding funds to your Metamask test account
- Install Metamask
- Switch Metamask to the Rinkeby test network
Copy your Rinkeby account wallet address.
Go to the Rinkeby faucet
Post a Tweet or a Facebook status with your Rinkeby wallet address.
Enter the URL of your Tweet or Facebook post on the faucet website.
Claim the amount you want.
Delete the social media post (optional).