Skip to content

Conversation

@beck-8
Copy link

@beck-8 beck-8 commented Dec 22, 2025

$ node dist/cli.js provider info      
Found 5 approved providers:
ID     Name                  Address                                     Location                              Service URL                            
------------------------------------------------------------------------------------------------------------------------------------------------------
2      ezpdpz-calib2         0xbCdf1bdc1a97D071a5a8EF03F1F05225b6E2a1Ba  C=GB;ST=Gloucestershire;L=Cheltenham  https://calib2.ezpdpz.net              
5      Mongo2Stor            0xB709A785c765d7d3F7d94dbA367DA6a611D7972b  C=US;ST=California;L=Chino            https://warp.lotus.dedyn.io            
4      infrafolio-calib      0xCb9e86945cA31E6C3120725BF0385CBAD684040c  C=US;ST=Texas;L=Austin                https://caliberation-pdp.infrafolio.com
11     pspsps-calibnet       0x682467D59F5679cB0BF13115d4C94550b8218CF2  C=DE;ST=Bavaria;L=Nuremberg           https://calibnet.pspsps.io             
9      ezpdpz-calib          0xa3971A7234a3379A1813d9867B531e7EeB20ae07  C=GB;ST=Gloucestershire;L=Cheltenham  https://calib.ezpdpz.net
$ node dist/cli.js provider info --all
Found 18 active providers (all):
ID     Name                  Address                                     Location                              Service URL                            
------------------------------------------------------------------------------------------------------------------------------------------------------
1      Kubuxu's dev node     0x8c8c7a9BE47ed491B33B941fBc0276BD2ec25E7e  C=FI;ST=Uusimaa;L=Helsinki            https://pdp-dev.kubuxu.com             
2      ezpdpz-calib2         0xbCdf1bdc1a97D071a5a8EF03F1F05225b6E2a1Ba  C=GB;ST=Gloucestershire;L=Cheltenham  https://calib2.ezpdpz.net              
4      infrafolio-calib      0xCb9e86945cA31E6C3120725BF0385CBAD684040c  C=US;ST=Texas;L=Austin                https://caliberation-pdp.infrafolio.com
5      Mongo2Stor            0xB709A785c765d7d3F7d94dbA367DA6a611D7972b  C=US;ST=California;L=Chino            https://warp.lotus.dedyn.io            
6      beck-calib            0x86d026029052c6582d277d9b28700Edc9670B150  C=CN;ST=Zhejiang;L=Hangzhou           https://pdp.660688.xyz:8443            
7      kernelogic-pdp-calib  0x3bD99eAe098aB0553C88Ee669042A30ec55fF6B4  C=CA;ST=British Columbia;L=Vancouver  https://pdp-calib.filweb3.com          
8      test-pdp-filstarry    0xcBde77257745728752D2D918bFEb9dF626584150  C=HK;ST=HongKong;L=HongKong           https://pdp.filstarry.com              
9      ezpdpz-calib          0xa3971A7234a3379A1813d9867B531e7EeB20ae07  C=GB;ST=Gloucestershire;L=Cheltenham  https://calib.ezpdpz.net               
10     MinerTiger            0x398841f7e26A1Ce8E5137F4Ec119A5E410A1002b  C=CN;ST=ShanXi;L=Xi An                http://pdp.soundchina.net:5520         
11     pspsps-calibnet       0x682467D59F5679cB0BF13115d4C94550b8218CF2  C=DE;ST=Bavaria;L=Nuremberg           https://calibnet.pspsps.io             
12     olupese-meje          0x93208ADe35f80FF4A7C66d7E11F18bDfFD5F1fAA  C=NG;ST=Lagos;L=Ajegunle              https://pdp.meje.dev                   
13     Axiaoming             0x6ABcF87adC44e27582a3e2bB5EDe97bcFe40043F  C=CN;ST=Hong Kong;L=Hong Kong         https://pdp.oplian.com                 
14     calib-test            0xAfdd652756bAe790559cD07a96Caee310D3C6381  C=US;ST=California;L=San Francisco    http://116.182.28.4:12310              
15     TopBlocks             0x5E9996C57E10eC48436621F038D86d4107017c87  C=US;ST=California;L=San Francisco    https://pdp.topblocks.io               
16     ruka                  0x483F1CD029EFCFE5ebe382a8D63E73b0E53c7778  C=CN;ST=Hong Kong;L=Hong Kong         https://rukapdp.drongyl.com            
17     superusey-calib       0xbd0FfC89500920349140b8e6016416cc7eD96C52  C=US;ST=Arizona;L=Chandler            https://calibnet.superusey.com         
18     PG-testnet-warpseed   0x122a5E628a698505653b4413E261EFD12DFcDC2c  C=LT;ST=Vilnius;L=Vilnius             https://pdp-testnet.pixelguardian.eu   
19     nd-calib              0x9790c7BFCfe6264f78Da6D3402566766aB6fDA5C  C=KR;ST=Seoul;L=Seoul                 https://pdp.laughstorage.com      
$ node dist/cli.js provider info 1    
Provider: Kubuxu's dev node (ID: 1)
  Address: 0x8c8c7a9BE47ed491B33B941fBc0276BD2ec25E7e
  Description: Do not rely on it at all
  PDP Service: https://pdp-dev.kubuxu.com
  Location: C=FI;ST=Uusimaa;L=Helsinki
  Min Piece Size: 1.0 MiB
  Max Piece Size: 64.0 GiB
  Storage Price: 0.0833 USDFC/TiB/Day
  Min Proving Period: 1440 epochs
$ node dist/cli.js provider ping      
Pinging 5 provider(s)...
✔ [ID:2]   ezpdpz-calib2: OK (745ms) -> https://calib2.ezpdpz.net/pdp/ping
✔ [ID:5]   Mongo2Stor: OK (989ms) -> https://warp.lotus.dedyn.io/pdp/ping
✔ [ID:4]   infrafolio-calib: OK (1143ms) -> https://caliberation-pdp.infrafolio.com/pdp/ping
✔ [ID:11]  pspsps-calibnet: OK (681ms) -> https://calibnet.pspsps.io/pdp/ping
✔ [ID:9]   ezpdpz-calib: OK (695ms) -> https://calib.ezpdpz.net/pdp/ping
$ node dist/cli.js provider ping --all          
Pinging 18 provider(s)...
✔ [ID:1]   Kubuxu's dev node: OK (1027ms) -> https://pdp-dev.kubuxu.com/pdp/ping
✔ [ID:2]   ezpdpz-calib2: OK (751ms) -> https://calib2.ezpdpz.net/pdp/ping
✔ [ID:4]   infrafolio-calib: OK (990ms) -> https://caliberation-pdp.infrafolio.com/pdp/ping
✔ [ID:5]   Mongo2Stor: OK (914ms) -> https://warp.lotus.dedyn.io/pdp/ping
✔ [ID:6]   beck-calib: OK (34ms) -> https://pdp.660688.xyz:8443/pdp/ping
✔ [ID:7]   kernelogic-pdp-calib: OK (997ms) -> https://pdp-calib.filweb3.com/pdp/ping
✔ [ID:8]   test-pdp-filstarry: OK (1245ms) -> https://pdp.filstarry.com/pdp/ping
✔ [ID:9]   ezpdpz-calib: OK (685ms) -> https://calib.ezpdpz.net/pdp/ping
✖ [ID:10]  MinerTiger: FAILED (Network Error) -> http://pdp.soundchina.net:5520
✔ [ID:11]  pspsps-calibnet: OK (705ms) -> https://calibnet.pspsps.io/pdp/ping
✔ [ID:12]  olupese-meje: OK (845ms) -> https://pdp.meje.dev/pdp/ping
✔ [ID:13]  Axiaoming: OK (296ms) -> https://pdp.oplian.com/pdp/ping
✔ [ID:14]  calib-test: OK (100ms) -> http://116.182.28.4:12310/pdp/ping
✔ [ID:15]  TopBlocks: OK (624ms) -> https://pdp.topblocks.io/pdp/ping
✔ [ID:16]  ruka: OK (312ms) -> https://rukapdp.drongyl.com/pdp/ping
✔ [ID:17]  superusey-calib: OK (1002ms) -> https://calibnet.superusey.com/pdp/ping
✔ [ID:18]  PG-testnet-warpseed: OK (726ms) -> https://pdp-testnet.pixelguardian.eu/pdp/ping
$ node dist/cli.js provider ping 1    
Pinging 1 provider(s)...
✔ [ID:1]   Kubuxu's dev node: OK (1126ms) -> https://pdp-dev.kubuxu.com/pdp/ping

