0.1.2 • Published 7 months ago

@parity/hardhat-polkadot-node v0.1.2

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
7 months ago

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

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-eth-rpc.polkadot.io
\ --adapter-binary-path /path/to/adapter
🔧 Command📄 Description
--rpc-portPort on which the server should listen. Defaults to 8000. It is also where the adapter will connect to when using the binaries.
--node-binary-pathPath to the substrate node binary.
--adapter-binary-pathPath to the eth-rpc-adapter binary.
--adapter-portPort on which the adapter will listen to. Defaults to 8545.
--devWhether to run the fork in dev mode. Defaults to false.
--build-block-modeBuild block mode for chopsticks.
--forkEndpoint of the chain to fork.
--fork-block-numberBlock hash or block number from where to fork.

Happy building! 👷‍♀️👷‍♂️