You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs suggest that corestore can replicate to an existing stream, e.g. a connection stream from Hyperswarm like so:
constswarm=newHyperswarm()// join the relevant topicswarm.join(...)// simply pass the connection stream to corestoreswarm.on('connection',(connection)=>store.replicate(connection))
This does work, however if you try to replicate any other corestore or hypercore to the stream before this, then the discovery key hook in corestore does not work, meaning that un-opened cores which exist on the peer are not replicated.
This seems to be because the Protomux stream is only created once, when the first hypercore or corestore is replicated to the stream, and the ondiscoverykey hook only works on that first replication.
I have created a failing test for this (#44) which replicates a third (unrelated) corestore to the connection stream. Removing the line results in the test passing.
This may be intended behaviour, in which case it would be helpful if the docs clarify that if you replicate to an existing stream, you can only replicate one corestore to that stream, and it must be replicated to that stream before any other hypercores.
The text was updated successfully, but these errors were encountered:
The docs suggest that corestore can replicate to an existing stream, e.g. a connection stream from Hyperswarm like so:
This does work, however if you try to replicate any other corestore or hypercore to the stream before this, then the discovery key hook in corestore does not work, meaning that un-opened cores which exist on the peer are not replicated.
This seems to be because the Protomux stream is only created once, when the first hypercore or corestore is replicated to the stream, and the
ondiscoverykey
hook only works on that first replication.I have created a failing test for this (#44) which replicates a third (unrelated) corestore to the connection stream. Removing the line results in the test passing.
This may be intended behaviour, in which case it would be helpful if the docs clarify that if you replicate to an existing stream, you can only replicate one corestore to that stream, and it must be replicated to that stream before any other hypercores.
The text was updated successfully, but these errors were encountered: