Skip to content

kesar/IPFS-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPFS Client in PHP

Install:

 composer require nebulaprotocol/ipfs-php

Examples:

use IPFSPHP\IPFS;

include 'vendor/autoload.php';

$ipfs = new IPFS('127.0.0.1', 8080, 5001);

API

add

Adds content to IPFS.

Usage

$hash = $ipfs->add($filePath);

cat

Retrieves the contents of a single hash.

Usage

$ipfs->cat($hash);

ls

Gets the node structure of a hash.

Usage

$obj = $ipfs->ls($hash);

foreach ($obj as $e) {
	echo $e['Hash'];
	echo $e['Size'];
	echo $e['Name'];
}

Object size

Returns object size.

Usage

$size = $ipfs->size($hash);

Pin

Pins a hash.

Usage

$ipfs->pinAdd($hash);

CREDITS

Initially forked from https://github.com/cloutier/php-ipfs-api

About

Simple IPFS client in PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages