SkyNet by SiaCoin allows for users to upload files for download by anyone else in the world. I noticed there was no support for PHP/Laravel so I created a package to upload/download files from SkyNet.
You can install the package via composer:
composer require mechawrench/php-skynet
You can publish the config file with:
php artisan vendor:publish --provider="Mechawrench\PhpSkynet\PhpSkynetServiceProvider" --tag="config"
This is the contents of the published config file:
return [
'default_portal_url' => env('SKYNET_DEFAULT_PORTAL_URL'),
'siad_host' => env('SIAD_HOST'),
'siad_api_key' => env('SIAD_API_KEY'),
];
- Ensure you fill out the config file, or preferably the environment variables
- Decide if you will use a SkyNet web portal or your own Siad instance
- We will not get into details of configuring this on your own, technical skills are assumed
// SkyNet Portal Usage
// Stores files under storage/app
$upload = \Mechawrench\PhpSkynet\PhpSkynet::upload(storage_path('app/Bitcoin-Accepted-Here-Button-PNG-Clipart.png'));
$download = \Mechawrench\PhpSkynet\PhpSkynet::download('GAAGFVdQTCpf43KH7Wami5iNldaEHbyxQXhjDkd_ifob2g');
// Private Siad Instance Usage
$upload = \Mechawrench\PhpSkynet\PhpSkynet::uploadSiad('Bitcoin-Accepted-Here-Button-PNG-Clipart.png', storage_path('app/Bitcoin-Accepted-Here-Button-PNG-Clipart.png'), $my_optional_siad_host, $my_optional_siad_apiKey);
$download = \Mechawrench\PhpSkynet\PhpSkynet::downloadSiad($skyLink, $optional_filename, $optional_siad_host);
- Can only upload/download single files at a time for now
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email jesse.schneider@hey.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.