Support js-ipfs 0.50.2 and go-ipfs 0.6.0

updating dependencies

Updating to node 12 image

updating dependencies

package-lock updates

offoading repo handling from tests

one more test fix

fixing message data handling

updating store deps
This commit is contained in:
Mark Henderson 2020-09-05 17:15:14 -04:00
parent 7a5478c6e0
commit a00688e941
26 changed files with 1605 additions and 4593 deletions

View File

@ -27,7 +27,7 @@ jobs:
# To see the list of pre-built images that CircleCI provides for most common languages see
# https://circleci.com/docs/2.0/circleci-images/
docker:
- image: circleci/node:10-browsers
- image: circleci/node:12-browsers
steps:
# Machine Setup
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each

View File

@ -4,7 +4,7 @@ deps:
npm install
test: deps
npm run test:all
npm run test:all -- --exit
npx validate-maintainers orbit-db --match --ci
build: test

6086
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "orbit-db",
"version": "0.25.3",
"version": "0.26.0-rc4",
"description": "Distributed p2p database on IPFS",
"author": "Haad",
"license": "MIT",
@ -19,19 +19,19 @@
"localstorage-down": "^0.6.7",
"logplease": "^1.2.14",
"multihashes": "~3.0.1",
"orbit-db-access-controllers": "^0.2.6",
"orbit-db-access-controllers": "^0.3.0",
"orbit-db-cache": "~0.3.0",
"orbit-db-counterstore": "~1.11.0",
"orbit-db-docstore": "~1.11.0",
"orbit-db-eventstore": "~1.11.0",
"orbit-db-feedstore": "~1.11.0",
"orbit-db-counterstore": "~1.12.0",
"orbit-db-docstore": "~1.12.0",
"orbit-db-eventstore": "~1.12.0",
"orbit-db-feedstore": "~1.12.0",
"orbit-db-identity-provider": "~0.3.0",
"orbit-db-io": "~0.2.0",
"orbit-db-io": "~0.3.0",
"orbit-db-keystore": "~0.3.0",
"orbit-db-kvstore": "~1.11.0",
"orbit-db-pubsub": "~0.5.5",
"orbit-db-kvstore": "~1.12.0",
"orbit-db-pubsub": "~0.6.0",
"orbit-db-storage-adapter": "~0.5.3",
"orbit-db-store": "~3.5.0"
"orbit-db-store": "~4.0.1"
},
"devDependencies": {
"adm-zip": "^0.4.16",
@ -49,7 +49,7 @@
"markdown-toc": "^1.2.0",
"mkdirp": "^1.0.4",
"mocha": "^8.1.1",
"orbit-db-test-utils": "0.10.3",
"orbit-db-test-utils": "^0.12.0",
"p-each-series": "^2.1.0",
"p-map": "^4.0.0",
"p-map-series": "^2.1.0",
@ -72,7 +72,7 @@
"examples:browser-windows": "start examples/browser/browser.html",
"lint:docs": "remark -qf -u validate-links .",
"test:all": "npm run test:browser-multiple-tabs && npm run test",
"test": "cross-env TEST=js mocha && cross-env TEST=go mocha;",
"test": "cross-env TEST=all mocha",
"test:browser-multiple-tabs": "npm run build:dist && cpy dist/orbitdb.min.js ./test/browser --rename=orbitdb.js && cpy node_modules/ipfs/dist/index.min.js ./test/browser --rename=ipfs.js && cpy node_modules/orbit-db-identity-provider/dist/index-browser.min.js ./test/browser --rename=identities.js && cpy node_modules/ipfs-log/dist/ipfslog.min.js ./test/browser && mocha ./test/browser/concurrent.spec.js",
"build": "npm run build:es5 && npm run build:debug && npm run build:dist && npm run build:examples && npm run build:docs/toc",
"build:examples": "webpack --config conf/webpack.example.config.js --sort-modules-by size",
@ -81,9 +81,6 @@
"build:docs/toc": "markdown-toc --no-first1 -i README.md && markdown-toc --no-first1 -i API.md && markdown-toc --no-first1 -i GUIDE.md && markdown-toc --no-first1 -i CHANGELOG.md && markdown-toc --no-first1 -i FAQ.md ",
"build:es5": "babel src --out-dir ./dist/es5/ --presets babel-preset-env --plugins babel-plugin-transform-runtime"
},
"go-ipfs": {
"version": "v0.5.1"
},
"standard": {
"env": "mocha",
"ignore": [

View File

@ -15,7 +15,7 @@ const getHeadsForDatabase = async store => {
const exchangeHeads = async (ipfs, address, peer, getStore, getDirectConnection, onMessage, onChannelCreated) => {
const _handleMessage = message => {
const msg = JSON.parse(message.data)
const msg = JSON.parse(Buffer.from(message.data).toString())
const { address, heads } = msg
onMessage(address, heads)
}

View File

@ -16,8 +16,6 @@ const {
const dbPath1 = './orbitdb/tests/counters/peer1'
const dbPath2 = './orbitdb/tests/counters/peer2'
const ipfsPath1 = './orbitdb/tests/counters/peer1/ipfs'
const ipfsPath2 = './orbitdb/tests/counters/peer2/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Counters (${API})`, function () {
@ -29,8 +27,6 @@ Object.keys(testAPIs).forEach(API => {
before(async () => {
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
config.daemon1.repo = ipfsPath1
config.daemon2.repo = ipfsPath2
ipfsd1 = await startIpfs(API, config.daemon1)
ipfsd2 = await startIpfs(API, config.daemon2)
ipfs1 = ipfsd1.api

View File

@ -22,7 +22,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = path.join('./orbitdb', 'tests', 'create-open')
const ipfsPath = path.join('./orbitdb', 'tests', 'create-open', 'ipfs')
const migrationFixturePath = path.join('./test', 'fixtures', 'migration', 'cache-schema-test')
const ipfsFixturesDir = path.join('./test', 'fixtures', 'ipfs')
@ -42,8 +41,6 @@ Object.keys(testAPIs).forEach(API => {
}
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -14,7 +14,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = './orbitdb/tests/create-open'
const ipfsPath = './orbitdb/tests/create-open/ipfs'
class CustomStore extends DocumentStore {
constructor (ipfs, id, dbname, options) {
@ -34,8 +33,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -21,7 +21,6 @@ const {
} = require('./utils')
const dbPath = './orbitdb/tests/customKeystore'
const ipfsPath = './orbitdb/tests/customKeystore/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Use a Custom Cache (${API})`, function() {
@ -33,8 +32,6 @@ Object.keys(testAPIs).forEach(API => {
store = await storage.createStore("local")
const cache = new CustomCache(store)
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -21,7 +21,6 @@ const {
Identities.addIdentityProvider(CustomTestKeystore().identityProvider)
const dbPath = './orbitdb/tests/customKeystore'
const ipfsPath = './orbitdb/tests/customKeystore/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Use a Custom Keystore (${API})`, function() {
@ -30,8 +29,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -14,7 +14,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = './orbitdb/tests/docstore'
const ipfsPath = './orbitdb/tests/docstore/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Document Store (${API})`, function() {
@ -23,8 +22,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1, db
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api
orbitdb1 = await OrbitDB.createInstance(ipfs, { directory: path.join(dbPath, '1') })

View File

@ -15,7 +15,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = './orbitdb/tests/drop'
const ipfsPath = './orbitdb/tests/drop/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Drop Database (${API})`, function() {
@ -25,8 +24,6 @@ Object.keys(testAPIs).forEach(API => {
let localDataPath
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -17,7 +17,6 @@ const {
const last = arr => arr[arr.length - 1]
const dbPath = './orbitdb/tests/eventlog'
const ipfsPath = './orbitdb/tests/eventlog/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Log Database (${API})`, function() {
@ -26,8 +25,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -17,7 +17,6 @@ const {
const last = arr => arr[arr.length - 1]
const dbPath = './orbitdb/tests/feed-load'
const ipfsPath = './orbitdb/tests/feed-load/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Feed Load Amount (${API})`, function() {
@ -26,8 +25,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1, db, address
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -17,7 +17,6 @@ const {
const last = arr => arr[arr.length - 1]
const dbPath = './orbitdb/tests/feed'
const ipfsPath = './orbitdb/tests/feed/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Feed Database (${API})`, function() {
@ -26,8 +25,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1, address
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -14,7 +14,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = './orbitdb/tests/kvstore'
const ipfsPath = './orbitdb/tests/kvstore/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Key-Value Database (${API})`, function() {
@ -23,8 +22,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -17,8 +17,6 @@ const {
const dbPath1 = './orbitdb/tests/multiple-databases/1'
const dbPath2 = './orbitdb/tests/multiple-databases/2'
const ipfsPath1 = './orbitdb/tests/multiple-databases/1/ipfs'
const ipfsPath2 = './orbitdb/tests/multiple-databases/2/ipfs'
const databaseInterfaces = [
{
@ -68,10 +66,6 @@ Object.keys(testAPIs).forEach(API => {
// Create two IPFS instances and two OrbitDB instances (2 nodes/peers)
before(async () => {
config.daemon1.repo = ipfsPath1
config.daemon2.repo = ipfsPath2
rmrf.sync(config.daemon1.repo)
rmrf.sync(config.daemon2.repo)
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
ipfsd1 = await startIpfs(API, config.daemon1)

View File

@ -21,7 +21,6 @@ const {
const dbPath1 = './orbitdb/tests/offline/db1'
const dbPath2 = './orbitdb/tests/offline/db2'
const ipfsPath = './orbitdb/tests/offline/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Offline mode (${API})`, function() {
@ -32,11 +31,6 @@ Object.keys(testAPIs).forEach(API => {
let localDataPath
before(async () => {
config.daemon1.repo = path.join(ipfsPath, '/1')
config.daemon2.repo = path.join(ipfsPath, '/2')
rmrf.sync(config.daemon1.repo)
rmrf.sync(config.daemon2.repo)
rmrf.sync(path.join(ipfsPath, '/2'))
rmrf.sync('./orbitdb/tests/offline')
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)

View File

@ -6,7 +6,6 @@ const OrbitDB = require('../src/OrbitDB')
const OrbitDBAddress = require('../src/orbit-db-address')
const dbPath = './orbitdb/tests/orbit-db-address'
const ipfsPath = './orbitdb/tests/orbit-db-address/ipfs'
const {
config,
@ -22,8 +21,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -19,7 +19,6 @@ const {
} = require('orbit-db-test-utils')
const dbPath = './orbitdb/tests/persistency'
const ipfsPath = './orbitdb/tests/persistency/ipfs'
const tests = [
{
@ -51,8 +50,6 @@ Object.keys(testAPIs).forEach(API => {
options.cache = new Cache(customStore)
}
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -17,8 +17,6 @@ const {
const dbPath1 = './orbitdb/tests/replicate-and-load/1'
const dbPath2 = './orbitdb/tests/replicate-and-load/2'
const ipfsPath1 = './orbitdb/tests/replicate-and-load/1/ipfs'
const ipfsPath2 = './orbitdb/tests/replicate-and-load/2/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Replicate and Load (${API})`, function() {
@ -28,10 +26,6 @@ Object.keys(testAPIs).forEach(API => {
let orbitdb1, orbitdb2
before(async () => {
config.daemon1.repo = ipfsPath1
config.daemon2.repo = ipfsPath2
rmrf.sync(config.daemon1.repo)
rmrf.sync(config.daemon2.repo)
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
ipfsd1 = await startIpfs(API, config.daemon1)

View File

@ -17,8 +17,6 @@ const {
const dbPath1 = './orbitdb/tests/replicate-automatically/1'
const dbPath2 = './orbitdb/tests/replicate-automatically/2'
const ipfsPath1 = './orbitdb/tests/replicate-automatically/1/ipfs'
const ipfsPath2 = './orbitdb/tests/replicate-automatically/2/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Automatic Replication (${API})`, function() {
@ -28,10 +26,6 @@ Object.keys(testAPIs).forEach(API => {
let orbitdb1, orbitdb2, db1, db2, db3, db4
before(async () => {
config.daemon1.repo = ipfsPath1
config.daemon2.repo = ipfsPath2
rmrf.sync(config.daemon1.repo)
rmrf.sync(config.daemon2.repo)
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
ipfsd1 = await startIpfs(API, config.daemon1)

View File

@ -18,8 +18,6 @@ const {
const dbPath1 = './orbitdb/tests/replication/1'
const dbPath2 = './orbitdb/tests/replication/2'
const ipfsPath1 = './orbitdb/tests/replication/1/ipfs'
const ipfsPath2 = './orbitdb/tests/replication/2/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Replication (${API})`, function() {
@ -33,10 +31,6 @@ Object.keys(testAPIs).forEach(API => {
let options
before(async () => {
config.daemon1.repo = ipfsPath1
config.daemon2.repo = ipfsPath2
rmrf.sync(config.daemon1.repo)
rmrf.sync(config.daemon2.repo)
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
ipfsd1 = await startIpfs(API, config.daemon1)

View File

@ -20,7 +20,6 @@ const {
const dbPath1 = './orbitdb/tests/create-open/1'
const dbPath2 = './orbitdb/tests/create-open/2'
const ipfsPath = './orbitdb/tests/create-open/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Replication Status (${API})`, function() {
@ -30,8 +29,6 @@ Object.keys(testAPIs).forEach(API => {
let localDataPath
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath1)
rmrf.sync(dbPath2)
ipfsd = await startIpfs(API, config.daemon1)

View File

@ -20,7 +20,6 @@ const {
const keysPath = './orbitdb/identity/identitykeys'
const dbPath = './orbitdb/tests/change-identity'
const ipfsPath = './orbitdb/tests/change-identity/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Set identities (${API})`, function() {
@ -31,8 +30,6 @@ Object.keys(testAPIs).forEach(API => {
let localDataPath
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api

View File

@ -18,7 +18,6 @@ const {
} = require('./utils')
const dbPath = './orbitdb/tests/write-permissions'
const ipfsPath = './orbitdb/tests/write-permissions/ipfs'
Object.keys(testAPIs).forEach(API => {
describe(`orbit-db - Write Permissions (${API})`, function() {
@ -27,8 +26,6 @@ Object.keys(testAPIs).forEach(API => {
let ipfsd, ipfs, orbitdb1, orbitdb2
before(async () => {
config.daemon1.repo = ipfsPath
rmrf.sync(config.daemon1.repo)
rmrf.sync(dbPath)
ipfsd = await startIpfs(API, config.daemon1)
ipfs = ipfsd.api