Coder Social home page Coder Social logo

fork-chain's Introduction

Fork Chain

This repo is complimentary to presentation Fork, Spoon and Spaghetti by zekiblue.

If you want testnet that is forked from mainnet without going into too much detail. You can create your own testnet by simply running clicking either of the buttons to deploy on GCP or Railway

GCP

Run on Google Cloud

Google cloud will deploy testnet and give you endpoint. After selecting which project and which region, it will take couple minutes then it will give you the rpc url of your fork chain.

Railway

Deploy on Railway

After succesfull deployment. Go to Settings and scroll down Domains and Generate Domainor Add custom domain ( if you have domain already)


After that you can add your network to your metamask or your front end to interact with it.

How to add development network to metamask

Rpc url mentioned in this document will be the endpoint gcp or railway gives to you. or DNS record that you used to route your fork chain. And chain id will be 31337 if you did not change anything

Default values

Some of these values might be necessary when you add chain to your metamask

Forking on your local

Forking with hardhat on your local you have the node and npx already installed.

  • Foundry Anvil
anvil --fork-url <rpc-url> --fork-chain-id 31377 --host 0.0.0.0

More details can be found here: Foundry Book

  • Hardhat
npx hardhat node --fork <rpc-url>

More details can be found here: Hardhat docs

Costumizing your fork

If you want to costumize your fork. You can fork this repo and alter the values in the Dockerfile last line.

You can change fork chain id (--fork-chain-id <id>), or change block time (--block-time <seconds>) or define from which block number that your fork will be started (--fork-block-number <block-number). More details about what you can change can be found in Foundry Book

fork-chain's People

Contributors

zekiblue 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.