|
@@ -0,0 +1,22 @@
|
|
1
|
+const maybe = require('call-me-maybe')
|
|
2
|
+const crypto = require('cobox-crypto')
|
|
3
|
+
|
|
4
|
+module.exports = (storage, address, opts) => new BlindReplicator(storage, address, opts)
|
|
5
|
+
|
|
6
|
+class BlindReplicator {
|
|
7
|
+ constructor (storage, address, opts = {}) {
|
|
8
|
+ this.address = address
|
|
9
|
+ this.discoveryKey = crypto.randomBytes(32)
|
|
10
|
+ this.name = opts.name
|
|
11
|
+ }
|
|
12
|
+
|
|
13
|
+ ready (callback) {
|
|
14
|
+ return maybe(callback, new Promise((resolve, reject) => {
|
|
15
|
+ resolve(true)
|
|
16
|
+ }))
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ save () {
|
|
20
|
+ return true
|
|
21
|
+ }
|
|
22
|
+}
|