Open jaller94 opened 5 years ago
dat-node is being replaced by the Dat Software Development Kit, could you try using that instead and seeing if it works better?
@RangerMauve Ok, cool. Is there an equivalent of Dat(folderPath, {secretDir})
?
Hmm, the SDK doesn't have anything for secret storage at the moment. It just stores the secret along with the rest of the data.
Could you describe what you're working on so I can get a better picture of what needs to be done?
I'm downloading apps from the F-Droid store and create/update one dat archives per app. The dat archives can then be loaded by Dat Installer to install them on an Android phone.
It might make sense to use dat-store for keeping stuff online. You should be able to cURL your fdroid data, and then add the folder to dat-store which will turn it into an archive and watch for file changes.
dat-store should also be handling the networking layer in a more effective way (using the SDK). dat-node creates a separate swarm per archive which might get kinda heavy after a while, but dat-store shares a single swarm instance for all the archives.
Yes, I use dat-store
on a remote server to keep the archives online.
However, the creation of archives should be a oneshot job that can be run on a timer and should end when all updated repos are synced with at least one peer in the network (or after a timeout of 10 minutes or so).
The F-Droid repo has 2000+ apps and keeping all of them online on one machine (my laptop in this case) does not seem to be a good idea. That's why I want to listen for the initial sync and then move on to sync the next few hundreds of archives.
Ideally I would only want to connect to my list of peers, wait for them to reach 100% sync on the latest version and then disconnect, leaving it up to them to propagate it to other peers in the public network.
Dang, the syncing with peers thing is closely related to this issue, I think. 😅
With the SDK, you can specify a path as the first argument to Hyperdrive
and that'll be enough to turn it into an archive. To do a sync with a folder, you can use the diff-file-tree module.
My other option is to "blindly" keep them online for 5 minutes, then remove them from dat-store
and add the next batch.
Anyway, this may be getting a bit to off-topic. If things are moving to Dat SDK, I'll see what I can build with that one, instead of poking at issues of dat-node
.
I am reporting:
Bug Report
Please give us details about your installation to assist you. Run
dat -v
to see the version of Dat you are using.Expected behavior
All errors are catchable
Actual behavior
The following code sometimes crashes on me.
Sometimes it just crashes. Note that I am opening 163 archives at the same time, waiting for them to finish their initial sync.
The traceback doesn't look like
dat-node
is at fault, but I have to start somewhere on my journey to track down the issue. Maybe someone here knows more?Debug Logs
Output is not any different when running it with
DEBUG=dat
.