@BigLep
Copy link
Member

BigLep commented Jan 28, 2026

@beck-8 : sorry this got missed. It wasn't added to the board, which is why I hadn't seen it. It has been now.

@rvagg : it would be good to get your input on whether you want to see this functionality in filecoin-pin vs. in a Synapse CLI.

@SgtPooki : I have assigned this to you, but feel free to assign to someone else or note if we shouldn't get distracted by this currently.

@BigLep BigLep added team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. labels Jan 28, 2026
@FilOzzy FilOzzy added this to FOC Jan 28, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new provider CLI command to inspect registered storage providers and ping their PDP endpoints.

Changes:

  • Introduces provider info to list approved/active providers or show details for a specific provider.
  • Introduces provider ping to probe provider PDP /pdp/ping endpoints (approved/active or specific provider).
  • Adds unit tests for the new provider command behaviors and wires the command into the main CLI.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
src/commands/provider.ts Implements provider info/provider ping, formatting and output logic, and auth defaulting.
src/test/unit/provider.test.ts Adds unit tests covering info/ping behaviors, including --all handling.
src/cli.ts Registers the new provider command in the CLI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +181 to +184
if (data.minPieceSizeInBytes) console.log(` Min Piece Size: ${formatFileSize(data.minPieceSizeInBytes)}`)
if (data.maxPieceSizeInBytes) console.log(` Max Piece Size: ${formatFileSize(data.maxPieceSizeInBytes)}`)
if (data.storagePricePerTibPerDay) console.log(` Storage Price: ${formatUSDFC(BigInt(data.storagePricePerTibPerDay))} USDFC/TiB/Day`)
if (data.minProvingPeriodInEpochs) console.log(` Min Proving Period: ${data.minProvingPeriodInEpochs} epochs`)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These checks use truthiness to decide whether to print values. If a field can legally be 0 / 0n, it will be skipped. Prefer explicit null/undefined checks (e.g., != null) so zero values are still displayed.

Suggested change
if (data.minPieceSizeInBytes) console.log(` Min Piece Size: ${formatFileSize(data.minPieceSizeInBytes)}`)
if (data.maxPieceSizeInBytes) console.log(` Max Piece Size: ${formatFileSize(data.maxPieceSizeInBytes)}`)
if (data.storagePricePerTibPerDay) console.log(` Storage Price: ${formatUSDFC(BigInt(data.storagePricePerTibPerDay))} USDFC/TiB/Day`)
if (data.minProvingPeriodInEpochs) console.log(` Min Proving Period: ${data.minProvingPeriodInEpochs} epochs`)
if (data.minPieceSizeInBytes != null) console.log(` Min Piece Size: ${formatFileSize(data.minPieceSizeInBytes)}`)
if (data.maxPieceSizeInBytes != null) console.log(` Max Piece Size: ${formatFileSize(data.maxPieceSizeInBytes)}`)
if (data.storagePricePerTibPerDay != null) console.log(` Storage Price: ${formatUSDFC(BigInt(data.storagePricePerTibPerDay))} USDFC/TiB/Day`)
if (data.minProvingPeriodInEpochs != null) console.log(` Min Proving Period: ${data.minProvingPeriodInEpochs} epochs`)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +11 to +21
export const providerCommand = new Command('provider')
.description('Inspect and interact with storage providers')

