Coder Social home page Coder Social logo

storj.js's Introduction

Storj.js

Extremely early version of the browser library for Storj.io.

Use:

  1. Install core-cli
npm install storj-cli --global
storj login
  1. Generate a deterministic seed
storj generate-seed
  1. Create a new bucket and make it public for downloads
storj add-bucket PublicBucket
storj make-public PublicBucket --pull
  1. Upload a small image file
storj upload-file PublicBucket test.png
  1. Download the file in a browser
<html>
  <head>
  <title>Storj Download Example</title>
</head>
<body>
  <script type="text/javascript" src="../build/Storj.js"></script>
  <script>

  var options = {
    bucketId: '<bucket-id>', // || user: <email>, bucket: <bucket-name>
    file: 'test.png'
  };
  var downloader = new Storj.Downloader(options, function(err, data) {
    var blob = new Blob([data], {type: "image/jpg"});
    var url = URL.createObjectURL(blob);
    var img = new Image();
    img.src = url;
    document.body.appendChild(img);
  });

  </script>
  </body>
</html>

Completed:

  • Download files in public buckets
  • Initial version of audio and video streaming
  • Create documentation for creating public buckets
  • Refacto Stream.js to use Download.js logic
  • Add concurrent downloads for streaming
  • Perform decryption in separate thread or in way that doesn't freeze interface
  • Add progress indication for files and streams

To do:

  • Solve mixed content errors on https pages (important!)
    • WebRTC or "Let's Encrypt"
  • Automatically replace special browser storj tags with equivalent elements
  • Use supplied file size, requires PR deployment
  • Use supplied mimetype of file and create DOM element
  • Properly handle errors and issue X retries per shard
    • Add failed pointers to exclude list

Wishlist:

  • Figure out efficient distributed streaming method
    • Requires out of order decryption
  • Get seek to working for audio/video streams
    • Requires out of order decryption + more meta data

Examples:

storj.js's People

Contributors

cpollard1001 avatar

Stargazers

Kevin Leffew avatar  avatar LOVis waTer nakamoto avatar

Watchers

James Cloos avatar  avatar

storj.js's Issues

BridgeClient library

After trying to merge in billing changes to Bridge-GUI today and realizing that it's not going to (easily or consistently) work with the most recent storj-lib versions, it is most likely going to be come necessary to pull bridge client out of core, or create a better browser-only library for talking to Bridge instead of using the BridgeClient in storj-lib.

I've started work on this, but wanted to open up a thread for discussion between all parties already involved, since I saw that Storj.js requires a BridgeClient to work as well.

Any thoughts or ideas on this before we get too far in on it? I'm scaffolding out the library right now, and will be working on it tomorrow with @bryanchriswhite

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.