terminateService
terminateService(
client,options):Promise<`0x${string}`>
Defined in: packages/synapse-core/src/warm-storage/terminate-service.ts:66
Terminate a service (data set)
This function terminates a data set service, which will also result in the removal of all pieces in the data set.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain, Account> | The client to use to terminate the service. |
options | OptionsType | terminateService.OptionsType |
Returns
Section titled “Returns”Promise<`0x${string}`>
The transaction hash terminateService.OutputType
Throws
Section titled “Throws”Errors terminateService.ErrorType
Example
Section titled “Example”import { terminateService } from '@filoz/synapse-core/warm-storage'import { createWalletClient, http } from 'viem'import { privateKeyToAccount } from 'viem/accounts'import { calibration } from '@filoz/synapse-core/chains'
const account = privateKeyToAccount('0x...')const client = createWalletClient({ account, chain: calibration, transport: http(),})
const txHash = await terminateService(client, { dataSetId: 1n,})
console.log(txHash)