@fireproof/core 0.5.12 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/fireproof.js +225 -190
- package/dist/src/fireproof.js.map +1 -1
- package/dist/src/fireproof.mjs +225 -190
- package/dist/src/fireproof.mjs.map +1 -1
- package/package.json +1 -1
- package/src/sync.js +11 -10
package/package.json
CHANGED
package/src/sync.js
CHANGED
@@ -75,21 +75,22 @@ export class Sync {
|
|
75
75
|
// console.log('not a car', data.toString())
|
76
76
|
}
|
77
77
|
if (reader) {
|
78
|
+
console.log('got car')
|
78
79
|
this.status = 'parking car'
|
79
80
|
const blz = new Set()
|
80
81
|
for await (const block of reader.blocks()) {
|
81
82
|
blz.add(block)
|
82
83
|
}
|
83
84
|
const roots = await reader.getRoots()
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
85
|
+
console.log(
|
86
|
+
'got car',
|
87
|
+
roots.map(c => c.toString()),
|
88
|
+
this.database.clock.map(c => c.toString())
|
89
|
+
)
|
90
|
+
console.log(
|
91
|
+
'got blocks',
|
92
|
+
[...blz].map(({ cid }) => cid.toString())
|
93
|
+
)
|
93
94
|
// @ts-ignore
|
94
95
|
reader.entries = reader.blocks
|
95
96
|
await this.database.blocks.commit(
|
@@ -137,7 +138,7 @@ export class Sync {
|
|
137
138
|
this.peer.send(JSON.stringify({ ok: true }))
|
138
139
|
// this.pushBacklogResolve({ ok: true })
|
139
140
|
} else {
|
140
|
-
|
141
|
+
console.log('do send', carBlock.bytes.length)
|
141
142
|
this.status = 'sending diff car'
|
142
143
|
this.peer.send(carBlock.bytes)
|
143
144
|
// this.pushBacklogResolve({ ok: true })
|