This repository contains a template that you can use to develop smart contracts on Solidity. It configured to use it with Docker.
- Customized hardhat config
- Handy compilied dir (/build) with deployments, abis, artifacts and typechain
- MyEtherWallet as an interface to interact with smart contract which deployed in local hardhat node
- Hardhat shorthand for using short command (hh)
Two docker containers:
- Hardhat environment with running local node
- Web server with MyEtherWallet as an interface which help us to interact with smart contract
Make sure you have install Docker
- Git clone this repository
- Make a copy of .env.example named .env
- Run docker-compose up command
docker-compose up -d
Hardhat node running on localhost:8545
Show list currently running docker containers
docker ps
Find a hardhat container and copy container id
Enter the hardhat container
docker exec -it <container-id> bash
Inside the container you can use all hardhat CLI commands
hh test
hh compile
hh run --network localhost scripts/Greeter.ts
MyEtherWaller running on localhost:8000
It can use as an interface for interact with smart contract which deployed in local hardhat node
Step 1. You need one of the accounts from hardhat
Use one of this default accounts which show in hardhat console
Or you can use your own accounts from mnemonic (from MetaMask for example)
Add your mnemonic in the .env file
Uncomment these lines in the hardhat.config.ts file and restart container
Step 2. Go to localhost:8000 and access your wallet
Use for this private key from hardhat accounts or connect to MyEtherWallet with MetaMask browser extension
Step 3. Сhange network to localhost
Step 4. Congrats, you connect to local hardhat node!
Now you can use it for interact with smart contract which deployed in local hardhat node
And one more thing
If you use MetaMask extension you have also need to change localhost network settings