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)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the active piece count. |
options | OptionsType | getActivePieceCount.OptionsType |
Returns
Section titled “Returns”Promise<bigint>
The active piece count for the data set getActivePieceCount.OutputType
Example
Section titled “Example”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 })