hardhat-change-network
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

hardhat-change-network

Allows changing the current network in Hardhat.

Useful for multi-chain projects, where switching between two networks in a script may be desirable.

Warning: This is a bit of a hack, some modules may break.

Installation

yarn add hardhat-change-network

Import the plugin in your hardhat.config.js:

require("hardhat-change-network");

Or if you are using TypeScript, in your hardhat.config.ts:

import "hardhat-change-network";

Usage

Change the network to any network defined in hardhat.config.js with this simple call:

hre.changeNetwork('goerli');

You can also use this library to retrieve a standard web3 provider object for a given network:

const provider = hre.getProvider('goerli');

Package Sidebar

Install

npm i hardhat-change-network

Weekly Downloads

417

Version

0.0.7

License

MIT

Unpacked Size

9.69 kB

Total Files

17

Last publish

Collaborators

  • dmihal