Ethereum network in docker container for local development

Posted by VSGic Site on Thursday, January 2, 2025

Hello, there!

I have created docker container for local development with only hardhat network on it for Ethereum smartcontract development. All you need it to download repo: https://github.com/VSGic/hardhat-network

Then:

docker compose build
docker compose up -d

Check that container is online:

curl -X POST -H "Content-Type: application/json" --data '{
  "jsonrpc":"2.0",
  "method":"eth_blockNumber",
  "params":[],
  "id":1
}' http://localhost:8545

If all good, you will get the answer:

{"jsonrpc":"2.0","id":1,"result":"0x1"}

Good lack in development!