Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Update for v6.0 Transfer #1

Closed
prestwich opened this issue Dec 13, 2016 · 5 comments
Closed

Update for v6.0 Transfer #1

prestwich opened this issue Dec 13, 2016 · 5 comments

Comments

@prestwich
Copy link
Contributor

Websockets are so 2016. Get with the hip HTTP transfer.

See docs here: http://storj.github.io/core/tutorial-data-transfer.html

@prestwich
Copy link
Contributor Author

Need discussion re: using storj-lib, ES6, etc.

@retrohacker
Copy link
Contributor

So my thoughts are that eventually we can support a majority of storj-lib in browser, so it makes sense to bring that in as a dep.

The challenge is two fold:

  1. Size: Without minification, the bundle is about 1.8M as it stands right now. That will probably grow a bit. With gzip and minification, I could see it as low as 512kb. That is still pretty heavy for a dependency.
  2. ES6: Assuming we only do it for the browser, we should be able to transpile back to ES5 for proper support. This would let us ship two bundles storj.es6.js and storj.es5.js. When you require('storj-js') server-side you would get non-transpiled code.

@retrohacker
Copy link
Contributor

From cpollard1001/storj.js#1 (comment)

Thanks @faddat! I agree re: HTTP for the first pass. The problem is HTTPS, farmers will need to issue certs and we will need to resolve to domain names to get around browser security. This also ties farmer availability to DNS resolution and brings up the question of NAT traversal strategies (and tunneling) for farmer's HTTPS endpoints. HTTP is incredibly straightforward (I have an example working now minus the OPTIONS endpoint), but HTTPS adds a layer of complexity that I'm not quite sure we want to take on.

What I'm working on today is a SIPS proposal for Contract that includes the protocols the shards need to be served over for the contract to be considered valid. This will allow us to propose new protocols for different target platforms and let farmers adopt them as desired, essentially letting the market decide. From there, we can talk through our options for the browser protocol.

As of now, I'm thinking the initial alpha of storj.js will be HTTP only. Other protocols will be implemented pending a larger project we are kicking off the beginning of next year to make some changes to core. Those changes will make plugging in new protocols unobtrusive, perhaps even pushing protocol implementation out into userspace.

@faddat
Copy link

faddat commented Jan 6, 2017

That's what I'd do if I were in your shoes:

Get er shipped, weather or not it's fully-polished. (Http was good enough for a very long time, chances are good that it is still OK)

:)

@retrohacker
Copy link
Contributor

Closing as current library supports HTTP.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants