I have a folder that turned into a Dat with
$ dat share
Then in a different machine, I've access to it like (from node script)
const Dat = require('util').promisify(require('dat-node'))
dat = await Dat(DAT_FOLDER, { key })
dat.joinNetwork()
Everything is fine until now, The original machine tells me there is a new connection, so we are good. From here I don't know how to proceed. I want to write data from the peer machine to the original one. First, I though that it will be enough to make it writable, so I did like this
// got secretKey some how
if (typeof secretKey === 'string') secretKey = Buffer.from(secretKey, 'hex')
dat.archive.metadata._storage.secretKey.write(0, secretKey, done)
But writing to the archive only writes on my cloned Dat, how to push back to the original Dat? Is that even posible?
Dat is currently single-writer, which means that only one device can make changes.
Having multiple "writers" to a Dat is known as Multiwriter. That's a feature which is currently being developed for Dat, and should be rolled out later this year or early 2019.