
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
index-provider-peer-id
Advanced tools
Functionality for fetching index provider peer IDs for a minder id on the Filecoin network.
Functionality for fetching index provider peer IDs for a minder id on the Filecoin network.
The library provides a function to retrieve a miner's PeerId by querying both the Filecoin smart contract and Filecoin MinerInfo state. It returns the PeerID found in the smart contract, falling back to the PeerID found in MinerInfo state.
The function prioritizes the smart contract result. If the smart contract doesn't return a valid PeerId, it falls back to the result from FilecoinMinerInfo. If both methods fail, an error is thrown with details about the failure.
import {
getIndexProviderPeerId,
MINER_TO_PEERID_CONTRACT_ADDRESS,
MINER_TO_PEERID_CONTRACT_ABI,
} from '@filecoin-station/index-provider-peer-id'
import { ethers } from 'ethers'
// Initialize your ethers contract instance
const provider = new ethers.providers.JsonRpcProvider('https://eth.example.com')
const contract = new ethers.Contract(
MINER_TO_PEERID_CONTRACT_ADDRESS,
MINER_TO_PEERID_CONTRACT_ABI,
provider,
)
// Basic usage
const minerId = 'f0142637'
const { peerId, source } = await getIndexProviderPeerId(minerId, contract)
console.log(peerId) // e.g., '12D3KooWMsPmAA65yHAHgbxgh7CPkEctJHZMeM3rAvoW8CZKxtpG'
console.log(source) // 'smartContract' or 'minerInfo'
// Advanced usage with options
const { peerId, source } = await getIndexProviderPeerId(minerId, contract, {
maxAttempts: 3, // Number of retry attempts (default: 5)
rpcUrl: 'https://custom-filecoin-api.com', // Custom Filecoin RPC endpoint (default: 'https://api.node.glif.io/')
rpcAuth: 'your-auth-token', // Optional authorization token for RPC
signal: AbortSignal.timeout(60_000), // Optional AbortSignal for cancellation
})
minerId: A Filecoin miner actor ID (e.g., f0142637)smartContract: An ethers.js Contract instance for the Filecoin smart contractoptions: (Optional) Configuration object:
maxAttempts: Number of retry attempts for RPC calls (default: 5)rpcUrl: Filecoin RPC endpoint URL (default: 'https://api.node.glif.io/')rpcAuth: Authorization token for RPC endpoint (if required)signal: An AbortSignal object for cancelling the rpc request (Only effects the rpc call to the
Filecoin API, not the smart contract call)Returns a Promise that resolves to the miner's PeerId string (e.g.,
12D3KooWMsPmAA65yHAHgbxgh7CPkEctJHZMeM3rAvoW8CZKxtpG).
This library interacts with the MinerPeerIDMapping smart contract on the Filecoin EVM to retrieve peer ID data.
MINER_TO_PEERID_CONTRACT_ADDRESSThe Ethereum address of the deployed MinerPeerIDMapping contract.
MINER_TO_PEERID_CONTRACT_ABIThe ABI required to fetch peer ID and signature data for a given miner ID.
For more information:
Publish a new version of index-provider-peer-id to npm with the following command:
$ npm run release
FAQs
Functionality for fetching index provider peer IDs for a minder id on the Filecoin network.
We found that index-provider-peer-id demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.