Sign inSign up

fuming/hardhat-node

By fuming

•Updated over 1 year ago

Image
0

1.8K

fuming/hardhat-node repository overview

⁠fuming/hardhat-node

A Hardhat node instance.

⁠Usage

Run a container:

docker run -it -d --name hardhat-node-instance -p 8545:8545 fuming/hardhat-node:latest

Forking other networks⁠

docker run -it -d --name hardhat-node-instance -p 8545:8545 fuming/hardhat-node:latest --fork https://mainnet.infura.io/v3/<key>

Hardhat Network Docs⁠

Docker Compose:

version: '3'

services:
  hardhat-node:
    image: fuming/hardhat-node:latest
    container_name: hardhat-node-instance
    ports:
      - "8545:8545"

⁠Dockerfile

FROM node:lts-alpine3.22
WORKDIR /root/hardhat-node
RUN npm install --save-dev [email protected]
RUN echo "/** @type import('hardhat/config').HardhatUserConfig */" > hardhat.config.js \
    && echo "module.exports = {" >> hardhat.config.js \
    && echo "  networks: {" >> hardhat.config.js \
    && echo "    hardhat: {" >> hardhat.config.js \
    && echo "      allowBlocksWithSameTimestamp: true" >> hardhat.config.js \
    && echo "    }" >> hardhat.config.js \
    && echo "  }" >> hardhat.config.js \
    && echo "};" >> hardhat.config.js
EXPOSE 8545
ENTRYPOINT ["npx", "hardhat", "node", "--hostname", "0.0.0.0", "--port", "8545"]

Tag summary

Content type

Image

Digest

sha256:6d535975b…

Size

189.4 MB

Last updated

over 1 year ago

docker pull fuming/hardhat-node