rootsoft/laravel-ipfs
Composer 安装命令:
composer require rootsoft/laravel-ipfs
包简介
Laravel package to communicate with IPFS
README 文档
README
laravel-ipfs
The InterPlanetary File System is a peer-to-peer hypermedia protocol designed to make the web faster, safer, and more open. IPFS uses content-addressing to uniquely identify each file in a global namespace connecting all computing devices.
It is an ideal solution for a decentralized storage for blockchain-based content and is optimized for the Algorand blockchain .
Introduction
laravel-ipfs is a simple wrapper around the IPFS HTTP API with an elegant approach to connect your application to the IPFS network so you can easily host and fetch content with just a few lines of code.
Once installed, you can simply connect your application to the network and add content:
$ipfs->add(Utils::tryFopen('ipfs.png', 'r'), 'ipfs.png', ['pin' => true]);
or show IPFS object data:
$contents = $ipfs->cat('QmNZdYefySKuzF37CWjR8vZ319gYToS61r3v3sRwApXgaY');
Getting started
Installation
Note: laravel-ipfs requires PHP 7.4+
You can install the package via composer:
composer require rootsoft/laravel-ipfs
Usage
Create an new IPFSClient and pass the IP address and port of your local (or pinned) network.
$ipfs = new IPFSClient('127.0.0.1', 5001);
That's it! We can now easily add new content on a decentralized network!
Laravel ❤️
We've added special support to make the life of a Laravel developer even more easy!
Publish the ipfs.php config file using:
php artisan vendor:publish --provider="Rootsoft\IPFS\IPFSServiceProvider" --tag="config"
Open the config/ipfs.php file in your project and insert your credentials
return [ 'ipfs' => [ 'base_url' => '127.0.0.1', 'port' => 5001, ], ];
Now you can use the IPFS Facade!
$fileHash = IPFS::add($collectible->get(), $fileName, ['only-hash' => true])['Hash'];
Methods
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing & Pull Requests
Feel free to send pull requests.
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
rootsoft/laravel-ipfs 适用场景与选型建议
rootsoft/laravel-ipfs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.94k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2021 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「ipfs」 「rootsoft」 「laravel-ipfs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rootsoft/laravel-ipfs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rootsoft/laravel-ipfs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rootsoft/laravel-ipfs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A minimal implementation of IPFS API
Alfabank REST API integration
ipfs client library
A PHP wrapper for the IPFS API server
php interface for Go-IPFS HTTP API functions
A minimal implementation of IPFS API
统计信息
- 总下载量: 3.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 32
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-05