Note: To keep this even smaller, we're using a small helper module called the hyperswarm replicator, which wraps a few Hyperswarm setup details.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memdb = require('memdb') | |
var crypto = require('crypto') | |
var hyperdrive = require('hyperdrive') | |
var drive = hyperdrive(memdb()) | |
var archive = drive.createArchive('21db26992a79966fc3336a711122ba160910cc6ce24bd6552cb21949d6c9d1d5', { live: true }) | |
console.log('key:', archive.key.toString('hex')) | |
archive.list(function (err, entries) { | |
console.log('err:', err) | |
console.log('entries:', entries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memdb = require('memdb') | |
var crypto = require('crypto') | |
var hyperdrive = require('hyperdrive') | |
var drive = hyperdrive(memdb()) | |
var archive = drive.createArchive(crypto.randomBytes(32).toString('hex'), { live: true }) | |
archive.list({ live: false }, function (err, entries) { | |
console.log('err:', err) | |
console.log('entries:', entries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am andrewosh on github. | |
* I am andrewosh (https://keybase.io/andrewosh) on keybase. | |
* I have a public key whose fingerprint is 1DA8 A91B D48B 043B 7A87 0A88 A6CA 39D1 CD8E 07CA | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 [create] check_nlink() - nlink 0 instead of 1 | |
2 [create+unlink] test_create_unlink() - write: No such file or directory | |
3 [mknod] check_nlink() - nlink 0 instead of 1 | |
4 [symlink] check_nlink() - nlink 0 instead of 1 | |
5 [link] check_nlink() - nlink 0 instead of 1 | |
6 [link-unlink-link] check_nlink() - nlink 0 instead of 1 | |
7 [mkfifo] test_mkfifo() - mkfifo: Function not implemented | |
8 [mkdir] check_nlink() - nlink 0 instead of 2 | |
8 [mkdir] check_dir_contents() - missing entry <.> | |
8 [mkdir] check_dir_contents() - missing entry <..> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am andrewosh on github. | |
* I am andrewosh (https://keybase.io/andrewosh) on keybase. | |
* I have a public key whose fingerprint is BBFD E0F7 7359 B5F6 9190 A8FB 7CBC DD51 0920 AC03 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ '/home/andrewosh/.nvm/versions/node/v9.3.0/bin/node', | |
1 verbose cli '/home/andrewosh/.nvm/versions/node/v9.3.0/bin/npm', | |
1 verbose cli 'i', | |
1 verbose cli '-g', | |
1 verbose cli 'protocol-buffers' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 verbose npm-session 02acbfc265a4bdf4 | |
5 silly install loadCurrentTree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```js | |
const store = corestore(path => { | |
if (path.indexOf('default') === -1) return raf(`${contentDest}/${path}`) | |
return raf(`${metadataDest}/${path}`) | |
}) | |
const drive = hyperdrive(store) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ram = require('random-access-memory') | |
const hypercore = require('hypercore') | |
const HyperBee = require('hyperbee') | |
const HyperBeeDown = require('hyperbeedown') | |
const PouchDB = require('pouchdb') | |
start() | |
async function start () { | |
const core = hypercore(ram) |