Skip to main content

Getting Filecoin RPC

Filecoin ipRPC πŸͺ™β€‹

LavaπŸŒ‹ now offers incentivized public RPC for Filecoin. Developers can get free, public endpoints for all.

Mainnet πŸŒβ€‹

Service πŸ”ŒURL πŸ”—
🟒 json-rpchttps://filecoin.lava.build

Testnet πŸ§ͺ​

Service πŸ”ŒURL πŸ”—
🟒 json-rpchttps://filecoin-testnet.lava.build


API Reference​

curl -X POST -H "Content-Type: application/json" https://g.w.lavanet.xyz:443/gateway/fvm/rpc-http/3dc655f970c930f1d3e78ee71beece18 --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Gateway​

To learn more about using the Lava Gateway visit the Getting Started guide



SDK​

Input πŸ“₯​

// Install lavaSDK with the following command:
// npm i @lavanet/lava-sdk
const { LavaSDK } = require("@lavanet/lava-sdk");

async function useFilecoinMainnet() {
const filecoinMainnet = await LavaSDK.create({
privateKey: process.env.PRIVATE_KEY, //hide your private key in an environmental variable
chainIds: "FVM",
});

const filecoinBlockResponse = await filecoinMainnet.sendRelay({
method: "eth_blockNumber",
params: [],
});

console.log(filecoinBlockResponse);
}

(async () => {
await useFilecoinMainnet();
})();

Output πŸ“€β€‹

To learn more about our SDK visit the Getting Started guide