• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

openwse/ipfs-api: A minimal implementation of the IPFS API.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

openwse/ipfs-api

开源软件地址:

https://github.com/openwse/ipfs-api

开源编程语言:

PHP 99.9%

开源软件介绍:

A minimal implementation of IPFS API

Installation

You can install the package via composer:

composer require openwse/ipfs-api

Usage

$client = new Ipfs\Ipfs(
    new Ipfs\Drivers\HttpClient('https://ipfs-host', 5001)
);

// add a single file (and pin it)
$client->add('/path/to/the/file', true);

// add a file from content
$client->add([
    ['/desired-path-on-ipfs/filename.txt', null, 'my text content', 'text/plain']
]);

// add a nested structure
$client->add([
    ['/path/to/local/file', '/path/on/ipfs'],
    'my-custom-dir',
    ['/path/to/local/file', '/my-custom-dir/filename'],
]);

// list all files
$client->files()->ls();

// get the version
$client->version();

// publish
$client->key()->gen('mykeyname');
$client->name()->publish('/path/hash', '48h', 'mykeyname');


// some other examples...
$client->cat('/path/hash');

$client->config()->set('key', 'value');

$client->pin()->add('/path/hash');

$client->pin()->verify();

$client->stats()->bw();

$client->key()->rm('mykeyname');

Lint

Run PHPMD, PHPStan, and PHP-CS-Fixer

composer lint

Testing

composer tests

TODOS:

  • Complete async/streams requests
  • Implement the following endpoints:
    • P2P
    • Pubsub (with name/pubsub/{cancel,state,subs})
  • Missing tests:
    • Block > put
    • Filestore
    • Dht

License

The MIT License (MIT). Please see License File for more information.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap