Open RangerMauve opened 5 years ago
Ha, there is an issue about this! Was having a hard time debugging why when working on https://github.com/Frando/corestore it would not sync properly to node even though the general swarming seemed to work. Would be great to get this fixed! :-)
Yeah! it's next on my TODO list. I'll probably have it released early next week. :D
@RangerMauve Can we name change his thread to Advertise Dat and Archive version updates on the network
Dat-Js
, see the same version increment in dat-node
Dat-Js
, no version change in the dat-node
listening for it, plus archive.on('sync') never fires.I can't seem to update a version using Dat-Js
, then have the new version picked up by Dat-Node
instance. Seems like the first version is synced no problem, but more recent versions don't get through. archive.on('sync')
never fires in dat-node
either. datbase.org gets the version updates, and if I ping datbase.org,, then dat-node
updates. So Dat-Js
is updating databse.org, but not dat-node
.
Try this test to replicate what I am seeing:
Dat-Js
(I'm using this one in Glitch)dat-node
in nodejs (like this one) dat-node
update to the most recent versionMaybe this is in the difference in the way Dat-Js updates dat-node
vs datbase.org (hasbase
?)
More testing this morning, discovery issue #8 still exists between a new Dat-JS
and a listening dat-node
.
Create a new Dat with Dat-JS
and try to replicate the archive in a dat-node
, doesn't discover, unless you bring it up on a super peer like datbase.org...
I think the issue of needing a third party is related to your NAT.
The server dat-js uses is only able to create outgoing connections, so when a peer is behind a NAT that can't be hole punched easily, it cannot be connected to. Hashbase is different in that it can have incoming connections, too. So your node can send a connection to it through it's NAT.
I'm not sure what's up with updates not going through though. Maybe it's missing the {live: true}
flag somewhere?
I think hyperswarm will address the first problem once it lands. I'm not sure yet about the second problem.
Hmm, ok @RangerMauve thanks. I would have thought that the moe dat-gateway
would be able to connect to the dat-node
with no issue? Awww, NATs.
Any workaround suggestions? Maybe something like:
or maybe,
Dat-JS
websocket
to the nodejs running the dat-node
?I can try these out once I get it all set up. Seems a bit hacky though. I'm really interested in people being able to create the Dat in the mainstream browsers (and replicate it).
dat-node doesn't currently connect to a gateway but that would be awesome. @pvh talked about this being useful too.
You can try running a local discover-swarm-web server on your machine with the following command:
npx discovery-swarm-web
The only caveat is that you'll need to use http
instead of https
due to some browser restrictions when connecting to localhost.
Otherwise, I think we'll just need to wait a bit for hyperswarm to be finished so we can integrate it. Mafintosh seems to be saying that the NAT hole punching has gotten a lot better for situations like this.
We have a problem with creating archives inside dat-js where even though the archive is created, no other Dat tools are able to find it.
This is due to the fact that discovery-swarm-stream is only able to search for peers and doesn't advertise itself as a peer.
I propose the following:
cc @DougAnderson444 @karissa