#!/usr/bin/env node # © 2019 cel @f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519 # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. var pull = require('pull-stream') var Block = require('pull-block') var Client = require('ssb-client') var id = process.argv[2] if (!id) throw new TypeError('need blob id') Client(function (err, sbot) { if (err) throw err pull( sbot.blobs.get(id), Block({size: 5242879, zeroPadding: false}), pull.asyncMap(function (buf, cb) { pull(pull.once(buf), sbot.blobs.add(cb)) }), pull.log(sbot.close) ) })