Git Product home page Git Product logo

hardhat-docker's Introduction

fork-docker

option 1 - manual

build images and create volume:

Build hardhat image:

docker build --no-cache -t hardhat-node . -f Dockerfile.hardhat

Build anvil image:

docker pull ghcr.io/foundry-rs/foundry:nightly
docker build --no-cache -t anvil-node . -f Dockerfile.anvil

Build proxy (for tenderly) image:

docker build --no-cache -t proxy . -f Dockerfile.proxy

Create caching volume:

docker volume create hardhat-cache

run hardhat:

docker run --rm -d \
-v hardhat-cache:/app/cache \
-p 8545:8545 \
-e RPC_URL=$DEFAULT_RPC \
--name $NAME hardhat-node

custom env:

-e HEIGHT=$HEIGHT
-e INTERVAL=$INTERVAL

option 2 - fork script

build images:

Build hardhat image:

docker build --no-cache -t hardhat-node . -f Dockerfile.hardhat

Build anvil image:

docker pull ghcr.io/foundry-rs/foundry:nightly
docker build --no-cache -t anvil-node . -f Dockerfile.anvil

Build proxy (for tenderly) image:

docker build --no-cache -t proxy . -f Dockerfile.proxy

Create caching volume:

docker volume create hardhat-cache

build block explorer:

git clone https://github.com/feshchenkod/explorer.git
cd explorer
docker build -t etherparty .

run traefic proxy:

mv example_env .env
docker-compose up -d

run fork:

run hardhat:

$ ./fork.sh -h

options:
-b     Fork from block number (Default: latest, minus safety value - 5). Should be 2675000 at least.
-h     Print this Help.
-d     Disable cache loading.
-t     Custom timeout (default: 2h).
-n     Custom container name (default: random uuid).
-i     Set mining interval in ms (default: none).

example 1: ./fork.sh -t 2d -n my-fork
fork will be removed after 2 days, access url https://DOMAIN/my-fork/

example 2: ./fork.sh -d -b 2675000 -t 30m -i 5000

run anvil:

$ ./anvil.sh -h

options:
-b     Fork from block number (Default: latest, minus safety value - 5). Should be 2675000 at least.
-h     Print this Help.
-d     Disable caching.
-t     Custom timeout (default: 2h).
-n     Custom container name (default: random uuid).
-i     Set mining interval in seconds (default: none, set 5 at least).

example 1: ./anvil.sh -t 2d -n my-fork
fork will be removed after 2 days, access url https://DOMAIN/my-fork/

example 2: ./anvil.sh -d -b 2675000 -t 30m -i 6

run tenderly:

$ ./tendedrly.sh -h

options:
-b     Fork from block number (Default: latest, minus safety value - 5).
-c     Custom chain name or id (default: mainnet or 1).
-h     Print this Help.
-t     Custom timeout (default: 2h).
-n     Custom container name (default: random uuid).

example 1: ./fork.sh -t 2d -n my-fork -c bsc
fork will be removed after 2 days, access url https://DOMAIN/my-fork/

hardhat-docker's People

Contributors

feshchenkod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.