-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
License: MIT Signed-off-by: Oli Evans <[email protected]>
- Loading branch information
0 parents
commit 0228a79
Showing
6 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# filecoin.storage | ||
|
||
The simple file storage service for IPFS & Filecoin | ||
|
||
## Getting started | ||
|
||
This project uses node v16 and npm v7. It's a monorepo that use [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) to handle resolving dependencies between the local packages/* folders. | ||
|
||
```console | ||
npm install | ||
``` | ||
|
||
To add a new workspace to the repo: | ||
|
||
```console | ||
npm init -w ./packages/website | ||
``` | ||
|
||
To run an npm script in one or more workspaces | ||
|
||
```console | ||
npm run test --workspace=a --workspace=b | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "filecoin.storage", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"test": "say sorry" | ||
}, | ||
"license": "(Apache-2.0 AND MIT)", | ||
"workspaces": [ | ||
"packages/api", | ||
"packages/client" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# filecoin.storage API | ||
|
||
## API | ||
|
||
### 🔐 `PUT /car/:cid` | ||
|
||
Upload a CAR for a root CID. _Authenticated_ | ||
|
||
### `GET /car/:cid` | ||
|
||
Fetch a CAR by CID. | ||
|
||
### `HEAD /car/:cid` | ||
|
||
Fetch headers like content-length for a given CAR. | ||
|
||
### `GET /root/:cid/deals` | ||
|
||
Get filecoin deals info. (*TBD*) We need to define what info we want here to find the right status. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "filecoin.storage-api", | ||
"private": true, | ||
"version": "0.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "say sorry" | ||
}, | ||
"author": "", | ||
"license": "(Apache-2.0 AND MIT)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# filecoin.storage client | ||
|
||
API client for filecoin.storage | ||
|
||
## Usage | ||
|
||
```js | ||
import FilecoinStorage from 'filecoin.storage' | ||
|
||
// Construct with token and endpoint | ||
const client = new FilecoinStorage({ token: apiKey }) | ||
|
||
// Pack files into a CAR | ||
client.pack(files: Iterable<File>): Promise<{car: Blob, root: CIDString}> | ||
|
||
// Store a CAR | ||
client.store(car: Blob): Promise<CIDString> | ||
|
||
// Send the files, packing them into a CAR under the hood | ||
client.packAndStore(files: Iterable<File>): Promise<CIDString> | ||
|
||
// Get info on the Filecoin deals that the CID is stored in | ||
client.status(cid: string): Promise<Metadata> | ||
|
||
// Fetch a CAR over http | ||
client.get(cid: string): Promise<Blob> | ||
|
||
// Unpack and verify a CAR | ||
client.unpack(car: Blob): AsyncIterable<?> | ||
|
||
// Fetch, verify and unpack the CID to files | ||
client.getAndUnpack(cid: string): AsyncIterable<?> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "filecoin.storage", | ||
"version": "0.0.0", | ||
"description": "API client for filecoin.storage", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "say sorry" | ||
}, | ||
"license": "(Apache-2.0 AND MIT)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/filecoin-storage/filecoin.storage.git" | ||
}, | ||
"author": "", | ||
"bugs": { | ||
"url": "https://github.com/filecoin-storage/filecoin.storage/issues" | ||
}, | ||
"homepage": "https://github.com/filecoin-storage/filecoin.storage#readme" | ||
} |