const infoCommand = new Command('info')
.description('View provider info. Lists all approved providers if no ID/Address specified.')
.argument('[provider]', 'Provider ID or Address')
.option('--all', 'List all active providers (ignoring approval status)')
.action(async (providerIdOrAddr, options) => {
try {
ensurePublicAuth(options)

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting/indentation in this file uses 4-space indents in many blocks/chains, but the repo’s Biome config enforces 2-space indentation (see biome.json formatter.indentWidth: 2). Running Biome formatting (or adjusting indentation) will avoid CI/lint failures.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +7 to +23
// Fix hoisting issue: define mocks in hoisted block
const { mockWarmStorage, mockSynapse, mockGetProvider, mockGetAllActiveProviders } = vi.hoisted(() => {
const mockGetProvider = vi.fn()
const mockGetAllActiveProviders = vi.fn()
const mockWarmStorage = {
getServiceProviderRegistryAddress: vi.fn(),
getApprovedProviderIds: vi.fn(),
getProvider: vi.fn()
}
const mockSynapse = {
getProvider: vi.fn(),
storage: {
_warmStorageService: mockWarmStorage
}
}
return { mockWarmStorage, mockSynapse, mockGetProvider, mockGetAllActiveProviders }
})
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting/indentation in this test file uses 4-space indents, but the repo’s Biome config enforces 2-space indentation (biome.json formatter.indentWidth: 2). Run Biome formatting (or adjust indentation) to prevent formatter/lint failures in CI.

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +132
// Construct ping URL: append /pdp/ping
// Ensure serviceUrl doesn't end with / to avoid double slashes when simple appending,
// or use URL API.
const baseUrl = serviceUrl.endsWith('/') ? serviceUrl.slice(0, -1) : serviceUrl
const pingUrl = `${baseUrl}/pdp/ping`
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping URL construction will produce a duplicated "/pdp" segment when the provider's serviceURL already includes the PDP base path (e.g., .../pdp), resulting in .../pdp/pdp/ping. Consider normalizing with the URL API and handling both forms (base host vs PDP base path), e.g., if the pathname already ends with /pdp then append /ping, otherwise append /pdp/ping.

Suggested change
// Construct ping URL: append /pdp/ping
// Ensure serviceUrl doesn't end with / to avoid double slashes when simple appending,
// or use URL API.
const baseUrl = serviceUrl.endsWith('/') ? serviceUrl.slice(0, -1) : serviceUrl
const pingUrl = `${baseUrl}/pdp/ping`
// Construct ping URL, handling both base host and PDP base path forms.
// If the service URL path already ends with `/pdp`, append `/ping`,
// otherwise append `/pdp/ping`.
const url = new URL(serviceUrl)
const normalizedPath = url.pathname.replace(/\/+$/, '')
if (normalizedPath.endsWith('/pdp')) {
url.pathname = `${normalizedPath}/ping`
} else {
url.pathname = `${normalizedPath}/pdp/ping`
}
const pingUrl = url.toString()

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk how valid this is.. I don't remember if serviceUrl includes /pdp, but I dont think so

Comment on lines +135 to +140
// Use GET for specific ping endpoint
const res = await fetch(pingUrl, { method: 'GET', signal: controller.signal }).catch(async () => {
if (controller.signal.aborted) throw new Error('Timeout')
throw new Error('Network Error')
})
clearTimeout(timeout)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearTimeout(timeout) is only reached when fetch() resolves successfully; if fetch() rejects (network error/abort), the timer remains scheduled and can fire later, causing unnecessary work and potential flaky behavior. Use a try/finally around the fetch() so the timeout is always cleared.

Suggested change
// Use GET for specific ping endpoint
const res = await fetch(pingUrl, { method: 'GET', signal: controller.signal }).catch(async () => {
if (controller.signal.aborted) throw new Error('Timeout')
throw new Error('Network Error')
})
clearTimeout(timeout)
let res: Response
try {
// Use GET for specific ping endpoint
res = await fetch(pingUrl, { method: 'GET', signal: controller.signal }).catch(async () => {
if (controller.signal.aborted) throw new Error('Timeout')
throw new Error('Network Error')
})
} finally {
clearTimeout(timeout)
}

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +44 to +70
if (!provider) {
console.error(pc.red(`Provider ${providerIdOrAddr} not found or invalid.`))
process.exit(1)
}
printProvider(provider)
} else {
let providers = []
if (options.all) {
providers = await spRegistry.getAllActiveProviders()
console.log(pc.bold(`Found ${providers.length} active providers (all):`))
} else {
const approvedIds = await warmStorage.getApprovedProviderIds()
console.log(pc.bold(`Found ${approvedIds.length} approved providers:`))
const providersOrNull = await Promise.all(approvedIds.map((id: number) => spRegistry.getProvider(id)))
providers = providersOrNull.filter(p => p !== null)
}

if (providers.length > 0) {
printTable(providers)
}
}

await cleanupSynapseService()
} catch (error) {
console.error('Failed to get provider info:', error instanceof Error ? error.message : error)
process.exit(1)
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanupSynapseService() is only called on the success path. In error branches where process.exit(1) is invoked (including the !provider case and the outer catch), telemetry/provider cleanup is skipped, which can drop pending telemetry flushes and leaves cleanup behavior inconsistent across outcomes. Consider moving cleanupSynapseService() to a finally block and avoiding early process.exit inside the action (prefer throw + single exit point) so cleanup runs reliably.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please be sure you're following #254.. look to other commands for the pattern

Comment on lines +14 to +17
const infoCommand = new Command('info')
.description('View provider info. Lists all approved providers if no ID/Address specified.')
.argument('[provider]', 'Provider ID or Address')
.option('--all', 'List all active providers (ignoring approval status)')
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text advertises "Provider ID or Address", but the implementation rejects non-numeric inputs and does not support address lookup. Either implement address-based lookup or update the description/argument help to only mention numeric IDs to avoid misleading CLI UX.

Copilot uses AI. Check for mistakes.
Comment on lines +209 to +214
// adjust widths based on content (optional, but good for table)
rows.forEach(r => {
columns.forEach(c => {
const val = (r as any)[c.key] || ''
if (val.length > c.width) c.width = Math.min(val.length, 60) // cap max width
})
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table width capping sets c.width = 60 for long values, but row rendering never truncates the value to c.width (so very long strings will still overflow and break alignment). If you want capped widths, truncate values (optionally with an ellipsis) to c.width when rendering rows/headers.

Copilot uses AI. Check for mistakes.
@beck-8
Copy link
Author

beck-8 commented Jan 29, 2026

it would be good to get your input on whether you want to see this functionality in filecoin-pin vs. in a Synapse CLI.

As a user who uploads data, I prefer to use this function in a tool with complete addition, deletion, modification and query functions. Instead of putting it in Synapse utils

@rvagg
Copy link
Member

rvagg commented Jan 29, 2026

it would be good to get your input on whether you want to see this functionality in filecoin-pin vs. in a Synapse CLI.

Well ... I'm not too fussed to be honest. Synapse doesn't technically have a CLI, it's got a set of "examples", so we're probably not going to be recommending that as a go-to in our documentation if we need to tell people how to find something. If we were publishing it to npm as a CLI then maybe. There's a package there, it's named synapse-cli, but it's private so doesn't get published. We could opt for publishing a @filoz/synapse-cli that you could run these things from if we wanted to; but it's not something we've considered doing yet.

In lieu of that, we have filecoin-pin, which is a really nice CLI already, easy to install and run and useful beyond just pinning IPFS data. So I'm fine making it even nicer. Then users who care about the IPFS use-case have a more full-featured CLI client, and we have a legit place to point people to if we want to tell them to run commands. It's not a perfect fit because of the IPFS bias, but even the name "filecoin-pin" doesn't strictly mean IPFS and CARs, it's just a brand.

@BigLep
Copy link
Member

BigLep commented Jan 29, 2026

Ok, sweet. So we're aligned that functionality like this can live in filecoin-pin.

Should we maybe give optionality and display on whether SPs are approved vs. not approved?

Side: I assume this could be another way to satisfy FilOzone/filecoin-services#359

@beck-8
Copy link
Author

beck-8 commented Jan 29, 2026

The command I added only displays "approved" by default; all SPs are only displayed when using "-all".

@BigLep
Copy link
Member

BigLep commented Jan 29, 2026

The command I added only displays "approved" by default; all SPs are only displayed when using "-all".

Ack, got it - I see that now.

I dont see for the "provider detail command" (e.g., node dist/cli.js provider info 1).

const infoCommand = new Command('info')
.description('View provider info. Lists all approved providers if no ID/Address specified.')
.argument('[provider]', 'Provider ID or Address')
.option('--all', 'List all active providers (ignoring approval status)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we discussed this previously with data-set --ls in order to list and --id to specify a specific one. Please follow the patterns there

Comment on lines +11 to +21
export const providerCommand = new Command('provider')
.description('Inspect and interact with storage providers')

const infoCommand = new Command('info')
.description('View provider info. Lists all approved providers if no ID/Address specified.')
.argument('[provider]', 'Provider ID or Address')
.option('--all', 'List all active providers (ignoring approval status)')
.action(async (providerIdOrAddr, options) => {
try {
ensurePublicAuth(options)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +44 to +70
if (!provider) {
console.error(pc.red(`Provider ${providerIdOrAddr} not found or invalid.`))
process.exit(1)
}
printProvider(provider)
} else {
let providers = []
if (options.all) {
providers = await spRegistry.getAllActiveProviders()
console.log(pc.bold(`Found ${providers.length} active providers (all):`))
} else {
const approvedIds = await warmStorage.getApprovedProviderIds()
console.log(pc.bold(`Found ${approvedIds.length} approved providers:`))
const providersOrNull = await Promise.all(approvedIds.map((id: number) => spRegistry.getProvider(id)))
providers = providersOrNull.filter(p => p !== null)
}

if (providers.length > 0) {
printTable(providers)
}
}

await cleanupSynapseService()
} catch (error) {
console.error('Failed to get provider info:', error instanceof Error ? error.message : error)
process.exit(1)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please be sure you're following #254.. look to other commands for the pattern

Comment on lines +181 to +184
if (data.minPieceSizeInBytes) console.log(` Min Piece Size: ${formatFileSize(data.minPieceSizeInBytes)}`)
if (data.maxPieceSizeInBytes) console.log(` Max Piece Size: ${formatFileSize(data.maxPieceSizeInBytes)}`)
if (data.storagePricePerTibPerDay) console.log(` Storage Price: ${formatUSDFC(BigInt(data.storagePricePerTibPerDay))} USDFC/TiB/Day`)
if (data.minProvingPeriodInEpochs) console.log(` Min Proving Period: ${data.minProvingPeriodInEpochs} epochs`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +135 to +140
// Use GET for specific ping endpoint
const res = await fetch(pingUrl, { method: 'GET', signal: controller.signal }).catch(async () => {
if (controller.signal.aborted) throw new Error('Timeout')
throw new Error('Network Error')
})
clearTimeout(timeout)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +128 to +132
// Construct ping URL: append /pdp/ping
// Ensure serviceUrl doesn't end with / to avoid double slashes when simple appending,
// or use URL API.
const baseUrl = serviceUrl.endsWith('/') ? serviceUrl.slice(0, -1) : serviceUrl
const pingUrl = `${baseUrl}/pdp/ping`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk how valid this is.. I don't remember if serviceUrl includes /pdp, but I dont think so

@github-project-automation github-project-automation bot moved this from 📌 Triage to ⌨️ In Progress in FOC Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants