RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
290 stars 46 forks source link

(Dat2) Replicate in-memory hypercores #51

Closed Frando closed 4 years ago

Frando commented 4 years ago

Hiya, I was testing out the dat2-take-two branch. Looking good!

Hypercores created with the { persist: false } option cannot be replicated at the moment. As they are created outside of the Corestore they are not injected into replication streams, as corestore-swarm-networking doesn't know about them.

I'm not sure what the best fix is for this. Maybe doing a PR to corestore that would add support for a persist opt there? So that it could create hypercores with a random-access-memory storage but otherwise treat them exactly the same, so that they're part of the normal replication workflow. @andrewosh? Alternatively we'd need a way to dynamically inject hypercores into corestore-swarm-networking, that seems difficult though with its reliance on corestore's stream injection handling. A third option would be not to use corestore-swarm-networking and roll our own replication manager in the SDK, but then that would have to be maintained.

RangerMauve commented 4 years ago

Ah shoot. Thanks for finding the issue! I think I actually had this problem in the past.

I think injecting the feed into corestore somehow would probably be best.

Would probably need to copy-paste all the stuff here in the the SDK: https://github.com/andrewosh/corestore/blob/master/index.js#L368

RangerMauve commented 4 years ago

Working on fixing this. Got hypercore working, having some trouble with hyperdrive because I'm doing some zany shit with it. 😂

RangerMauve commented 4 years ago

Fixed in 2.0.0-7