Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Ruby gem for interacting with Skynet.
Add this line to your application's Gemfile:
gem 'skynet_ruby'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install skynet_ruby
require 'skynet'
client = Skynet::Client.new
client.upload_file '/path/to/file.pdf'
=> "sia://ZAAZyxRQ7Ixzd3zujn1ly8RA..."
# if you want to get the full response
client.upload_file '/path/to/file.pdf', full_response: true
=> {
"skylink"=>"ZAAZyxRQ7Ixzd3zujn1ly8RA...",
"merkleroot"=>"19cb1450ec8981fcc63c73777cee8e7d65cbc44",
"bitfield"=>100,
"sialink"=>"sia://ZAAZyxRQ7Ixzd3zujn1ly8RA"
}
client.upload_directory '/path/to/directory'
This function downloads a skylink using HTTP streaming. The call blocks until the data is received. There is a 30s default timeout applied to downloading a skylink. If the data can not be found within this 30s time constraint, a 404 error will be returned. This timeout is configurable.
A directory will be downloaded as zip file, otherwise as regular file.
client.download_file("/path/foo.zip", skylink)
Returns the metadata of an upload. Currently quite often no metadata is returned and a Skynet::NoMetadataError
exception will be raised.
client.get_metadata "ZAAZyxRQ7ImB_...."
Files are by default persisted for 90 days if you upload to skynet. If you have an account files can be pinned endlessly. You can read more here.
To upload an account you need to get a JWT token. You can copy that one from the developer consoles, look for the skynet-jwt
cookie and copy the value. See docs.
! JWTs expire after 720 hours and there's no tooling to detect if your JWT is expired.
Skynet::Client.new(jwt: "XYZ...)
☑ Uploading a file
☑ Uploading a directory
☑ Downloading a file
☑ Downloading a directory
☑ Getting Metadata
☑ Uploading Files to an account
☐ SkyDB
☐ Registry
☐ MySky
Bug reports and pull requests are welcome on GitHub at https://github.com/corck/sia_skynet.
The gem is available as open source under the terms of the MIT License.
Copyright 2021, by Christoph Klocker.
FAQs
Unknown package
We found that skynet_ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.