Skip to content

Latest commit

 

History

History

docker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

🏄‍♂️ Using Docker

Prerequisites:

  • Docker
  • Git
  • Bash Shell: available in macOS by default and the vast majority of Linux distros

Note: If you are using a Windows environment, you can use Windows Subsystem for Linux (WSL) or a Bash emulator like "Git BASH" (which its included in Git for Windows). If you use WSL take into account that you should configure Docker to use the WSL 2 backend.

clone/fork 🏗 scaffold-eth:

git clone https://github.com/scaffold-eth/scaffold-eth.git

[basic] run the script that sets the stack up and that's it (takes some minutes to finish):

cd scaffold-eth
./docker/setup.sh start

[basic] to re-deploy your contracts (container must be up and running):

./docker/setup.sh deploy

[advanced] running front-end on a different port (eg. 8080):

DOCKER_IMAGE=$(docker ps --filter name=SCAFFOLD_ETH -q)
[ -z "$DOCKER_IMAGE" ] || docker rm -f SCAFFOLD_ETH

docker run \
  --name SCAFFOLD_ETH \
  -v `pwd`:/opt/scaffold-eth \
  -w /opt/scaffold-eth \
  -e PORT=8080 \
  -p 8080:8080 \
  -p 8545:8545 \
  -dt node:16

./docker/setup.sh start

[advanced] running the container in interactive mode (must run each tool manually):

DOCKER_IMAGE=$(docker ps --filter name=SCAFFOLD_ETH -q)
[ -z "$DOCKER_IMAGE" ] || docker rm -f SCAFFOLD_ETH

docker run \
  --name SCAFFOLD_ETH \
  -v `pwd`:/opt/scaffold-eth \
  -w /opt/scaffold-eth \
  -p 3000:3000 \
  -p 8545:8545 \
  --entrypoint /bin/bash \
  -ti node:16

🔏 Edit your smart contract YourContract.sol in packages/hardhat/contracts

📝 Edit your frontend App.jsx in packages/react-app/src

💼 Edit your deployment scripts in packages/hardhat/deploy

📱 Open http://localhost:3000 to see the app