@parity/hardhat-polkadot-node
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

hardhat-polkadot-node

Polkadot Hardhat plugin to run a mock in-memory node.

Compatibility

  • Not compatible with hardhat-only helpers, such as time and loadFixture from @nomicfoundation/hardhat-toolbox/network-helpers

Installation

Using npm:

$ npm install -D @parity/hardhat-polkadot-node

Using yarn:

$ yarn add -D @parity/hardhat-polkadot-node

Using pnpm:

$ pnpm add -D @parity/hardhat-polkadot-node

Configuration

Import the package in the hardhat.config.ts file:

...
import "@parity/hardhat-polkadot-node";
...

Usage

From hardhat.config

Configure a PolkaVM-compatible node and eth-rpc in hardhat.config.js according to available options.

See Examples.

From the CLI

Run a local Polkadot from a binary and initializes a JSON-RPC server.

$ npx hardhat node
\ --node-binary-path /path/to/node
\ --adapter-binary-path /path/to/adapter

Run a fork of a live Polkadot chain and initializes a JSON-RPC.

$ npx hardhat node --fork https://testnet-passet-hub.polkadot.io
\ --adapter-binary-path /path/to/adapter
🔧 Command 📄 Description
--rpc-port Port on which the server should listen. Defaults to 8000. It is also where the adapter will connect to when using the binaries.
--node-binary-path Path to the substrate node binary.
--adapter-binary-path Path to the eth-rpc-adapter binary.
--adapter-port Port on which the adapter will listen to. Defaults to 8545.
--dev Whether to run the fork in dev mode. Defaults to false.
--build-block-mode Build block mode for chopsticks.
--fork Endpoint of the chain to fork.
--fork-block-number Block hash or block number from where to fork.

Happy building! 👷‍♀️👷‍♂️

/@parity/hardhat-polkadot-node/

    Package Sidebar

    Install

    npm i @parity/hardhat-polkadot-node

    Weekly Downloads

    1,354

    Version

    0.1.4

    License

    AGPL-3.0

    Unpacked Size

    124 kB

    Total Files

    45

    Last publish

    Collaborators

    • parity-jacogr
    • jacogr
    • paritytech
    • kianenigma
    • wirednkod
    • dvdplm
    • mcornholio
    • paritytech-ci
    • nachopalparity
    • pepo
    • stefan-sopic
    • vincecorsica