Skip to content

getActivePieceCount

getActivePieceCount(client, options): Promise<bigint>

Defined in: packages/synapse-core/src/pdp-verifier/get-active-piece-count.ts:43

Get the active piece count for a data set (non-zero leaf count)

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the active piece count.
optionsOptionsTypegetActivePieceCount.OptionsType

Promise<bigint>

The active piece count for the data set getActivePieceCount.OutputType

import { getActivePieceCount } from '@filoz/synapse-core/pdp-verifier'
import { calibration } from '@filoz/synapse-core/chains'
import { createPublicClient, http } from 'viem'
const client = createPublicClient({
chain: calibration,
transport: http(),
})
const activePieceCount = await getActivePieceCount(client, { dataSetId: 1n })

Errors getActivePieceCount.ErrorType