Use ipfs@0.27.0 and ipfs-pubsub-room@1.0.1

This commit is contained in:
haad 2017-11-28 15:30:51 +01:00
parent 40fd279aad
commit c30c0b6cf9
6 changed files with 908 additions and 640 deletions

2
dist/es5/OrbitDB.js vendored
View File

@ -229,7 +229,7 @@ var OrbitDB = function () {
var heads = store._oplog.heads;
if (heads.length > 0) {
logger.debug('Send latest heads of \'' + address + '\':\n', (0, _stringify2.default)(heads, null, 2));
room.sendTo(peer, new Buffer((0, _stringify2.default)(heads)));
room.sendTo(peer, (0, _stringify2.default)(heads));
}
store.events.emit('peer', peer);
}

2
dist/orbitdb.min.js vendored

File diff suppressed because one or more lines are too long

1517
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
"orbit-db-feedstore": "~1.0.0",
"orbit-db-keystore": "~0.0.2",
"orbit-db-kvstore": "~1.0.0",
"orbit-db-pubsub": "~0.3.3"
"orbit-db-pubsub": "~0.3.5"
},
"devDependencies": {
"babel-core": "^6.26.0",
@ -34,7 +34,7 @@
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"datastore-level": "~0.7.0",
"ipfs": "~0.26.0",
"ipfs": "~0.27.0",
"ipfs-repo": "~0.18.0",
"mocha": "^4.0.1",
"p-each-series": "^1.0.0",

View File

@ -145,7 +145,7 @@ class OrbitDB {
let heads = store._oplog.heads
if (heads.length > 0) {
logger.debug(`Send latest heads of '${address}':\n`, JSON.stringify(heads, null, 2))
room.sendTo(peer, new Buffer(JSON.stringify(heads)))
room.sendTo(peer, JSON.stringify(heads))
}
store.events.emit('peer', peer)
}

View File

@ -130,15 +130,18 @@ describe('orbit-db - Automatic Replication', function() {
// Can't check this for now as db1 might've sent the heads to db2
// before we subscribe to the event
// db2.events.on('replicate.progress', (address, hash, entry) => {
// try {
// // Check that the head we received from the first peer is the latest
// assert.equal(entry.payload.value, 'hello' + (entryCount - 1))
// assert.equal(entry.clock.time, entryCount)
// } catch (e) {
// reject(e)
// }
// })
db2.events.on('replicate.progress', (address, hash, entry) => {
try {
// Check that the head we received from the first peer is the latest
// console.log(JSON.stringify(entry))
assert.equal(entry.payload.op, 'ADD')
assert.equal(entry.payload.key, null)
assert.notEqual(entry.payload.value.indexOf('hello'), -1)
assert.notEqual(entry.clock, null)
} catch (e) {
reject(e)
}
})
db2.events.on('replicated', (address) => {
try {