Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
/ canine-provider Public archive

Jackal Labs implementation of a Jackal Storage Provider

License

Notifications You must be signed in to change notification settings

JackalLabs/canine-provider

Repository files navigation

Jackal Provider Cover

Jackal Storage Provider

Build Test golangci-lint

Overview

The storage provider is a web server that accepts incoming files from users and creates contracts for the users to approve. These contracts last until the user either cancels them or the provider itself goes offline.

API

You can explore the provider API here

Quickstart

This assumes you have either already set up a node or are using another RPC provider in your ~/.jackal-storage/config/client.toml file.

To quickly set up a storage provider, one must initialize their provider & announce themselves to the network. Then they start the provider from their account of choice which stores files in the ~/.jackal-storage/storage folder (this can be changed with the --home flag).

$ jprovd client config chain-id {current-chain-id}

$ jprovd client gen-key

$ jprovd init {IP_ADDRESS} {STORAGE_IN_BYTES} {KEYBASE_IDENTITY}

$ jprovd start

Posting files

Files can be uploaded through a POST request to localhost:3333/upload with form data.

Form Data

Key Data
file {filedata}
sender {address}

Response

The response will be a JSON response formatted as:

{
    "CID": "jklc1...",
    "FID": "jklf1..."
}

Getting files

Gettings files is as easy as running a GET request at localhost:3333/download/{FID}. This will return the file as a blob to the browser.