在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:openwse/ipfs-api开源软件地址:https://github.com/openwse/ipfs-api开源编程语言:PHP 99.9%开源软件介绍:A minimal implementation of IPFS APIInstallationYou 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'); LintRun PHPMD, PHPStan, and PHP-CS-Fixer composer lint Testingcomposer tests TODOS:
LicenseThe MIT License (MIT). Please see License File for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论