> ## 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.

# Filecoin tooling

> Set up MetaMask and development tools to interact with Filecoin through Chainstack nodes. Filecoin support has been deprecated on the platform.

<Warning>
  ### No Filecoin support

  Chainstack deprecated support for Filecoin nodes. This page here is for legacy and in case you may find it useful.
</Warning>

## MetaMask

You can set your [MetaMask](https://metamask.io/) to interact through your Filecoin nodes.

1. Open your MetaMask and click the network selector.
2. In the network selector, click **Custom RPC**.
3. In the **New RPC URL** field, enter the node endpoint.
4. In the **Chain ID** field, enter the ID of the network:
   * Calibration Testnet: `314159`
5. Click **Save**.

## Remix IDE

To make Remix IDE interact with the network through a Filecoin node:

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

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

## web3.js

Build DApps using [web3.js](https://github.com/web3/web3.js) and Filecoin nodes.

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

### HTTP

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

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

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

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

where FILECOIN\_ENDPOINT is your node HTTPS endpoint.

### WebSocket

Use the `WebsocketProvider` object to connect to your node WSS endpoint and get the latest block number:

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

  const web3 = new Web3(new Web3.providers.WebsocketProvider('FILECOIN_ENDPOINT'));

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

where FILECOIN\_ENDPOINT is your node WSS endpoint protected either with the key or password.

## web3.py

Build DApps using [web3.py](https://github.com/ethereum/web3.py) and Filecoin nodes.

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).

### HTTP

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

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

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

  ```python 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

* FILECOIN\_ENDPOINT — your node HTTPS endpoint
* HOSTNAME — your node HTTPS endpoint hostname

### WebSocket

Use the `WebsocketProvider` object to connect to your node WSS endpoint and get the latest block number.

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

  web3 = Web3(Web3.WebsocketProvider('FILECOIN_ENDPOINT'))
  print(web3.eth.block_number)
  ```

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

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

where

* FILECOIN\_ENDPOINT — your node WSS endpoint
* HOSTNAME — your node WSS endpoint hostname

See also [WebSocket connection to an EVM node](https://support.chainstack.com/hc/en-us/articles/900001918763-WebSocket-connection-to-an-Ethereum-node).

## ethers.js

Build DApps using [ethers.js](https://github.com/ethers-io/ethers.js/) and Filecoin nodes.

1. Install [ethers.js](https://www.npmjs.com/package/ethers).
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).

### HTTP

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

<CodeGroup>
  ```javascript Key Protected theme={"system"}
  const { ethers } = require("ethers");

  var urlInfo = {
      url: 'FILECOIN_ENDPOINT'
  };
  var provider = new ethers.providers.JsonRpcProvider(urlInfo, NETWORK_ID);

  provider.getBlockNumber().then(console.log);
  ```

  ```javascript Password Protected theme={"system"}
  const { ethers } = require("ethers");

  var urlInfo = {
      url: 'YOUR_CHAINSTACK_ENDPOINT',
      user: 'USERNAME',
      password: 'PASSWORD'
  };
  var provider = new ethers.providers.JsonRpcProvider(urlInfo, NETWORK_ID);

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

where

* FILECOIN\_ENDPOINT — your node HTTPS endpoint
* NETWORK\_ID — Filecoin network ID:
  * Calibration Testnet: `314159`

### WebSocket

Use the `WebSocketProvider` object to connect to your node WSS endpoint and get the latest block number:

<CodeGroup>
  ```javascript Javascript theme={"system"}
  const { ethers } = require("ethers");

  const provider = new ethers.providers.WebSocketProvider('FILECOIN_ENDPOINT', NETWORK_ID);

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

where

* FILECOIN\_ENDPOINT — your node WSS endpoint
* NETWORK\_ID — Filecoin network ID:
  * Calibration Testnet: `314159`
