Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,21 @@ const cid = "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N";
const result = await data.localDownload(cid);
```

#### delete

Deletes either a single block or an entire dataset from the local node.
Does nothing if the dataset is not locally available.

- cid (string, required)
- returns ""

Example:

```js
const cid = "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N";
const result = await data.delete(cid);
```

### Debug

The following API assume that you have already a node module loaded, example:
Expand Down
37 changes: 34 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ components:
type: string
description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay

CollateralPerByte:
type: string
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots

Duration:
type: integer
format: int64
Expand Down Expand Up @@ -120,6 +124,9 @@ components:
revision:
type: string
example: 0c647d8
contracts:
type: string
example: 0b537c7

PeersTable:
type: object
Expand Down Expand Up @@ -198,6 +205,7 @@ components:
required:
- id
- totalRemainingCollateral
- freeSize
allOf:
- $ref: "#/components/schemas/SalesAvailability"
- type: object
Expand Down Expand Up @@ -320,8 +328,7 @@ components:
default: 1
minimum: 1
collateralPerByte:
type: string
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
$ref: "#/components/schemas/CollateralPerByte"
expiry:
type: integer
format: int64
Expand Down Expand Up @@ -351,6 +358,8 @@ components:
$ref: "#/components/schemas/ProofProbability"
pricePerBytePerSecond:
$ref: "#/components/schemas/PricePerBytePerSecond"
collateralPerByte:
$ref: "#/components/schemas/CollateralPerByte"
maxSlotLoss:
type: integer
format: int64
Expand Down Expand Up @@ -392,7 +401,7 @@ components:
description: Description of the Request's state
enum:
- cancelled
- error
- errored
- failed
- finished
- pending
Expand Down Expand Up @@ -586,6 +595,8 @@ paths:
text/plain:
schema:
type: string
"422":
description: The mimetype of the filename is invalid
"500":
description: Well it was bad-bad and the upload did not work out

Expand Down Expand Up @@ -617,6 +628,26 @@ paths:
"500":
description: Well it was bad-bad

delete:
summary: "Deletes either a single block or an entire dataset from the local node."
tags: [Data]
operationId: deleteLocal
parameters:
- in: path
name: cid
required: true
schema:
$ref: "#/components/schemas/Cid"
description: Block or dataset to be deleted.

responses:
"204":
description: Data was successfully deleted.
"400":
description: Invalid CID is specified
"500":
description: There was an error during deletion

"/data/{cid}/network":
post:
summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed."
Expand Down
Loading