Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nomiclabs/hardhat-ganache

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomiclabs/hardhat-ganache

Hardhat plugin for managing Ganache

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

npm hardhat

hardhat-ganache

This Hardhat plugin automatically starts and stops Ganache when running tests or scripts.

What

This plugin creates a network named ganache. When this network is used, a Ganache server will be automatically started before running tests and scripts, and stopped when finished.

Installation

npm install --save-dev @nomiclabs/hardhat-ganache

And add the following statement to your hardhat.config.js:

require("@nomiclabs/hardhat-ganache");

Or, if you are using TypeScript, add this to your hardhat.config.ts:

import "@nomiclabs/hardhat-ganache";

Tasks

This plugin hooks into the test and run tasks to wrap them in the instantiation and termination of a ganache-core instance. This plugin creates no additional tasks.

Environment extensions

This plugin doesn't extend the Hardhat Runtime Environment.

Usage

There are no additional steps you need to take for this plugin to work.

Configuration

You can set any of the Ganache's options through the ganache network config. All of them are supported, with the exception of accounts.

This example sets a larger block gas limit and the default balance of Ganache's accounts.

module.exports = {
  defaultNetwork: "ganache",
  networks: {
    ganache: {
      gasLimit: 6000000000,
      defaultBalanceEther: 10,
    },
  },
};

Note: The accounts option is not currently supported.

Keywords

FAQs

Package last updated on 02 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc