cd client
npm create vite@latest
npm install
Flow these instructions
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
npm install react-icons ethers
cd ../contract
npm init -y
npm install --save-dev hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
npx hardhat
npx hardhat test
create account on MetaMask, which is a browser extension
- Get a wallet address
- Go
Settings
-advanced
and openShow test networks
- Select
Ropsten
, and copy the address - Search "Ropsten faucet" on Google
- Paste the address, and click
Give me Ropsten ETH!
- Wait for minutes, and see the balance on MetaMask
- Create a new account on Alchemy
- Create your app --
Solidity Demo
on Alchemy, and choseRopsten
as network - Click
VIEW KEY
, and copy theHTTP
key - Paste the
HTTP
key intohardhat.config.js
The account in hardhat.config.js
is from MetaMask private key
And then We need to run npx hardhat run scripts/deploy.js --network ropsten
to deploy the contract.
Here is the output
Downloading compiler 0.8.13
Compiled 1 Solidity file successfully
Transactions deployed to: 0xd450CC5a996Bb6023C971E3b7fb203184Fa1c1F8
And you can check your balance in MetaMask, it may subtract the gas fee.
import abi from './Transactions.json'
export const contractABI = abi.abi
export const contractAddress = '0xd450CC5a996Bb6023C971E3b7fb203184Fa1c1F8';
cd client
npm run build
copy dist
to your host server