apex/ipfs-api
Composer 安装命令:
composer require apex/ipfs-api
包简介
A minimal implementation of IPFS API
README 文档
README
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.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-21