Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kleros/ipfs-proxy
Proxy for Kleros IPFS node
https://github.com/kleros/ipfs-proxy
backend ipfs ipfs-proxy pin platform
Last synced: 7 days ago
JSON representation
Proxy for Kleros IPFS node
- Host: GitHub
- URL: https://github.com/kleros/ipfs-proxy
- Owner: kleros
- License: mit
- Created: 2018-11-30T21:03:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T02:36:21.000Z (almost 2 years ago)
- Last Synced: 2023-02-26T18:16:13.411Z (almost 2 years ago)
- Topics: backend, ipfs, ipfs-proxy, pin, platform
- Language: Python
- Homepage:
- Size: 2.21 MB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kleros IPFS Proxy
Kleros hosts an IPFS node so that we can pin files that are submitted through our UI's.
Sometimes our UI's need to make api calls to our node. Instead of opening up the entire
IPFS api to the world we run this proxy in front to make the calls for us.## Quickstart
- (Recommended) Install a `virtualenv` using Python 3.x.
- `pip install -r requirements.txt`
- `python application.py`## Routes
### `POST /add`
Add files to IPFS. By default it will pin the file and use a directory to preserve filename and extension.
#### Request Body
Expects a JSON body that includes:
```typescript
{
fileName: string,
buffer: Buffer
}
```#### Response Body
```typescript
{
data: [
{
path: string,
hash: string
},
{
path: "/",
hash: string
}
]
}
```### `GET /ipfs/`
Fetch a file from the node.
#### Response Body
The contents of the file.
### `POST /add-zipped-directory` (experimental)
Adds a zipped directory to IPFS. It will extract the zip file into a folder with the same name and upload it.
#### Request Body
Expects a `multipart/form-data` body with a `file` field:
```typescript
----FormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename=".zip"
Content-Type: application/zip(data)
----FormBoundary7MA4YWxkTrZu0gW
```#### Response Body
```typescript
{
data: [
...
{
path: string,
hash: string
},
{
path: "/",
hash: string
}
]
}
```