Home / Blockchain / Block IPFS

version: 2.0.0

Overview


InterPlanetary File System or IPFS is a protocol and network designed to create a content-addressable, peer-to-peer method of storing and sharing hypermedia in a distributed file system. Similar to a torrent, IPFS allows users to not only receive but host content.

Block IPFS allows you to create a node and add it to the public IPFS network. It also givdes you the option to add and explore files hosted on the IPFS network.


Beginner's Guide


InterPlanetary File System or IPFS is a protocol and network designed to create a content-addressable, peer-to-peer method of storing and sharing hypermedia in a distributed file system. Similar to a torrent, IPFS allows users to not only receive but host content.


Quickstart


As part of Release 2.0.0., using Block IPFS, you can create a node, add it to the public IPFS network, add files, explore files, get info about your node as well as the peers connected to your node.


APIs


All URIs below are relative to https://studio.spotflock.com

Create an IPFS Node POST  /api/v1/ipfs-service/cloud-ipfs/node
Get Node info GET  /api/v1/ipfs-service/cloud-ipfs/node/{id}
Get Peers info GET  /api/v1/ipfs-service/cloud-ipfs/peers-info/{id}
Add a file POST  /api/v1/ipfs-service/cloud-ipfs/file/{id}
Get files GET  /api/v1/ipfs-service/cloud-ipfs/files/{id}

Create an IPFS Node

Description

This API would enable you to create an IPFS Node and add it to public IPFS network.

URI

POST  /api/v1/ipfs-service/cloud-ipfs/node

Headers

api-key Your App's API Key

Attributes

name Name of the node
description Description of the node

Request Example

{
  "name": "Goflocker IPFS Node",
  "service": "This node will host all public Goflocker files"
}

Response

{
    "id": "a239-hdu2-3d43",
    "name": "Goflocker IPFS Node",
    "description": "This node will host all public Goflocker files"
    "version": "go-ipfs v0.4.17"
    "nodeStatus": "NOT_APPLICABLE",
    "instanceStatus": "INIT",
    "createdDate": "2019-02-05T16:14:31.467+0000"
}

Get Node info

Description

The node created by using the above API takes some time to be live and running. This API enables yout to get the node info and thus, also the status of the node.

URI

GET  /api/v1/ipfs-service/cloud-ipfs/node/{id}

Headers

api-key Your App's API Key

Parameters

id Node id as generated from the previous API

Response

{
    "id": "a239-hdu2-3d43",
    "name": "Goflocker IPFS Node",
    "description": "This node will host all public Goflocker files"
    "version": "go-ipfs v0.4.17",
    "api": "/ip4/13.467.23.12/tcp/5001",
    "nodeStatus": "RUNNING",
    "instanceStatus": "RUNNING",
    "createdDate": "2019-02-05T16:14:31.467+0000"
}

Get Peers Info

Description

This API would enable you to get detailed info about the peers, their hash, api and the distribution of peers in different regions.

URI

GET  /api/v1/ipfs-service/cloud-ipfs/peers-info/{id}

Headers

api-key Your App's API Key

Parameters

id Node id

Response

{
    "peers": [
                {
                    "peer": {"address":{"host":"45.67.211.223","tcpPort":"4001"}},
                    "hash": "34234xf34f2x4r2r3dv6645rcrtdy65gcfvbnbhbhvgcfsxccr53wx4"
                },
                {
                    "peer": {"address":{"host":"25.67.211.123","tcpPort":"4001"}},
                    "hash": "988988yxngxfnubhjmnnnbfxnng5xn4zmu889nxm54nmx5478n5xn84"
                }
        ],
    "share": {"United States": 1, "India": 1}

}

Add a file

Description

This API would enable you to add a file to your IPFS Node, thus allowing to distribute over the public IPFS network.

URI

POST  /api/v1/ipfs-service/cloud-ipfs/file/{id}

Headers

api-key Your App's API Key

Body

file Multipart File

Parameters

id Node id

Response

{
    "node": {"id": "a239-hdu2-3d43"},
    "filename": "logic.jpg",
    "hash":"rx33fx434tyv5yt45r23zar4r43tc45zr3r3c4ct3tgv545yufgbfgdfvyy45",
    "createdDate": "2019-02-05T16:14:31.467+0000"

}

Get Files

Description

This API would enable you to get all the files uploaded to your node and also metadata bout them.

GET

GET  /api/v1/ipfs-service/cloud-ipfs/files/{id}

Headers

api-key Your App's API Key

Parameters

id Node id

Response

[
 {
    "node": {"id": "a239-hdu2-3d43"},
    "filename": "logic.jpg",
    "hash":"rx33fx434tyv5yt45r23zar4r43tc45zr3r3c4ct3tgv545yufgbfgdfvyy45",
    "createdDate": "2019-02-05T16:14:31.467+0000"
 }
]

Data Usage FAQ


Apart from the pricing plans for Block IPFS where you consume by API calls, you can also use SCUs to consume Block IPFS APIs. Below are the SCUs consumed for each service.

APIs SCUs Consumed
Create a node 2000
Get node status 5
Get Peers Info 10
Add a file 50
Get files info 10

Release Notes


Folowing are the release notes as part of Release 2.0.0

  • IPFS Node version is go-ipfs v0.4.17.

  • Storage allowed per node is 20 GB.

Helpdesk