Chain-Data Query
Learn how to connect to Filecoin RPC nodes and query Filecoin chain state and data.
Connecting to Filecoin networks via public RPC nodes
Ingredients
Instructions
import { ethers } from "ethers"
//The public Filecoin calibration URL
const filecoin_url = 'https://api.calibration.node.glif.io/rpc/v1'
const provider = new ethers.JsonRpcProvider(filecoin_url)
const blockNumber = await provider.getBlockNumber()
console.log("Block height: ", blockNumber)
Listen to smart contract events
Ingredients
Instructions
Filter smart contract events
Ingredients
Instructions
Last updated