> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/docs/polygon-zkevm-tooling",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Polygon zkEVM tooling

> Complete Polygon zkEVM tooling guide for Chainstack nodes. Use MetaMask, Hardhat, web3.js, ethers.js, Brownie, Remix IDE, and more for zkEVM development.

<Warning>
  ### Current API limitations

  Polygon zkEVM currently supports most of the wide-known JSON-RPC methods.

  * See [zkEVM methods](/reference/zkevm-rpc-methods) to try out the exclusive `zkevm_*` namespace methods.

  * See [Polygon zkEVM documentation](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/docs/json-rpc-endpoints.md) for the full list of supported methods.
</Warning>

## Interaction tools

### MetaMask

On [node access details](/docs/manage-your-node#view-node-access-and-credentials), click **Connect wallet**.

## Development tools

### Hardhat

Configure [Hardhat](https://hardhat.org/) to deploy contracts and interact through your Polygon zkEVM nodes.

1. Install [Hardhat](https://hardhat.org/) and create a project.

2. Install the [dotenv](https://www.npmjs.com/package/dotenv) package to securely load your sensitive variables from a `.env` file

3. Create a new environment in `hardhat.config.js`:

   ```js theme={"system"}
   require("@nomicfoundation/hardhat-toolbox");
   require('dotenv').config();

   module.exports = {
     solidity: "0.8.18",
     defaultNetwork: "zkEVM_testnet",
     networks: {
       zkEVM_testnet: {
           url: `${process.env.YOUR_CHAINSTACK_ENDPOINT}`,
           accounts: [process.env.YOUR_PRIVATE_KEY]
       },
   },
   };
   ```

### web3.js

Build DApps using [web3.js](https://github.com/ethereum/web3.js/) and Polygon zkEVM nodes deployed with Chainstack.

1. Install [web3.js](https://web3js.readthedocs.io/).
2. Connect over HTTP or WebSocket.

#### HTTPS

Use the `HttpProvider` object to connect to your node HTTPS endpoint and get the latest block number:

<CodeGroup>
  ```js JavaScript theme={"system"}
  const Web3 = require('web3');

  const web3 = new Web3(new Web3.providers.HttpProvider('YOUR_CHAINSTACK_ENDPOINT'));

  web3.eth.getBlockNumber().then(console.log);
  ```
</CodeGroup>

where YOUR\_CHAINSTACK\_ENDPOINT is your node HTTPS endpoint protected either with the key or password.

### web3.py

Build DApps using [web3.py](https://github.com/ethereum/web3.py) and Polygon zkEVM nodes deployed with Chainstack.

1. Install [web3.py](https://web3py.readthedocs.io/).
2. Connect over HTTP or WebSocket. See also [EVM node connection: HTTP vs WebSocket](https://support.chainstack.com/hc/en-us/articles/900002187586-Ethereum-node-connection-HTTP-vs-WebSocket).

#### HTTPS

Use `HTTPProvider` to connect to your node endpoint and get the latest block number.

<CodeGroup>
  ```py Key Protected theme={"system"}
  from web3 import Web3

  web3 = Web3(Web3.HTTPProvider('YOUR_CHAINSTACK_ENDPOINT'))
  print(web3.eth.block_number)
  ```

  ```py Password Protected theme={"system"}
  from web3 import Web3

  web3 = Web3(Web3.HTTPProvider('https://%s:%s@%s'% ("USERNAME", "PASSWORD", "HOSTNAME")))
  print(web3.eth.block_number)
  ```
</CodeGroup>

where

* YOUR\_CHAINSTACK\_ENDPOINT — your node HTTPS endpoint protected either with the key or password
* HOSTNAME — your node HTTPS endpoint hostname
* USERNAME — your node access username (for password-protected endpoints)
* PASSWORD — your node access password (for password-protected endpoints)

### node.js

You can build a web app to query data using node.js and [axios](https://www.npmjs.com/package/axios):

<CodeGroup>
  ```js JavaScript theme={"system"}
  const axios = require("axios");

  const payload = {
      jsonrpc: "2.0",
      id: 0,
      method: "eth_blockNumber",
      params: []

  };

  (async () => {
      const response = await axios.post(`YOUR_CHAINSTACK_ENDPOINT`, payload)
      console.log(response.data)
  })();
  ```
</CodeGroup>

* YOUR\_CHAINSTACK\_ENDPOINT — your Chainstack node endpoint protected either with the key or password. See node access details.
* `query` — your JSON-RPC query. In this case, to get the latest block number.

### ethers.js

Build DApps using [ethers.js](https://github.com/ethers-io/ethers.js/) and Polygon zkEVM nodes deployed with Chainstack.

1. Install [ethers.js](https://www.npmjs.com/package/ethers).
2. Connect over HTTPS or WebSocket. See also [EVM node connection: HTTP vs WebSocket](https://support.chainstack.com/hc/en-us/articles/900002187586-Ethereum-node-connection-HTTP-vs-WebSocket).

#### HTTPS

Use the `JsonRpcProvider` object to connect to your node endpoint and get the balance of any address:

<CodeGroup>
  ```js JavaScript theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT ";
  const provider = new ethers.JsonRpcProvider(NODE_URL, NETWORK_ID);
  const eth_getBalance = async () => {
      const balance = await provider.getBalance("0x439356Ad40D2f2961c99FFED4453f482AEC453Af");
      console.log(balance);
    };
  eth_getBalance()
  ```
</CodeGroup>

where

* YOUR\_CHAINSTACK\_ENDPOINT — your node HTTPS endpoint protected either with the key or password

* NETWORK\_ID — Polygon zkEVM network ID:

  * Mainnet: `1101`
  * Testnet:`1442`

### Brownie

1. Install [Brownie](https://eth-brownie.readthedocs.io/en/stable/install.html).

2. Use the `brownie networks add` command with the node endpoint:

   ```bash theme={"system"}
   brownie networks add zkEVM ID name="NETWORK_NAME" host=YOUR_CHAINSTACK_ENDPOINT chainid=NETWORK_ID
   ```

   where

   * ID — any name that you will use as the network tag to run a deployment. For example, `chainstack-testnet`.
   * NETWORK\_NAME — any name that you want to identify the network by in the list of networks. For example, `zkEVM`.
   * YOUR\_CHAINSTACK\_ENDPOINT — your node HTTPS or WSS endpoint protected either with the key or password
   * NETWORK\_ID — Polygon zkEVM network ID:
     * Mainnet: `1101`
     * Testnet: `1442`

Example to run the deployment script:

<CodeGroup>
  ```bash Shell theme={"system"}
  brownie run deploy.py --network chainstack-testnet
  ```
</CodeGroup>

### Remix IDE

To make Remix IDE interact with the network through a zkEVM node deployed with Chainstack:

1. Get [MetaMask](https://metamask.io/) and set it to interact through a Chainstack node. See [Interacting through MetaMask](#metamask).
2. In Remix IDE, navigate to the **Deploy** tab. Select **Injected Provider - MetaMask** in **Environment**.

This will engage MetaMask and make Remix IDE interact with the network through a Chainstack node.
