在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Fryie/ipfs-ruby开源软件地址:https://github.com/Fryie/ipfs-ruby开源编程语言:Ruby 99.3%开源软件介绍:Unmaintained. See ruby-ipfs-http-client instead. IPFS API Bindings for Ruby
InstallationRequires Ruby >= 2.1, since it uses the new required keyword arguments syntax. Add this line to your application's Gemfile: gem 'ipfs' And then execute:
Or install it yourself as:
UsageInitialize clientrequire 'ipfs/client'
client = IPFS::Client.new host: 'yourhost', port: 5001 or: require 'ipfs/client'
client = IPFS::Client.default # => uses localhost and port 5001 lsnodes = client.ls 'QmXqJAkSdP8e7TSXEeSRKoDY27G11ZwaFJGiKuNFWxpUZo'
nodes.each do |node|
# node is an instance of IPFS::Content::Node
puts node.hashcode
node.links.each do |link|
# link is an instance of IPFS::Content::Link
puts link.name
puts link.hashcode
puts link.size
end
end addlink = client.add 'myExampleFile.txt'
puts link.hashcode
# => QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs catclient.cat 'QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs'
# => "This is some example content." pin rmclient.pin_rm 'QmaVwjMgqjBD25apiuVVnaDqU8SsiiREAAy3Amb1Bs2XHs', recursive: true
# => HTTP::Response DevelopmentAfter checking out the repo, run To install this gem onto your local machine, run ContributingBug reports and pull requests are welcome on GitHub. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论