Skip to content

Commit

Permalink
feat: podsi and filecoin support
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Aug 20, 2024
1 parent 7cbe0cf commit 122b668
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
"delegators",
"drep",
"dreps",
"filecoin",
"ipfs",
"IPFS",
"libc",
"Lovelaces",
"Merkle",
"Milkomeda",
"mirs",
"Mithril",
Expand Down
15 changes: 15 additions & 0 deletions blockfrost-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5391,6 +5391,13 @@ paths:
schema:
type: string
description: Path to the IPFS object
- in: query
name: filecoin
schema:
type: boolean
required: false
description: |
If set to true, the object will be pinned to Filecoin as well. If not specified, the object will only be pinned to IPFS.
responses:
'200':
description: Returns pinned object
Expand Down Expand Up @@ -5506,12 +5513,16 @@ paths:
pinned item has been garbage collected due to account being over storage quota or after it has
been moved to `unpinned` state by removing the object pin.
example: pinned
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
'400':
$ref: '#/components/responses/400'
'403':
Expand Down Expand Up @@ -5579,12 +5590,16 @@ paths:
When object is unpinned (i.e. after `/ipfs/pin/remove/{IPFS_path}`) it is marked for garbage collection.
State `gc` means that a previously `unpinned` item has been garbage collected due to account being over storage quota.
example: pinned
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
'400':
$ref: '#/components/responses/400'
'403':
Expand Down
2 changes: 1 addition & 1 deletion json-schema.json

Large diffs are not rendered by default.

23 changes: 21 additions & 2 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7371,6 +7371,15 @@
"type": "string",
"description": "Path to the IPFS object"
}
},
{
"in": "query",
"name": "filecoin",
"schema": {
"type": "boolean"
},
"required": false,
"description": "If set to true, the object will be pinned to Filecoin as well. If not specified, the object will only be pinned to IPFS.\n"
}
],
"responses": {
Expand Down Expand Up @@ -7516,14 +7525,19 @@
],
"description": "State of the pinned object, which is `queued` when we are retriving object. If this\nis successful the state is changed to `pinned` or `failed` if not. The state `gc` means the\npinned item has been garbage collected due to account being over storage quota or after it has\nbeen moved to `unpinned` state by removing the object pin.\n",
"example": "pinned"
},
"filecoin": {
"type": "boolean",
"description": "Whether filecoin was used to pin the resource."
}
},
"required": [
"time_created",
"time_pinned",
"ipfs_hash",
"size",
"state"
"state",
"filecoin"
]
}
}
Expand Down Expand Up @@ -7609,14 +7623,19 @@
],
"description": "State of the pinned object. We define 5 states: `queued`, `pinned`, `unpinned`, `failed`, `gc`.\nWhen the object is pending retrieval (i.e. after `/ipfs/pin/add/{IPFS_path}`), the state is `queued`.\nIf the object is already successfully retrieved, state is changed to `pinned` or `failed` otherwise.\nWhen object is unpinned (i.e. after `/ipfs/pin/remove/{IPFS_path}`) it is marked for garbage collection.\nState `gc` means that a previously `unpinned` item has been garbage collected due to account being over storage quota.\n",
"example": "pinned"
},
"filecoin": {
"type": "boolean",
"description": "Whether filecoin was used to pin the resource."
}
},
"required": [
"time_created",
"time_pinned",
"ipfs_hash",
"size",
"state"
"state",
"filecoin"
]
}
}
Expand Down
16 changes: 16 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5660,6 +5660,14 @@ paths:
schema:
type: string
description: Path to the IPFS object
- in: query
name: filecoin
schema:
type: boolean
required: false
description: >
If set to true, the object will be pinned to Filecoin as well. If
not specified, the object will only be pinned to IPFS.
responses:
'200':
description: Returns pinned object
Expand Down Expand Up @@ -5784,12 +5792,16 @@ paths:
been moved to `unpinned` state by removing the object
pin.
example: pinned
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
'400':
$ref: '#/components/responses/400'
'403':
Expand Down Expand Up @@ -5868,12 +5880,16 @@ paths:
been garbage collected due to account being over storage
quota.
example: pinned
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
'400':
$ref: '#/components/responses/400'
'403':
Expand Down
8 changes: 8 additions & 0 deletions src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,10 @@ export interface paths {
*/
post: {
parameters: {
query?: {
/** @description If set to true, the object will be pinned to Filecoin as well. If not specified, the object will only be pinned to IPFS. */
filecoin?: boolean;
};
path: {
IPFS_path: string;
};
Expand Down Expand Up @@ -3829,6 +3833,8 @@ export interface paths {
* @enum {string}
*/
state: "queued|pinned|unpinned|failed|gc";
/** @description Whether filecoin was used to pin the resource. */
filecoin: boolean;
})[];
};
};
Expand Down Expand Up @@ -3892,6 +3898,8 @@ export interface paths {
* @enum {string}
*/
state: "queued|pinned|unpinned|failed|gc";
/** @description Whether filecoin was used to pin the resource. */
filecoin: boolean;
};
};
};
Expand Down
7 changes: 7 additions & 0 deletions src/paths/ipfs/pin/add/{IPFS_path}/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ post:
schema:
type: string
description: Path to the IPFS object
- in: query
name: filecoin
schema:
type: boolean
required: false
description: >
If set to true, the object will be pinned to Filecoin as well. If not specified, the object will only be pinned to IPFS.
responses:
"200":
description: Returns pinned object
Expand Down
4 changes: 4 additions & 0 deletions src/paths/ipfs/pin/list/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ get:
pinned item has been garbage collected due to account being over storage quota or after it has
been moved to `unpinned` state by removing the object pin.
example: "pinned"
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
"400":
$ref: ../../../../responses/errors/400.yaml
"403":
Expand Down
4 changes: 4 additions & 0 deletions src/paths/ipfs/pin/list/{IPFS_path}/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ get:
When object is unpinned (i.e. after `/ipfs/pin/remove/{IPFS_path}`) it is marked for garbage collection.
State `gc` means that a previously `unpinned` item has been garbage collected due to account being over storage quota.
example: "pinned"
filecoin:
type: boolean
description: Whether filecoin was used to pin the resource.
required:
- time_created
- time_pinned
- ipfs_hash
- size
- state
- filecoin
"400":
$ref: ../../../../../responses/errors/400.yaml
"403":
Expand Down
105 changes: 105 additions & 0 deletions src/paths/ipfs/pin/podsi/{IPFS_path}/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
servers:
- url: https://ipfs.blockfrost.io/api/v0

get:
tags:
- IPFS » Pins
summary: Get Proof of Data Segment Inclusion (PoDSI)
description: |
Retrieve the Proof of Data Segment Inclusion (PoDSI) for a specific IPFS object.
<p>
<span class="hosted">Hosted</span> Endpoint only available for hosted variant.
</p>
parameters:
- in: path
required: true
name: IPFS_path
schema:
type: string
description: The path to the IPFS object
responses:
"200":
description: Returns the Proof of Data Segment Inclusion (PoDSI)
content:
application/json:
schema:
type: object
properties:
dealInfo:
type: array
items:
type: object
properties:
dealId:
type: integer
description: The ID of the storage deal
storageProvider:
type: string
description: The storage provider's ID
proof:
type: object
properties:
verifierData:
type: object
properties:
commPc:
type: string
description: The piece commitment (commPc)
sizePc:
type: string
description: The size of the piece commitment
inclusionProof:
type: object
properties:
proofIndex:
type: object
properties:
index:
type: string
description: The proof index
path:
type: array
items:
type: string
description: The Merkle proof path
proofSubtree:
type: object
properties:
index:
type: string
description: The subtree proof index
path:
type: array
items:
type: string
description: The Merkle proof path for the subtree
indexRecord:
type: object
properties:
checksum:
type: string
description: The checksum of the index record
proofIndex:
type: string
description: The proof index
proofSubtree:
type: integer
description: The size of the proof subtree
size:
type: integer
description: The size of the record
required:
- dealInfo
"400":
$ref: ../../../../../responses/errors/400.yaml
"403":
$ref: ../../../../../responses/errors/403.yaml
"404":
$ref: ../../../../../responses/errors/404.yaml
"429":
$ref: ../../../../../responses/errors/429.yaml
"418":
$ref: ../../../../../responses/errors/418.yaml
"500":
$ref: ../../../../../responses/errors/500.yaml
Loading

0 comments on commit 122b668

Please sign in to comment.